From 1e1f2689e633ae14e15f1553ebd27eae6eada8bf Mon Sep 17 00:00:00 2001 From: Nicholas McDonnell <50747025+mcdonnnj@users.noreply.github.com> Date: Fri, 10 Jan 2025 06:05:24 -0500 Subject: [PATCH] Only check the version label on releases Update the test configuration to only check the org.opencontainers.image.version label on releases. We must make this change because the docker/metadata-action will only populate the label with an appropriate value on a release. Otherwise it will be the branch that is sourced when building the image. --- tests/container_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/container_test.py b/tests/container_test.py index bddee4b..449c117 100644 --- a/tests/container_test.py +++ b/tests/container_test.py @@ -77,6 +77,9 @@ def test_log_version(dockerc, project_version, version_container): ), f"Container version output to log does not match project version file {VERSION_FILE}" +@pytest.mark.skipif( + RELEASE_TAG in [None, ""], reason="this is not a release (RELEASE_TAG not set)" +) def test_container_version_label_matches(project_version, version_container): """Verify the container version label is the correct version.""" assert (