Testing Bugfix: refactor clean --python-cache to support all#31449
Merged
tgamblin merged 1 commit intospack:developfrom Jul 6, 2022
Merged
Testing Bugfix: refactor clean --python-cache to support all#31449tgamblin merged 1 commit intospack:developfrom
tgamblin merged 1 commit intospack:developfrom
Conversation
This was referenced Jul 5, 2022
There were two choices: 1) remove '-p' from '-a' or 2) allow monkeypatching the cleaning of the python cache since clean's test_function_calls isn't supposed to be actually cleaning anything. This commit supports the latter and adds a test case for `-p`.
7deb8a7 to
abd1d6e
Compare
tgamblin
approved these changes
Jul 6, 2022
bhatiaharsh
pushed a commit
to bhatiaharsh/spack
that referenced
this pull request
Aug 8, 2022
…1449) There were two choices: 1) remove '-p' from '-a' or 2) allow monkeypatching the cleaning of the python cache since clean's test_function_calls isn't supposed to be actually cleaning anything. This commit supports the latter and adds a test case for `-p`.
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.
I have now had two separate PRs run into the
test_function_callsfailure when cleaning--python-cacheas part of the-a(or--all) case. Specifically, anOSErrorexception is raised for the python 3.8 check:All of the other options that are tested by the function mock the associated functionality to simply count the number of calls. However, the python cache functionality was not included since the original function is not amenable to the simple mocking approach. This PR makes the treatment of that option consistent in the test method.
This PR also adds
test_remove_python_cachethat ensures coverage of the functionality without attempting to remove any files from the Spack instance.This testing issue/bug has arisen for at least the following PRs: