Skip to content

Commit

Permalink
maint: adjust tests to check for new output text
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Sep 9, 2023
1 parent 31434b9 commit e2f1cc3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
14 changes: 7 additions & 7 deletions tests/test_chartpress.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ def test_buildx(git_repo, capfd):
# Note: Parsing stderr for these logs may be fragile. We could probably omit
# it and just verify the registry manifests instead.

assert "[linux/amd64 1/1] FROM docker.io/library/alpine@" in stderr
assert "[linux/arm64 1/1] FROM docker.io/library/alpine@" in stderr
assert "[linux/ppc64le 1/1] FROM docker.io/library/alpine@" in stderr
assert "[linux/amd64 1/1] FROM docker.io/library/alpine" in stderr
assert "[linux/arm64 1/1] FROM docker.io/library/alpine" in stderr
assert "[linux/ppc64le 1/1] FROM docker.io/library/alpine" in stderr

# If there's only one platform it doesn't appear in the output logs
# assert "[linux/amd64 1/1] FROM docker.io/library/busybox@" in stderr
assert "[1/1] FROM docker.io/library/busybox@" in stderr
assert "[linux/arm64 1/1] FROM docker.io/library/busybox@" not in stderr
assert "[linux/ppc64le 1/1] FROM docker.io/library/busybox@" not in stderr
# assert "[linux/amd64 1/1] FROM docker.io/library/busybox" in stderr
assert "[1/1] FROM docker.io/library/busybox" in stderr
assert "[linux/arm64 1/1] FROM docker.io/library/busybox" not in stderr
assert "[linux/ppc64le 1/1] FROM docker.io/library/busybox" not in stderr

assert f"pushing manifest for localhost:5000/test-buildx/testimage:{tag}" in stderr
assert f"pushing manifest for localhost:5000/test-buildx/amd64only:{tag}" in stderr
Expand Down
9 changes: 6 additions & 3 deletions tests/test_repo_interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ def test_chartpress_run(git_repo, capfd, base_version):
print(out)
# verify image was built
# verify the fallback tag of "0.0.1" when a tag is missing
assert f"Successfully tagged testchart/testimage:{tag}" in out
assert (
f"Successfully tagged testchart/testimage:{tag}" in out
or f"naming to docker.io/testchart/testimage:{tag} in out"
)

# verify the passing of static and dynamic --build-args
assert "--build-arg TEST_STATIC_BUILD_ARG=test" in out
Expand Down Expand Up @@ -83,12 +86,12 @@ def test_chartpress_run(git_repo, capfd, base_version):

# verify usage of --force-build
out = _capture_output(["--force-build"], capfd)
assert "Successfully tagged" in out
assert "Successfully tagged" in out or "naming to" in out

# verify usage --skip-build and --tag
tag = "1.2.3-test.tag"
out = _capture_output(["--skip-build", "--tag", tag], capfd)
assert "Successfully tagged" not in out
assert "Successfully tagged" not in out or "naming to" in out
assert f"Updating testchart/Chart.yaml: version: {tag}" in out
assert f"Updating testchart/values.yaml: image: testchart/testimage:{tag}" in out

Expand Down

0 comments on commit e2f1cc3

Please sign in to comment.