From 041f4a84630b143c7f77a2eb460f14d999097532 Mon Sep 17 00:00:00 2001 From: chaodaiG <45011425+chaodaiG@users.noreply.github.com> Date: Mon, 6 May 2019 12:35:37 -0700 Subject: [PATCH] Update test-infra: some fixes (#1263) * Update test-infra: some fixes * Install Istio from Addon --- Gopkg.lock | 4 ++-- vendor/github.com/knative/test-infra/scripts/README.md | 3 +++ .../github.com/knative/test-infra/scripts/e2e-tests.sh | 10 ++++++++-- .../github.com/knative/test-infra/scripts/library.sh | 8 -------- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 9ec09ec0f..fe9e2e5b6 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -116,14 +116,14 @@ [[projects]] branch = "master" - digest = "1:e52814856d1182e3f80db2dbab1b2888f1d7c486a9094ebc27aa18d241e43a08" + digest = "1:f27efa11fb1aec3e502e2ed95d9a1211a93f8a791b7da0a06fdade0d98de5008" name = "github.com/knative/test-infra" packages = [ "scripts", "tools/dep-collector", ] pruneopts = "UT" - revision = "6a4119d87d5e494fe74b17d096db3e5aca57361c" + revision = "75f6ca1c4dc3b3ae5dc1a1a433753957a9340e83" [[projects]] digest = "1:5985ef4caf91ece5d54817c11ea25f182697534f8ae6521eadcd628c142ac4b6" diff --git a/vendor/github.com/knative/test-infra/scripts/README.md b/vendor/github.com/knative/test-infra/scripts/README.md index 06cff45e0..f78418711 100644 --- a/vendor/github.com/knative/test-infra/scripts/README.md +++ b/vendor/github.com/knative/test-infra/scripts/README.md @@ -172,6 +172,9 @@ This is a helper script for Knative E2E test scripts. To use it: will immediately start the tests against the cluster currently configured for `kubectl`. +1. By default Istio is installed on the cluster via Addon, using `--skip-istio` if + you choose not to have it preinstalled. + 1. You can force running the tests against a specific GKE cluster version by using the `--cluster-version` flag and passing a full version as the flag value. 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 868b36d7e..5c5155945 100755 --- a/vendor/github.com/knative/test-infra/scripts/e2e-tests.sh +++ b/vendor/github.com/knative/test-infra/scripts/e2e-tests.sh @@ -166,7 +166,7 @@ function create_test_cluster() { # Smallest cluster required to run the end-to-end-tests local CLUSTER_CREATION_ARGS=( - --gke-create-command="container clusters create --quiet --enable-autoscaling --min-nodes=${E2E_MIN_CLUSTER_NODES} --max-nodes=${E2E_MAX_CLUSTER_NODES} --scopes=cloud-platform --enable-basic-auth --no-issue-client-certificate ${EXTRA_CLUSTER_CREATION_FLAGS[@]}" + --gke-create-command="container clusters create --quiet --enable-autoscaling --min-nodes=${E2E_MIN_CLUSTER_NODES} --max-nodes=${E2E_MAX_CLUSTER_NODES} --scopes=cloud-platform --enable-basic-auth --no-issue-client-certificate ${GKE_ADDONS} ${EXTRA_CLUSTER_CREATION_FLAGS[@]}" --gke-shape={\"default\":{\"Nodes\":${E2E_MIN_CLUSTER_NODES}\,\"MachineType\":\"${E2E_CLUSTER_MACHINE}\"}} --provider=gke --deployment=gke @@ -258,7 +258,7 @@ function create_test_cluster_with_retries() { # Exit if test succeeded [[ "$(get_test_return_code)" == "0" ]] && return # If test failed not because of cluster creation stockout, return - [[ -z "$(grep -Eio 'does not have enough resources to fulfill the request' ${cluster_creation_log})" ]] && return + [[ -z "$(grep -Eio 'does not have enough resources available to fulfill the request' ${cluster_creation_log})" ]] && return done done } @@ -349,9 +349,11 @@ function fail_test() { RUN_TESTS=0 EMIT_METRICS=0 SKIP_KNATIVE_SETUP=0 +SKIP_ISTIO=0 GCP_PROJECT="" E2E_SCRIPT="" E2E_CLUSTER_VERSION="" +GKE_ADDONS="" EXTRA_CLUSTER_CREATION_FLAGS=() EXTRA_KUBETEST_FLAGS=() E2E_SCRIPT_CUSTOM_FLAGS=() @@ -383,6 +385,7 @@ function initialize() { --run-tests) RUN_TESTS=1 ;; --emit-metrics) EMIT_METRICS=1 ;; --skip-knative-setup) SKIP_KNATIVE_SETUP=1 ;; + --skip-istio) SKIP_ISTIO=1 ;; *) [[ $# -ge 2 ]] || abort "missing parameter after $1" shift @@ -412,6 +415,8 @@ function initialize() { is_protected_gcr ${KO_DOCKER_REPO} && \ abort "\$KO_DOCKER_REPO set to ${KO_DOCKER_REPO}, which is forbidden" + (( SKIP_ISTIO )) || GKE_ADDONS="--addons=Istio" + readonly RUN_TESTS readonly EMIT_METRICS readonly GCP_PROJECT @@ -419,6 +424,7 @@ function initialize() { readonly EXTRA_CLUSTER_CREATION_FLAGS readonly EXTRA_KUBETEST_FLAGS readonly SKIP_KNATIVE_SETUP + readonly GKE_ADDONS if (( ! RUN_TESTS )); then create_test_cluster diff --git a/vendor/github.com/knative/test-infra/scripts/library.sh b/vendor/github.com/knative/test-infra/scripts/library.sh index 3a2cafa6e..b3216758f 100755 --- a/vendor/github.com/knative/test-infra/scripts/library.sh +++ b/vendor/github.com/knative/test-infra/scripts/library.sh @@ -321,14 +321,6 @@ function report_go_test() { # Install the latest stable Knative/serving in the current cluster. function start_latest_knative_serving() { header "Starting Knative Serving" - subheader "Installing Istio" - echo "Running Istio CRD from ${KNATIVE_ISTIO_CRD_YAML}" - kubectl apply -f ${KNATIVE_ISTIO_CRD_YAML} || return 1 - wait_until_batch_job_complete istio-system || return 1 - echo "Installing Istio from ${KNATIVE_ISTIO_YAML}" - kubectl apply -f ${KNATIVE_ISTIO_YAML} || return 1 - wait_until_pods_running istio-system || return 1 - kubectl label namespace default istio-injection=enabled || return 1 subheader "Installing Knative Serving" echo "Installing Serving from ${KNATIVE_SERVING_RELEASE}" kubectl apply -f ${KNATIVE_SERVING_RELEASE} || return 1