Fix failing test

This commit is contained in:
psakiev 2025-05-08 13:52:16 -06:00
parent 200191cc3d
commit 9fe2796e9d

View File

@ -196,7 +196,7 @@ def test_buildcache_autopush(tmp_path, install_mockery, mock_fetch):
def test_buildcache_exclude(tmp_path, install_mockery, mock_fetch):
"""Test buildcache with autopush"""
"""Test buildcache with autopush can exclude"""
mirror_dir = tmp_path / "mirror_a"
mirror(
@ -213,12 +213,18 @@ def test_buildcache_exclude(tmp_path, install_mockery, mock_fetch):
# Install and generate build cache index
PackageInstaller([s.package], fake=True, explicit=True).install()
found_file = URLBuildcacheEntry.get_manifest_filename(s)
missing_file = URLBuildcacheEntry.get_manifest_filename(s["libelf"])
found_dirs = os.path.join(
*URLBuildcacheEntry.get_relative_path_components(BuildcacheComponent.SPEC), s.name
)
missing_dirs = os.path.join(
*URLBuildcacheEntry.get_relative_path_components(BuildcacheComponent.SPEC),
s["libelf"].name,
)
missing_file = spack.binary_distribution.tarball_name(s["libelf"], ".spec.json")
found_file = spack.binary_distribution.tarball_name(s, ".spec.json")
assert (mirror_dir / "build_cache" / found_file).exists()
assert not (mirror_dir / "build_cache" / missing_file).exists()
assert (mirror_dir / found_dirs / found_file).exists()
assert not (mirror_dir / missing_dirs / missing_file).exists()
def test_buildcache_sync(