diff --git a/Gopkg.lock b/Gopkg.lock index 33250636a8a4..ac0b7198460c 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -382,11 +382,11 @@ [[projects]] branch = "master" - digest = "1:fc21c9ecb1d30c7b1ef093f90ac10fe26ed90e801136dff6019eff03495450c6" + digest = "1:00f434f614520a4b48ef3f6d3ed5c7a1a4f89be1bed98c250711413f6da2eb51" name = "github.com/knative/test-infra" packages = ["."] pruneopts = "T" - revision = "c016a2a5676d3e363ad7bc94dc8d57a0aa1a0a9d" + revision = "c21d3a832727d5d4334e734c0878eac3a5a07ae7" [[projects]] branch = "master" diff --git a/vendor/github.com/knative/test-infra/scripts/e2e-tests.sh b/vendor/github.com/knative/test-infra/scripts/e2e-tests.sh index e3d1bde93d01..7c921048254a 100755 --- a/vendor/github.com/knative/test-infra/scripts/e2e-tests.sh +++ b/vendor/github.com/knative/test-infra/scripts/e2e-tests.sh @@ -152,6 +152,10 @@ function dump_cluster_state() { # Create a test cluster with kubetest and call the current script again. function create_test_cluster() { + # Fail fast during setup. + set -o errexit + set -o pipefail + header "Creating test cluster" # Smallest cluster required to run the end-to-end-tests local CLUSTER_CREATION_ARGS=( @@ -188,6 +192,9 @@ function create_test_cluster() { (( EMIT_METRICS )) && test_cmd_args+=" --emit-metrics" echo "Test script is ${E2E_SCRIPT}" download_k8s || return 1 + # Don't fail test for kubetest, as it might incorrectly report test failure + # if teardown fails (for details, see success() below) + set +o errexit kubetest "${CLUSTER_CREATION_ARGS[@]}" \ --up \ --down \ @@ -196,6 +203,8 @@ function create_test_cluster() { --test-cmd "${E2E_SCRIPT}" \ --test-cmd-args "${test_cmd_args}" echo "Test subprocess exited with code $?" + # Ignore any errors below, this is a best-effort cleanup and shouldn't affect the test result. + set +o errexit # Delete target pools and health checks that might have leaked. # See https://github.com/knative/serving/issues/959 for details. # TODO(adrcunha): Remove once the leak issue is resolved. @@ -221,6 +230,10 @@ function create_test_cluster() { # Setup the test cluster for running the tests. function setup_test_cluster() { + # Fail fast during setup. + set -o errexit + set -o pipefail + # Set the required variables if necessary. if [[ -z ${K8S_USER_OVERRIDE} ]]; then export K8S_USER_OVERRIDE=$(gcloud config get-value core/account) @@ -302,10 +315,6 @@ function initialize() { readonly RUN_TESTS readonly EMIT_METRICS - # Fail fast during setup. - set -o errexit - set -o pipefail - if (( ! RUN_TESTS )); then create_test_cluster else