diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2024-10-16 09:09:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-16 09:09:52 +0200 |
commit | 64f90c38be76399d1133be08254190fdefd06263 (patch) | |
tree | b1af18f09d119b7ac541595e5a9e5da99ec7ac4a | |
parent | d2f1e2992719beb4d8f56a1be267073e75c3741a (diff) | |
download | spack-64f90c38be76399d1133be08254190fdefd06263.tar.gz spack-64f90c38be76399d1133be08254190fdefd06263.tar.bz2 spack-64f90c38be76399d1133be08254190fdefd06263.tar.xz spack-64f90c38be76399d1133be08254190fdefd06263.zip |
unit-tests: oci/integration_test.py (#47006)
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
-rw-r--r-- | lib/spack/spack/test/oci/integration_test.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/spack/spack/test/oci/integration_test.py b/lib/spack/spack/test/oci/integration_test.py index 85673e953a..98c1258cd2 100644 --- a/lib/spack/spack/test/oci/integration_test.py +++ b/lib/spack/spack/test/oci/integration_test.py @@ -69,8 +69,8 @@ def test_buildcache_tag(install_mockery, mock_fetch, mutable_mock_env_path): """Tests whether we can create an OCI image from a full environment with multiple roots.""" env("create", "test") with ev.read("test"): - install("--add", "libelf") - install("--add", "trivial-install-test-package") + install("--fake", "--add", "libelf") + install("--fake", "--add", "trivial-install-test-package") registry = InMemoryOCIRegistry("example.com") @@ -83,7 +83,7 @@ def test_buildcache_tag(install_mockery, mock_fetch, mutable_mock_env_path): name = ImageReference.from_string("example.com/image:full_env") with ev.read("test") as e: - specs = e.all_specs() + specs = [x for x in e.all_specs() if not x.external] manifest, config = get_manifest_and_config(name) @@ -100,7 +100,7 @@ def test_buildcache_tag(install_mockery, mock_fetch, mutable_mock_env_path): name = ImageReference.from_string("example.com/image:single_spec") manifest, config = get_manifest_and_config(name) - assert len(manifest["layers"]) == 1 + assert len(manifest["layers"]) == len([x for x in libelf.traverse() if not x.external]) def test_buildcache_push_with_base_image_command(mutable_database, tmpdir): @@ -347,6 +347,10 @@ def test_best_effort_upload(mutable_database: spack.database.Database, monkeypat for s in mpileaks.traverse(): if s.name in without_manifest: continue + + if s.external: + continue + # This should not raise a 404. manifest, _ = get_manifest_and_config(image.with_tag(default_tag(s))) @@ -358,6 +362,10 @@ def test_best_effort_upload(mutable_database: spack.database.Database, monkeypat for s in mpileaks.traverse(): if s.name in without_manifest: continue + + if s.external: + continue + expected_digests = { pkg_to_own_digest[t.name] for t in s.traverse(deptype=("link", "run"), root=True) |