Skip to content

Commit

Permalink
Only check the version label on releases
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mcdonnnj committed Jan 10, 2025
1 parent 26df388 commit 7e5f614
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/container_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 7e5f614

Please sign in to comment.