Skip to content

Commit

Permalink
Add support for multi-arch images to E2E tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan West <jonwest@redhat.com>
  • Loading branch information
jgwest committed Sep 16, 2024
1 parent a96aa79 commit 386612f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion hack/run-rollouts-manager-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if [ -f "/tmp/e2e-operator-run.log" ]; then
# Grep the log for unexpected errors
# - Ignore errors that are expected to occur

UNEXPECTED_ERRORS_FOUND_TEXT=`cat /tmp/e2e-operator-run.log | grep "ERROR" | grep -v "because it is being terminated" | grep -v "the object has been modified; please apply your changes to the latest version and try again" | grep -v "unable to fetch" | grep -v "StorageError"`
UNEXPECTED_ERRORS_FOUND_TEXT=`cat /tmp/e2e-operator-run.log | grep "ERROR" | grep -v "because it is being terminated" | grep -v "the object has been modified; please apply your changes to the latest version and try again" | grep -v "unable to fetch" | grep -v "StorageError"` | grep -v "client rate limiter Wait returned an error: context canceled"
UNEXPECTED_ERRORS_COUNT=`echo $UNEXPECTED_ERRORS_FOUND_TEXT | grep "ERROR" | wc -l`

if [ "$UNEXPECTED_ERRORS_COUNT" != "0" ]; then
Expand Down
15 changes: 10 additions & 5 deletions hack/run-upstream-argo-rollouts-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ cd argo-rollouts
git checkout $CURRENT_ROLLOUTS_VERSION
go mod tidy

# 2) Setup the Namespace
# 2) Replace 'argoproj/rollouts-demo' image with 'quay.io/jgwest-redhat/rollouts-demo' in E2E tests
# - The original 'argoproj/rollouts-demo' repository only has amd64 images, thus some of the E2E tests will not work on it.
# - 'quay.io/jgwest-redhat/rollouts-demo' is based on the same code, but built for other archs
find "$TMP_DIR/argo-rollouts/test/e2e" -type f | xargs sed -i.bak 's/argoproj\/rollouts-demo/quay.io\/jgwest-redhat\/rollouts-demo/g'

# 3) Setup the Namespace

kubectl delete ns argo-rollouts || true

Expand All @@ -35,7 +40,7 @@ kubectl create ns argo-rollouts
kubectl config set-context --current --namespace=argo-rollouts


# 3) Build, install, and start the argo-rollouts-manager controller
# 4) Build, install, and start the argo-rollouts-manager controller
cd $SCRIPT_DIR/..


Expand All @@ -52,7 +57,7 @@ if [ -z "$SKIP_RUN_STEP" ]; then
set -e
fi

# 4) Install Argo Rollouts into the Namespace via RolloutManager CR
# 5) Install Argo Rollouts into the Namespace via RolloutManager CR

cd $TMP_DIR/argo-rollouts

Expand Down Expand Up @@ -89,7 +94,7 @@ oc adm policy add-scc-to-user anyuid -z argo-rollouts -n argo-rollouts || true
oc adm policy add-scc-to-user anyuid -z default -n argo-rollouts || true


# 5) Run the E2E tests
# 6) Run the E2E tests
rm -f /tmp/test-e2e.log

set +e
Expand All @@ -98,7 +103,7 @@ make test-e2e | tee /tmp/test-e2e.log

set +x

# 6) Check and report the results for unexpected failures
# 7) Check and report the results for unexpected failures

echo "-----------------------------------------------------------------"
echo
Expand Down
5 changes: 2 additions & 3 deletions tests/e2e/fixture/rollouts/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ spec:
app: test-argo-app
spec:
containers:
# based on docker.io/kostiscodefresh/gitops-canary-app:v1.0
# mirrored to jgwest-redhat
- image: quay.io/jgwest-redhat/gitops-canary-app@sha256:4fdd3483fa119b413aa9e3c4459bfa2be399c0741ab7565d2a716e362fc1aa41
- image: nginxinc/nginx-unprivileged@sha256:0569e319d06556564ad40882ed35231461d06bec788b5aec00b83b6e9f3ced1a
# nginx v1.27, from https://hub.docker.com/layers/nginxinc/nginx-unprivileged/1.27/images/sha256-37404ae33c744fe1c1e1f752225f986ff32c0327240ab6e960573c0f6cb577c3?context=explore
name: webserver-simple
ports:
- containerPort: 8080
Expand Down

0 comments on commit 386612f

Please sign in to comment.