Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions integration-tests/push-to-external-registry-idempotent/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ verify_single_release() {
local image_url image_arch image_shasum

image_url=$(jq -r '.status.artifacts.images[0]?.urls[0] // ""' <<< "${release_json}")
image_arch=$(jq -r '.status.artifacts.images[0]?.arches[0] // ""' <<< "${release_json}")
image_shasum=$(jq -r '.status.artifacts.images[0]?.shasum // ""' <<< "${release_json}")

echo "Checking Image URL..."
Expand All @@ -48,12 +47,24 @@ verify_single_release() {
failures=$((failures+1))
fi

echo "Checking Image Arch..."
if [ -n "${image_arch}" ]; then
echo "✅️ image_arch: ${image_arch}"
if [ -n "${PTSV_EXPECTED_ARCHES:-}" ]; then
local image_arches
image_arches=$(jq -r '.status.artifacts.images[0]?.arches // [] | sort | join(" ")' <<< "${release_json}")
if [ "${image_arches}" = "${PTSV_EXPECTED_ARCHES}" ]; then
echo "✅️ Found required image arches: $PTSV_EXPECTED_ARCHES"
else
echo "🔴 Expected image arches: '$PTSV_EXPECTED_ARCHES', found: ${image_arches}"
failures=$((failures+1))
fi
else
echo "🔴 image_arch was empty"
failures=$((failures+1))
image_arch=$(jq -r '.status.artifacts.images[0]?.arches[0] // ""' <<< "${release_json}")
echo "Checking Image Arch..."
if [ -n "${image_arch}" ]; then
echo "✅️ image_arch: ${image_arch}"
else
echo "🔴 image_arch was empty"
failures=$((failures+1))
fi
fi

echo "Checking Image Shasum..."
Expand Down
4 changes: 4 additions & 0 deletions integration-tests/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ if [[ -n "${PTSV_BUILD_PIPELINE}" ]]; then
)
fi

if [ -z "$PTSV_EXPECTED_ARCHES" ]; then
PTSV_EXPECTED_ARCHES=""
fi

# --- Main Script Execution ---

# Trap EXIT signal to call cleanup function
Expand Down
Loading