diff options
author | Harmen Stoppels <me@harmenstoppels.nl> | 2024-11-25 11:53:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-25 11:53:28 +0100 |
commit | bf12bb57e7277e1eff9315bcf9e2c7cc9c4825dc (patch) | |
tree | 18da2b1e8047634f39ef4e104c47f391e13fdd11 /lib | |
parent | 406c73ae1152b0f66b299fab2973d3b25dee8118 (diff) | |
download | spack-bf12bb57e7277e1eff9315bcf9e2c7cc9c4825dc.tar.gz spack-bf12bb57e7277e1eff9315bcf9e2c7cc9c4825dc.tar.bz2 spack-bf12bb57e7277e1eff9315bcf9e2c7cc9c4825dc.tar.xz spack-bf12bb57e7277e1eff9315bcf9e2c7cc9c4825dc.zip |
install_test: first look at builder, then package (#47735)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/install_test.py | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/lib/spack/spack/install_test.py b/lib/spack/spack/install_test.py index a4401fc878..d639548ecf 100644 --- a/lib/spack/spack/install_test.py +++ b/lib/spack/spack/install_test.py @@ -375,23 +375,16 @@ class PackageTest: for name in method_names: try: - # Prefer the method in the package over the builder's. - # We need this primarily to pick up arbitrarily named test - # methods but also some build-time checks. - fn = getattr(builder.pkg, name, getattr(builder, name)) - - msg = f"RUN-TESTS: {phase_name}-time tests [{name}]" - print_message(logger, msg, verbose) - - fn() - + fn = getattr(builder, name, None) or getattr(builder.pkg, name) except AttributeError as e: - msg = f"RUN-TESTS: method not implemented [{name}]" - print_message(logger, msg, verbose) - - self.add_failure(e, msg) + print_message(logger, f"RUN-TESTS: method not implemented [{name}]", verbose) + self.add_failure(e, f"RUN-TESTS: method not implemented [{name}]") if fail_fast: break + continue + + print_message(logger, f"RUN-TESTS: {phase_name}-time tests [{name}]", verbose) + fn() if have_tests: print_message(logger, "Completed testing", verbose) |