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
This commit is contained in:
Massimiliano Culpo 2022-11-13 13:09:22 +01:00 committed by GitHub
parent 4ebe57cd64
commit 03224e52d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -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")

View File

@ -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 = [