-
Notifications
You must be signed in to change notification settings - Fork 12
add a components arg to checkout only select components #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
98a810d
add a components arg to checkout only select components
jedwards4b 987df5a
only use components if populated
jedwards4b 91d4851
fix pylint issue
jedwards4b bf52ac6
add a test
jedwards4b f78d60f
another test
jedwards4b 4fdf180
one more test
jedwards4b c1b5b09
remove unneeded logic
jedwards4b 3f4c88f
fix comment
jedwards4b File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -752,6 +752,18 @@ def _check_container_full_pre_checkout(self, overall, tree): | |
| self._check_simple_opt_empty(tree) | ||
| self._check_mixed_ext_branch_required_pre_checkout(overall, tree) | ||
|
|
||
| def _check_container_component_post_checkout(self, overall, tree): | ||
| self.assertEqual(overall, 0) | ||
| self._check_simple_opt_ok(tree) | ||
| self._check_simple_tag_empty(tree) | ||
| self._check_simple_branch_empty(tree) | ||
|
|
||
| def _check_container_component_post_checkout2(self, overall, tree): | ||
| self.assertEqual(overall, 0) | ||
| self._check_simple_opt_ok(tree) | ||
| self._check_simple_tag_empty(tree) | ||
| self._check_simple_branch_ok(tree) | ||
|
|
||
| def _check_container_full_post_checkout(self, overall, tree): | ||
| self.assertEqual(overall, 0) | ||
| self._check_simple_tag_ok(tree) | ||
|
|
@@ -1219,6 +1231,38 @@ def test_container_full(self): | |
| self.status_args) | ||
| self._check_container_full_post_checkout(overall, tree) | ||
|
|
||
| def test_container_component(self): | ||
| """Verify that optional component checkout works | ||
| """ | ||
| # create the test repository | ||
| under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME) | ||
|
|
||
| # create the top level externals file | ||
| self._generator.container_full(under_test_dir) | ||
|
|
||
| # inital checkout, first try a nonexistant component argument noref | ||
| checkout_args = ['simp_opt', 'noref'] | ||
| checkout_args.extend(self.checkout_args) | ||
|
|
||
| with self.assertRaises(RuntimeError): | ||
| self.execute_cmd_in_dir(under_test_dir, checkout_args) | ||
|
|
||
| checkout_args = ['simp_opt'] | ||
| checkout_args.extend(self.checkout_args) | ||
|
|
||
| overall, tree = self.execute_cmd_in_dir(under_test_dir, | ||
| checkout_args) | ||
|
|
||
| overall, tree = self.execute_cmd_in_dir(under_test_dir, | ||
| self.status_args) | ||
| self._check_container_component_post_checkout(overall, tree) | ||
| checkout_args.append('simp_branch') | ||
| overall, tree = self.execute_cmd_in_dir(under_test_dir, | ||
| checkout_args) | ||
| overall, tree = self.execute_cmd_in_dir(under_test_dir, | ||
| self.status_args) | ||
| self._check_container_component_post_checkout2(overall, tree) | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good test but it seems that adding tests is not part of our standard PR template. Still, adding a mention of the new test is a good idea (IMHO). |
||
| def test_mixed_simple(self): | ||
| """Verify that a mixed use repo can serve as a 'full' container, | ||
| pulling in a set of externals and a seperate set of sub-externals. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this does the right thing but I feel adding an else before the loop would clarify that only one of these actions is intended to be taken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I originally had it that way and pylint flagged it as "too many branches."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pylint needs to get a life 👎 (but okay to leave it as is).