cros deploy: uninstall all packages in one shot
This avoids making multiple trips to the DUT when we can uninstall
all of them in one go. This makes things faster in general, but
comes with a few minor changes:
- The progress bar is not as fine-grained.
- The operation aborts if one package fails in the middle.
Doesn't seem important enough when the actual unmerge operation is
relatively quick, and the chances of one failing is pretty low. I
think people would rather have these be faster than prettier.
BUG=chromium:1164732
TEST=`cros deploy --unmerge` with multiple packages still works
Change-Id: I23df20d17e51405ccba9aae80e40354f2bf8fc64
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2658934
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/cli/deploy_unittest.py b/cli/deploy_unittest.py
index 1126e50..c8b7668 100644
--- a/cli/deploy_unittest.py
+++ b/cli/deploy_unittest.py
@@ -415,7 +415,7 @@
# Check that deploy._Unmerge is called the right number of times.
self.assertEqual(self.emerge.call_count, 0)
- self.assertEqual(self.unmerge.call_count, len(packages))
+ self.unmerge.assert_called_once_with(mock.ANY, packages, '/')
self.assertEqual(
self.device.device.cmds,