cros_mark_as_stable: Add --overlay-type option.
Add a shortcut form of --overlays option that lets the script expand
'public', 'internal', and 'both' into explicit overlay lists, instead
of listing every single overlay on the command line.
BUG=None
TEST=run_tests
Change-Id: I990854fbaf3e2dc19e5507ef8d6236f80091b8ff
Reviewed-on: https://chromium-review.googlesource.com/1171850
Commit-Ready: Don Garrett <dgarrett@chromium.org>
Tested-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
diff --git a/scripts/cros_mark_as_stable_unittest.py b/scripts/cros_mark_as_stable_unittest.py
index f9a3e7a..c522035 100644
--- a/scripts/cros_mark_as_stable_unittest.py
+++ b/scripts/cros_mark_as_stable_unittest.py
@@ -279,9 +279,19 @@
self._overlay_tracking_branch[overlay] = remote_ref.ref
self._git_project_overlays[remote_ref.project_name] = [overlay]
+ self.PatchObject(portage_util, 'FindOverlays',
+ return_value=self._overlays)
self.PatchObject(git, 'GetTrackingBranchViaManifest',
side_effect=remote_refs)
+ def testMainWithOverlayTypeCommit(self):
+ """Test Main with Commit options."""
+ cros_mark_as_stable.main(
+ ['commit', '--all', '--overlay-type', 'both'])
+ self.mock_work_on_commit.assert_called_once_with(
+ mock.ANY, self._overlays, self._overlay_tracking_branch,
+ self._git_project_overlays, 'manifest', None)
+
def testMainWithCommit(self):
"""Test Main with Commit options."""
cros_mark_as_stable.main(