Adjust test

This commit is contained in:
psakiev 2024-04-29 13:44:24 -06:00
parent 93ff027045
commit 669ca81d74
2 changed files with 16 additions and 13 deletions

View File

@ -7,6 +7,7 @@
import sys import sys
import jinja2 import jinja2
import pathlib
import pytest import pytest
import archspec.cpu import archspec.cpu
@ -2802,3 +2803,18 @@ def test_concretization_version_order():
Version("develop"), # likely development version Version("develop"), # likely development version
Version("2.0"), # deprecated Version("2.0"), # deprecated
] ]
@pytest.mark.only_clingo("clingo only re-use feature being tested")
@pytest.mark.regression("38484")
def test_git_ref_version_can_be_reused(monkeypatch, mock_packages, install_mockery_mutable_config, mock_git_version_info):
repo_path, filename, commits = mock_git_version_info
monkeypatch.setattr(
spack.package_base.PackageBase, "git", pathlib.Path(repo_path).as_uri(), raising=False
)
first_spec = spack.spec.Spec("git-test-commit@git.v1.0=1.0+generic_install+feature").concretized()
first_spec.package.do_install()
second_spec = spack.spec.Spec("git-test-commit@git.v1.0=1.0+generic_install~feature")
with spack.config.override("concretizer:reuse", True):
second_spec.concretize()
assert second_spec.dag_hash() != first_spec.dag_hash()

View File

@ -7,7 +7,6 @@
import shutil import shutil
import sys import sys
import pathlib
import pytest import pytest
import llnl.util.filesystem as fs import llnl.util.filesystem as fs
@ -631,15 +630,3 @@ def test_install_from_binary_with_missing_patch_succeeds(
s.package.do_install(package_cache_only=True, dependencies_cache_only=True, unsigned=True) s.package.do_install(package_cache_only=True, dependencies_cache_only=True, unsigned=True)
assert temporary_store.db.query_local_by_spec_hash(s.dag_hash()) assert temporary_store.db.query_local_by_spec_hash(s.dag_hash())
@pytest.mark.regression("38484")
def test_git_ref_version_can_be_reused(monkeypatch, mock_git_version_info, install_mockery):
repo_path, filename, commits = mock_git_version_info
monkeypatch.setattr(
spack.package_base.PackageBase, "git", pathlib.Path(repo_path).as_uri(), raising=False
)
spec = spack.spec.Spec("git-test-commit@git.v1.0=1.0+generic_install+feature").concretized()
spec.package.do_install()
new_spec = spack.spec.Spec("git-test-commit@git.v1.0=1.0+generic_install~feature")
new_spec.concretize()