summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGregory Becker <becker33@llnl.gov>2024-04-26 10:38:09 -0700
committerMassimiliano Culpo <massimiliano.culpo@gmail.com>2024-04-29 14:13:10 +0200
commit859745f1a92462fa21af54d80ad6a01cca484dd8 (patch)
tree61cc734202be874a97b8c4a2f02010fe43b6fcc1 /lib
parentddabb8b12c8f1fe2463736444dcd4d5c2c6d601d (diff)
downloadspack-859745f1a92462fa21af54d80ad6a01cca484dd8.tar.gz
spack-859745f1a92462fa21af54d80ad6a01cca484dd8.tar.bz2
spack-859745f1a92462fa21af54d80ad6a01cca484dd8.tar.xz
spack-859745f1a92462fa21af54d80ad6a01cca484dd8.zip
Run audits on windows
Add debug log for external detection tests. The debug log is used to print which test is being executed. Skip version audit on Windows where appropriate
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/audit.py8
-rw-r--r--lib/spack/spack/cmd/audit.py2
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/spack/spack/audit.py b/lib/spack/spack/audit.py
index 96225fd6ac..6d3a63c8a6 100644
--- a/lib/spack/spack/audit.py
+++ b/lib/spack/spack/audit.py
@@ -1046,7 +1046,7 @@ external_detection = AuditClass(
group="externals",
tag="PKG-EXTERNALS",
description="Sanity checks for external software detection",
- kwargs=("pkgs",),
+ kwargs=("pkgs", "debug_log"),
)
@@ -1069,7 +1069,7 @@ def packages_with_detection_tests():
@external_detection
-def _test_detection_by_executable(pkgs, error_cls):
+def _test_detection_by_executable(pkgs, debug_log, error_cls):
"""Test drive external detection for packages"""
import spack.detection
@@ -1095,6 +1095,7 @@ def _test_detection_by_executable(pkgs, error_cls):
for idx, test_runner in enumerate(
spack.detection.detection_tests(pkg_name, spack.repo.PATH)
):
+ debug_log(f"[{__file__}]: running test {idx} for package {pkg_name}")
specs = test_runner.execute()
expected_specs = test_runner.expected_specs
@@ -1115,11 +1116,10 @@ def _test_detection_by_executable(pkgs, error_cls):
for candidate in expected_specs:
try:
idx = specs.index(candidate)
+ matched_detection.append((candidate, specs[idx]))
except (AttributeError, ValueError):
pass
- matched_detection.append((candidate, specs[idx]))
-
def _compare_extra_attribute(_expected, _detected, *, _spec):
result = []
# Check items are of the same type
diff --git a/lib/spack/spack/cmd/audit.py b/lib/spack/spack/cmd/audit.py
index c8cef494ef..77bbbc5d82 100644
--- a/lib/spack/spack/cmd/audit.py
+++ b/lib/spack/spack/cmd/audit.py
@@ -84,7 +84,7 @@ def externals(parser, args):
return
pkgs = args.name or spack.repo.PATH.all_package_names()
- reports = spack.audit.run_group(args.subcommand, pkgs=pkgs)
+ reports = spack.audit.run_group(args.subcommand, pkgs=pkgs, debug_log=tty.debug)
_process_reports(reports)