Bugfix: Disallow starting build-time check method names with 'test_' #44730
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.
This PR flags attempts to run build-time check methods (https://spack.readthedocs.io/en/latest/packaging_guide.html#adding-installation-phase-tests) as stand-alone methods (https://spack.readthedocs.io/en/latest/packaging_guide.html#adding-stand-alone-tests) because the check method's name incorrectly starts with
test_
, which is now reserved for stand-alone test methods. Left alone, the test appears to pass when it was never actually run.Motivation
Updates to stand-alone tests revealed a flaw in processing build-time check method names. If someone gives a build-time (e.g.,
@run_after
) method a name startingtest_
,spack test run
will claim it runs it successfully when it doesn't actually execute the method. This PRFor example, given a build-time check of
test_execute
forlibstdcompat
-- that callsmake("test")
-- basically runs as expected forspack install --test=root libstdcompat
:BUT it also appears to run successfully as a stand-alone test:
even though there is no way for the test to actually run/do anything.
TODO