-
Notifications
You must be signed in to change notification settings - Fork 71
Optimize integration test runtime #689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -103,15 +103,21 @@ jobs: | |||||||||||||||||||||||||||||||||
| helm-version: "v3.19.2" | ||||||||||||||||||||||||||||||||||
| releaseName: "test-release" | ||||||||||||||||||||||||||||||||||
| id: bake | ||||||||||||||||||||||||||||||||||
| - name: Set up buildx | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
| docker buildx create --use --name draft-builder || docker buildx use draft-builder | ||||||||||||||||||||||||||||||||||
| docker buildx inspect --bootstrap | ||||||||||||||||||||||||||||||||||
| - name: Build and Push image | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
| export SHELL=/bin/bash | ||||||||||||||||||||||||||||||||||
| eval $(minikube -p minikube docker-env) | ||||||||||||||||||||||||||||||||||
| docker build -f ./langtest/Dockerfile -t testapp ./langtest/ | ||||||||||||||||||||||||||||||||||
| docker tag testapp host.minikube.internal:5001/testapp | ||||||||||||||||||||||||||||||||||
| echo -n "verifying images:" | ||||||||||||||||||||||||||||||||||
| docker images | ||||||||||||||||||||||||||||||||||
| docker push host.minikube.internal:5001/testapp | ||||||||||||||||||||||||||||||||||
| docker buildx build \ | ||||||||||||||||||||||||||||||||||
| --cache-from=type=gha,scope=${{ inputs.language }}-helm \ | ||||||||||||||||||||||||||||||||||
| --cache-to=type=gha,scope=${{ inputs.language }}-helm,mode=max \ | ||||||||||||||||||||||||||||||||||
| -f ./langtest/Dockerfile \ | ||||||||||||||||||||||||||||||||||
| -t host.minikube.internal:5001/testapp \ | ||||||||||||||||||||||||||||||||||
| --push \ | ||||||||||||||||||||||||||||||||||
| ./langtest/ | ||||||||||||||||||||||||||||||||||
| echo 'Curling host.minikube.internal test app images from minikube' | ||||||||||||||||||||||||||||||||||
| minikube ssh "curl http://host.minikube.internal:5001/v2/testapp/tags/list" | ||||||||||||||||||||||||||||||||||
| # Deploys application based on manifest files from previous step | ||||||||||||||||||||||||||||||||||
|
|
@@ -146,14 +152,29 @@ jobs: | |||||||||||||||||||||||||||||||||
| kubectl get svc | ||||||||||||||||||||||||||||||||||
| echo 'Starting minikube tunnel' | ||||||||||||||||||||||||||||||||||
| minikube tunnel > /dev/null 2>&1 & tunnelPID=$! | ||||||||||||||||||||||||||||||||||
| sleep 120 | ||||||||||||||||||||||||||||||||||
| trap 'kill $tunnelPID' EXIT | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
| trap 'kill $tunnelPID' EXIT | |
| trap 'kill "$tunnelPID" >/dev/null 2>&1 || true' EXIT |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Polling the service IP via kubectl get svc ... .items[1]... is brittle because it depends on list ordering and the presence of at least two services. Prefer selecting the specific Service by name (e.g., the release service) or by label selector, then JSONPath into that object.
| SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) | |
| SERVICEIP=$(kubectl get svc test-release-testapp -o jsonpath='{.status.loadBalancer.ingress[0].ip}') |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as earlier: buildx is set up before eval $(minikube ... docker-env), which risks creating/using the builder against the wrong Docker daemon. Move buildx setup to after switching to Minikube’s Docker endpoint (or re-create/use the builder after switching).
| - name: Set up buildx | |
| run: | | |
| docker buildx create --use --name draft-builder || docker buildx use draft-builder | |
| docker buildx inspect --bootstrap | |
| - name: Build and Push Image | |
| continue-on-error: true | |
| run: | | |
| export SHELL=/bin/bash | |
| eval $(minikube -p minikube docker-env) | |
| - name: Build and Push Image | |
| continue-on-error: true | |
| run: | | |
| export SHELL=/bin/bash | |
| eval $(minikube -p minikube docker-env) | |
| docker buildx create --use --name draft-builder || docker buildx use draft-builder | |
| docker buildx inspect --bootstrap |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same teardown concern: trap 'kill $tunnelPID' EXIT can fail the step if kill returns non-zero (PID already exited). Make the kill non-fatal so it can’t override the curl loop’s success.
| trap 'kill $tunnelPID' EXIT | |
| trap 'kill $tunnelPID 2>/dev/null || true' EXIT |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Service IP polling is still using .items[1] which is order-dependent. Use kubectl get svc <expected-service-name> -o jsonpath=... (or a label selector) to make this deterministic.
| SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) | |
| SERVICEIP=$(kubectl get svc -l app=testapp -o jsonpath='{.items[0].status.loadBalancer.ingress[0].ip}') |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Buildx setup occurs before switching Docker to Minikube (eval $(minikube ... docker-env) in the next step). This can lead to the builder being created on the wrong daemon. Recommend setting up (or re-selecting) the buildx builder after switching to Minikube’s Docker environment.
| run: | | |
| run: | | |
| eval $(minikube -p minikube docker-env) |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trap 'kill $tunnelPID' EXIT should ignore errors; if minikube tunnel exits early, kill may fail and cause the step to be marked failed under bash -e. Make tunnel cleanup best-effort.
| trap 'kill $tunnelPID' EXIT | |
| trap 'kill "$tunnelPID" >/dev/null 2>&1 || true' EXIT |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JSONPath .items[1]... approach for finding the Service IP is non-deterministic and may break if Service ordering changes. Prefer querying the exact Service (name/selector) before extracting .status.loadBalancer.ingress[0].ip.
| SERVICEIP=$(kubectl get svc -o jsonpath={'.items[1].status.loadBalancer.ingress[0].ip'}) | |
| SERVICEIP=$(kubectl get svc -l app=testapp -o jsonpath='{.items[0].status.loadBalancer.ingress[0].ip}') |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In manifest-update, buildx is configured before switching to the Minikube Docker daemon (eval $(minikube ... docker-env) happens later). With --load, building against the wrong daemon would leave the image unavailable to the cluster. Move buildx setup after switching to Minikube’s Docker env (or re-create/use the builder after the switch).
| run: | | |
| run: | | |
| export SHELL=/bin/bash | |
| eval $(minikube -p minikube docker-env) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker buildx create --useis executed beforeeval $(minikube ... docker-env), so the builder may be created against the runner’s default Docker daemon instead of the Minikube daemon. That can cause the subsequentdocker buildx build(after switching DOCKER_HOST) to fail to find the builder or to build/push from the wrong daemon. Consider moving buildx setup into the same step after the Minikubedocker-envcall (or explicitly creating/using the builder after switching to Minikube’s Docker endpoint).