diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2022-01-26 14:19:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-26 14:19:15 +0100 |
commit | 3cf5df7e3b43166dc626a44885a9353c7365091d (patch) | |
tree | af4d35b5c9e24e14d0a59df13ec6aab4e784acf9 | |
parent | b700335be70b8711e05a98d7f7a93fc03faece55 (diff) | |
download | spack-3cf5df7e3b43166dc626a44885a9353c7365091d.tar.gz spack-3cf5df7e3b43166dc626a44885a9353c7365091d.tar.bz2 spack-3cf5df7e3b43166dc626a44885a9353c7365091d.tar.xz spack-3cf5df7e3b43166dc626a44885a9353c7365091d.zip |
Ensure "spack unit-test" can bootstrap clingo (#28572)
-rw-r--r-- | lib/spack/spack/cmd/unit_test.py | 7 | ||||
-rw-r--r-- | lib/spack/spack/test/data/config/bootstrap.yaml | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/spack/spack/cmd/unit_test.py b/lib/spack/spack/cmd/unit_test.py index 241201de61..3d2a55164b 100644 --- a/lib/spack/spack/cmd/unit_test.py +++ b/lib/spack/spack/cmd/unit_test.py @@ -22,6 +22,7 @@ import llnl.util.filesystem import llnl.util.tty.color as color from llnl.util.tty.colify import colify +import spack.bootstrap import spack.paths description = "run spack's unit tests (wrapper around pytest)" @@ -175,6 +176,12 @@ def add_back_pytest_args(args, unknown_args): def unit_test(parser, args, unknown_args): global pytest + + # Ensure clingo is available before switching to the + # mock configuration used by unit tests + with spack.bootstrap.ensure_bootstrap_configuration(): + spack.bootstrap.ensure_clingo_importable_or_raise() + if pytest is None: vendored_pytest_dir = os.path.join( spack.paths.external_path, 'pytest-fallback' diff --git a/lib/spack/spack/test/data/config/bootstrap.yaml b/lib/spack/spack/test/data/config/bootstrap.yaml index 9e78aa7946..5ecff745cf 100644 --- a/lib/spack/spack/test/data/config/bootstrap.yaml +++ b/lib/spack/spack/test/data/config/bootstrap.yaml @@ -6,7 +6,7 @@ bootstrap: Buildcache generated from a public workflow using Github Actions. The sha256 checksum of binaries is checked before installation. info: - url: file:///home/culpo/production/spack/mirrors/clingo + url: file:///home/spack/production/spack/mirrors/clingo homepage: https://github.com/alalazo/spack-bootstrap-mirrors releases: https://github.com/alalazo/spack-bootstrap-mirrors/releases trusted: {} |