diff --git a/.github/workflows/nfr.yml b/.github/workflows/nfr.yml index 5808edb6bd..629c250f1e 100644 --- a/.github/workflows/nfr.yml +++ b/.github/workflows/nfr.yml @@ -149,6 +149,7 @@ jobs: run: make create-gke-router || true - name: Run Tests + continue-on-error: true working-directory: ./tests run: | if ${{ needs.vars.outputs.test_label != 'all' }}; then diff --git a/tests/scripts/run-tests-gcp-vm.sh b/tests/scripts/run-tests-gcp-vm.sh index 3cff298694..bc36825454 100755 --- a/tests/scripts/run-tests-gcp-vm.sh +++ b/tests/scripts/run-tests-gcp-vm.sh @@ -15,11 +15,7 @@ gcloud compute ssh --zone "${GKE_CLUSTER_ZONE}" --project="${GKE_PROJECT}" usern bash -s" <"${SCRIPT_DIR}"/remote-scripts/run-nfr-tests.sh retcode=$? -if [ ${retcode} -ne 0 ]; then - echo "Error running tests on VM" - exit 1 -fi - +## Download results regardless of test outcome (needed for debugging failures) ## Use rsync if running locally (faster); otherwise if in the pipeline don't download an SSH config if [ "${CI}" = "false" ]; then gcloud compute config-ssh --ssh-config-file ngf-gcp.ssh >/dev/null @@ -28,6 +24,12 @@ else gcloud compute scp --zone "${GKE_CLUSTER_ZONE}" --project="${GKE_PROJECT}" --recurse username@"${RESOURCE_NAME}":~/nginx-gateway-fabric/tests/results . fi +## Exit with error code after downloading results if tests failed +if [ ${retcode} -ne 0 ]; then + echo "Error running tests on VM" + exit 1 +fi + ## If tearing down the longevity test, we need to collect logs from gcloud and add to the results if [ "${STOP_LONGEVITY}" = "true" ]; then version=${NGF_VERSION}