Make stage use concrete specs from environment#22320
Merged
becker33 merged 3 commits intospack:developfrom Mar 29, 2021
Merged
Conversation
5c2f4b8 to
d04c6c6
Compare
becker33
requested changes
Mar 24, 2021
Member
becker33
left a comment
There was a problem hiding this comment.
This needs a test. Otherwise LGTM
Member
Author
|
Okay, I don't know how to test this other than mocking do_stage. Let me know if you want something better (and how). |
haampie
commented
Mar 26, 2021
Same as in spack#21642, the idea is that we want to easily stage a package that fails to build in a complex environment. Instead of making the user create a spec by hand (basically transforming all the rules in the environment manifest into a spec, defying the purpose of the environment...), use the provided spec as a filter for the already concretized specs. This also speeds up things, cause we don't have to reconcretize.
079c0b6 to
c0e7464
Compare
becker33
approved these changes
Mar 29, 2021
Comment on lines
+19
to
+31
| def test_stage_spec(monkeypatch): | ||
| """Verify that staging specs works.""" | ||
|
|
||
| expected = set(['trivial-install-test-package', 'mpileaks']) | ||
|
|
||
| def fake_stage(pkg, mirror_only=False): | ||
| expected.remove(pkg.name) | ||
|
|
||
| monkeypatch.setattr(spack.package.PackageBase, 'do_stage', fake_stage) | ||
|
|
||
| stage('trivial-install-test-package', 'mpileaks') | ||
|
|
||
| assert len(expected) == 0 |
Member
There was a problem hiding this comment.
That's a fun way of mocking this test to only test the command, not the underlying functionality. +1
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Same as in #21642, the idea is that
we want to easily stage a package that fails to build in a complex
environment. Instead of making the user create a spec by hand (basically
transforming all the rules in the environment manifest into a spec,
defying the purpose of the environment...), use the provided spec as a
filter for the already concretized specs. This also speeds up things,
cause we don't have to reconcretize.
pinging @scheibelp and @becker33