Fix splicing related unit tests (#46914)
Some assertion are not testing DAG invariants, and they are passing only because of the simple structure of the builtin.mock repository on develop. Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
This commit is contained in:
parent
e187508485
commit
d5966e676d
@ -833,7 +833,8 @@ def test_lockfile_spliced_specs(environment_from_manifest, install_mockery):
|
||||
# The one spec is mpileaks
|
||||
for _, spec in e2.concretized_specs():
|
||||
assert spec.spliced
|
||||
assert spec["mpi"].satisfies(zmpi)
|
||||
assert spec["mpi"].satisfies(f"zmpi@{zmpi.version}")
|
||||
assert spec["mpi"].build_spec.satisfies(zmpi)
|
||||
|
||||
|
||||
def test_init_from_lockfile(environment_from_manifest):
|
||||
|
@ -2295,8 +2295,9 @@ def test_explicit_splices(
|
||||
|
||||
spec = spack.spec.Spec("hdf5 ^zmpi").concretized()
|
||||
|
||||
assert spec.satisfies(f"^mpich/{mpich_spec.dag_hash()}")
|
||||
assert spec.satisfies(f"^mpich@{mpich_spec.version}")
|
||||
assert spec.build_spec.dependencies(name="zmpi", deptype="link")
|
||||
assert spec["mpi"].build_spec.satisfies(mpich_spec)
|
||||
assert not spec.build_spec.satisfies(f"^mpich/{mpich_spec.dag_hash()}")
|
||||
assert not spec.dependencies(name="zmpi", deptype="link")
|
||||
|
||||
|
@ -967,7 +967,7 @@ def test_install_fail_on_interrupt(install_mockery, mock_fetch, monkeypatch):
|
||||
"""Test ctrl-c interrupted install."""
|
||||
spec_name = "pkg-a"
|
||||
err_msg = "mock keyboard interrupt for {0}".format(spec_name)
|
||||
installer = create_installer([spec_name], {})
|
||||
installer = create_installer([spec_name], {"fake": True})
|
||||
setattr(inst.PackageInstaller, "_real_install_task", inst.PackageInstaller._install_task)
|
||||
# Raise a KeyboardInterrupt error to trigger early termination
|
||||
monkeypatch.setattr(inst.PackageInstaller, "_install_task", _interrupt)
|
||||
@ -997,7 +997,7 @@ def _install_fail_my_build_exception(installer, task, install_status, **kwargs):
|
||||
|
||||
def test_install_fail_single(install_mockery, mock_fetch, monkeypatch):
|
||||
"""Test expected results for failure of single package."""
|
||||
installer = create_installer(["pkg-a"], {})
|
||||
installer = create_installer(["pkg-a"], {"fake": True})
|
||||
|
||||
# Raise a KeyboardInterrupt error to trigger early termination
|
||||
monkeypatch.setattr(inst.PackageInstaller, "_install_task", _install_fail_my_build_exception)
|
||||
@ -1012,7 +1012,7 @@ def test_install_fail_single(install_mockery, mock_fetch, monkeypatch):
|
||||
|
||||
def test_install_fail_multi(install_mockery, mock_fetch, monkeypatch):
|
||||
"""Test expected results for failure of multiple packages."""
|
||||
installer = create_installer(["pkg-a", "pkg-c"], {})
|
||||
installer = create_installer(["pkg-a", "pkg-c"], {"fake": True})
|
||||
|
||||
# Raise a KeyboardInterrupt error to trigger early termination
|
||||
monkeypatch.setattr(inst.PackageInstaller, "_install_task", _install_fail_my_build_exception)
|
||||
|
Loading…
Reference in New Issue
Block a user