Skip to content

Commit 4b0eb37

Browse files
authored
Upload test results even if test fails (#4112)
1 parent a74c28f commit 4b0eb37

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.github/workflows/nfr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ jobs:
149149
run: make create-gke-router || true
150150

151151
- name: Run Tests
152+
continue-on-error: true
152153
working-directory: ./tests
153154
run: |
154155
if ${{ needs.vars.outputs.test_label != 'all' }}; then

tests/scripts/run-tests-gcp-vm.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ gcloud compute ssh --zone "${GKE_CLUSTER_ZONE}" --project="${GKE_PROJECT}" usern
1515
bash -s" <"${SCRIPT_DIR}"/remote-scripts/run-nfr-tests.sh
1616
retcode=$?
1717

18-
if [ ${retcode} -ne 0 ]; then
19-
echo "Error running tests on VM"
20-
exit 1
21-
fi
22-
18+
## Download results regardless of test outcome (needed for debugging failures)
2319
## Use rsync if running locally (faster); otherwise if in the pipeline don't download an SSH config
2420
if [ "${CI}" = "false" ]; then
2521
gcloud compute config-ssh --ssh-config-file ngf-gcp.ssh >/dev/null
@@ -28,6 +24,12 @@ else
2824
gcloud compute scp --zone "${GKE_CLUSTER_ZONE}" --project="${GKE_PROJECT}" --recurse username@"${RESOURCE_NAME}":~/nginx-gateway-fabric/tests/results .
2925
fi
3026

27+
## Exit with error code after downloading results if tests failed
28+
if [ ${retcode} -ne 0 ]; then
29+
echo "Error running tests on VM"
30+
exit 1
31+
fi
32+
3133
## If tearing down the longevity test, we need to collect logs from gcloud and add to the results
3234
if [ "${STOP_LONGEVITY}" = "true" ]; then
3335
version=${NGF_VERSION}

0 commit comments

Comments
 (0)