-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Test package detection in a systematic way #21343
Closed
alalazo
wants to merge
7
commits into
spack:develop
from
alalazo:feature/test_for_package_detection_in_package_py
Closed
Test package detection in a systematic way #21343
alalazo
wants to merge
7
commits into
spack:develop
from
alalazo:feature/test_for_package_detection_in_package_py
Conversation
This file contains 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
alalazo
commented
Jan 27, 2021
Comment on lines
654
to
704
# Data used to test external package detection | ||
detection_tests = { | ||
'paths': [ | ||
# Ubuntu 18.04, system compilers without Fortran | ||
{ | ||
'layout': [ | ||
{'subdir': ['bin'], 'name': 'gcc', 'output': 'echo 7.5.0'}, | ||
{'subdir': ['bin'], 'name': 'g++', 'output': 'echo 7.5.0'} | ||
], | ||
'results': [{'spec': 'gcc@7.5.0 languages=c,c++'}] | ||
}, | ||
# Mock a version < 7 of GCC that requires -dumpversion and | ||
# errors with -dumpfullversion | ||
{ | ||
'layout': [ | ||
{ | ||
'subdir': ['bin'], 'name': 'gcc-5', | ||
'output': """ | ||
if [[ "$1" == "-dumpversion" ]] ; then | ||
echo "5.5.0" | ||
else | ||
echo "gcc-5: fatal error: no input files" | ||
echo "compilation terminated." | ||
exit 1 | ||
fi | ||
""" | ||
}, | ||
{'subdir': ['bin'], 'name': 'g++-5', 'output': 'echo 5.5.0'}, | ||
{'subdir': ['bin'], 'name': 'gfortran-5', 'output': 'echo 5.5.0'} | ||
], | ||
'results': [ | ||
{'spec': 'gcc@5.5.0 languages=c,c++,fortran'} | ||
] | ||
}, | ||
# Multiple compilers present at the same time | ||
{ | ||
'layout': [ | ||
{'subdir': ['bin'], 'name': 'x86_64-linux-gnu-gcc-6', 'output': 'echo 6.5.0'}, | ||
{'subdir': ['bin'], 'name': 'x86_64-linux-gnu-gcc-10', 'output': 'echo 10.1.0'}, | ||
{'subdir': ['bin'], 'name': 'x86_64-linux-gnu-g++-10', 'output': 'echo 10.1.0'} | ||
], | ||
'results': [ | ||
{'spec': 'gcc@6.5.0 languages=c'}, | ||
{'spec': 'gcc@10.1.0 languages=c,c++'} | ||
] | ||
} | ||
] | ||
} |
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.
@scheibelp Is this along the lines of what you had in mind?
4 tasks
This commit adds a new test that iterates through all packages that implement detection and have a `detection_test.yaml` file alongside `package.py`. This YAML file contains specifications to perform detection tests.
This is much faster than going through Spack API that imports Python modules.
alalazo
force-pushed
the
feature/test_for_package_detection_in_package_py
branch
from
February 8, 2021 13:18
5f22785
to
b65504d
Compare
Closing since we decided #18175 is the way to go. |
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.
closes #18175
This is a PR competing with #18175, to try a different implementation where all the data for the detection tests is in the corresponding
package.py
.