summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2022-11-13 13:09:22 +0100
committerGitHub <noreply@github.com>2022-11-13 13:09:22 +0100
commit03224e52d221e6e833072f3a58cc65593a4bf97f (patch)
tree55145dda5bca0f8d186e259204aa4207d6c3d93a
parent4ebe57cd64f2fbf7b83cbea1ffb5baad6b0f72e4 (diff)
downloadspack-03224e52d221e6e833072f3a58cc65593a4bf97f.tar.gz
spack-03224e52d221e6e833072f3a58cc65593a4bf97f.tar.bz2
spack-03224e52d221e6e833072f3a58cc65593a4bf97f.tar.xz
spack-03224e52d221e6e833072f3a58cc65593a4bf97f.zip
Speed-up bootstrap and architecture unit tests (#33865)
* Speed-up bootstrap mirror unit test The unit test doesn't need to concretize, since it checks only metadata for the mirror. * architecture.py: use "default_mock_concretization" for slow test
-rw-r--r--lib/spack/spack/test/architecture.py4
-rw-r--r--lib/spack/spack/test/cmd/bootstrap.py1
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/spack/spack/test/architecture.py b/lib/spack/spack/test/architecture.py
index ef95e4b383..3a49f77a7a 100644
--- a/lib/spack/spack/test/architecture.py
+++ b/lib/spack/spack/test/architecture.py
@@ -70,11 +70,11 @@ def test_user_input_combination(config, target_str, os_str):
assert spec.architecture.target == TEST_PLATFORM.target(target_str)
-def test_default_os_and_target(config):
+def test_default_os_and_target(default_mock_concretization):
"""Test that is we don't specify `os=` or `target=` we get the default values
after concretization.
"""
- spec = spack.spec.Spec("libelf").concretized()
+ spec = default_mock_concretization("libelf")
assert spec.architecture.os == str(TEST_PLATFORM.operating_system("default_os"))
assert spec.architecture.target == TEST_PLATFORM.target("default_target")
diff --git a/lib/spack/spack/test/cmd/bootstrap.py b/lib/spack/spack/test/cmd/bootstrap.py
index 81ba1e2cee..61b8b913c8 100644
--- a/lib/spack/spack/test/cmd/bootstrap.py
+++ b/lib/spack/spack/test/cmd/bootstrap.py
@@ -182,6 +182,7 @@ def test_bootstrap_mirror_metadata(mutable_config, linux_os, monkeypatch, tmpdir
"""
old_create = spack.mirror.create
monkeypatch.setattr(spack.mirror, "create", lambda p, s: old_create(p, []))
+ monkeypatch.setattr(spack.spec.Spec, "concretized", lambda p: p)
# Create the mirror in a temporary folder
compilers = [