mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Refactor e2e.sh in preparation for YAML-ifying configs
Remove E2E_CLUSTER_NAME, E2E_NETWORK, and KUBE_GCE_INSTANCE_PREFIX from jobs that don't need them, because they are in their own project, and add defaults Fail on leaked resources by default Kill E2E_SET_CLUSTER_API_VERSION Rely on defaults for E2E_UP, E2E_TEST, E2E_DOWN Only PUBLISH_GREEN_VERSION for kubernetes-e2e-gce Directly export ZONE vars rather than chaining and setting locals Collapse E2E_CLUSTER_NAME, E2E_NETWORK, and KUBE_GCE_INSTANCE_PREFIX into E2E_NAME (always take the shortest of the three, to avoid name length problems Factor out soak vars Remove incorrect feature enablement ENV vars export GINKGO_TEST_ARGS directly, rather than looping through export at the bottom Directly export E2E Control Variables Export KUBEMARK ENV vars directly export KUBERNETES_PROVIDER directly Export JENKINS_PUBLISHED_VERSION directly, and don't use it where unnecessary; remove old CURRENT_RELEASE_PUBLISHED_VERSION export PROJECT and NETWORK_PROVIDER directly export node ENV vars directly export other shared cluster ENV vars directly Directly export CLOUDSDK ENV vars export GCE and AWS ENVs directly Various cleanup, including refactoring upgrades Fixup: no PERFORMANCE env for AWS Address comment Fixes for comments up to cebf501 Address comments through 81f39b8 Fix: default E2E_UP, E2E_TEST, E2E_DOWN Use JENKINS_FORCE_GET_TARS for upgrade jobs; fixes through 140ea2b Fix ubernetes-lite config Address rebased 2 comments Remove tab
This commit is contained in:
parent
ef505d8fa3
commit
83bfe2cfda
@ -49,6 +49,8 @@ if [[ "${E2E_UP,,}" == "true" || "${JENKINS_FORCE_GET_TARS:-}" =~ ^[yY]$ ]]; the
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# This is for test, staging, and prod jobs on GKE, where we want to
|
||||
# test what's running in GKE by default rather than some CI build.
|
||||
if [[ ${JENKINS_USE_SERVER_VERSION:-} =~ ^[yY]$ ]]; then
|
||||
# for GKE we can use server default version.
|
||||
bucket="release"
|
||||
@ -57,13 +59,16 @@ if [[ "${E2E_UP,,}" == "true" || "${JENKINS_FORCE_GET_TARS:-}" =~ ^[yY]$ ]]; the
|
||||
# everything up to, including ": "
|
||||
build_version="v${msg##*: }"
|
||||
echo "Using server version $bucket/$build_version"
|
||||
else # use JENKINS_PUBLISHED_VERSION
|
||||
else # use JENKINS_PUBLISHED_VERSION, for CI
|
||||
# Use a published version like "ci/latest" (default),
|
||||
# "release/latest", "release/latest-1", or "release/stable"
|
||||
JENKINS_PUBLISHED_VERSION=${JENKINS_PUBLISHED_VERSION:-'ci/latest'}
|
||||
IFS='/' read -a varr <<< "${JENKINS_PUBLISHED_VERSION}"
|
||||
bucket="${varr[0]}"
|
||||
build_version=$(gsutil cat gs://kubernetes-release/${JENKINS_PUBLISHED_VERSION}.txt)
|
||||
echo "Using published version $bucket/$build_version (from ${JENKINS_PUBLISHED_VERSION})"
|
||||
# Set CLUSTER_API_VERSION for GKE CI
|
||||
export CLUSTER_API_VERSION=$(echo ${build_version} | cut -c 2-)
|
||||
fi
|
||||
# At this point, we want to have the following vars set:
|
||||
# - bucket
|
||||
@ -72,11 +77,6 @@ if [[ "${E2E_UP,,}" == "true" || "${JENKINS_FORCE_GET_TARS:-}" =~ ^[yY]$ ]]; the
|
||||
"gs://kubernetes-release/${bucket}/${build_version}/kubernetes.tar.gz" \
|
||||
"gs://kubernetes-release/${bucket}/${build_version}/kubernetes-test.tar.gz" \
|
||||
.
|
||||
|
||||
# Set by GKE-CI to change the CLUSTER_API_VERSION to the git version
|
||||
if [[ ! -z ${E2E_SET_CLUSTER_API_VERSION:-} ]]; then
|
||||
export CLUSTER_API_VERSION=$(echo ${build_version} | cut -c 2-)
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! "${CIRCLECI:-}" == "true" ]]; then
|
||||
@ -154,13 +154,13 @@ fi
|
||||
|
||||
### Set up ###
|
||||
if [[ "${E2E_UP,,}" == "true" ]]; then
|
||||
go run ./hack/e2e.go ${E2E_OPT} -v --down
|
||||
go run ./hack/e2e.go ${E2E_OPT:-} -v --down
|
||||
fi
|
||||
if [[ "${gcp_list_resources}" == "true" ]]; then
|
||||
${gcp_list_resources_script} > "${gcp_resources_before}"
|
||||
fi
|
||||
if [[ "${E2E_UP,,}" == "true" ]]; then
|
||||
go run ./hack/e2e.go ${E2E_OPT} -v --up
|
||||
go run ./hack/e2e.go ${E2E_OPT:-} -v --up
|
||||
go run ./hack/e2e.go -v --ctl="version --match-server-version=false"
|
||||
if [[ "${gcp_list_resources}" == "true" ]]; then
|
||||
${gcp_list_resources_script} > "${gcp_resources_cluster_up}"
|
||||
@ -172,8 +172,8 @@ fi
|
||||
# with a nonzero error code if it was only tests that failed.
|
||||
if [[ "${E2E_TEST,,}" == "true" ]]; then
|
||||
# Check to make sure the cluster is up before running tests, and fail if it's not.
|
||||
go run ./hack/e2e.go ${E2E_OPT} -v --isup
|
||||
go run ./hack/e2e.go ${E2E_OPT} -v --test --test_args="${GINKGO_TEST_ARGS}" && exitcode=0 || exitcode=$?
|
||||
go run ./hack/e2e.go ${E2E_OPT:-} -v --isup
|
||||
go run ./hack/e2e.go ${E2E_OPT:-} -v --test --test_args="${GINKGO_TEST_ARGS}" && exitcode=0 || exitcode=$?
|
||||
if [[ "${E2E_PUBLISH_GREEN_VERSION:-}" == "true" && ${exitcode} == 0 && -n ${build_version:-} ]]; then
|
||||
echo "publish build_version to ci/latest-green.txt: ${build_version}"
|
||||
echo "${build_version}" > ${WORKSPACE}/build_version.txt
|
||||
@ -208,7 +208,7 @@ if [[ "${E2E_DOWN,,}" == "true" ]]; then
|
||||
# cloudprovider plus the processingRetryInterval from servicecontroller.go
|
||||
# for the wait between attempts.
|
||||
sleep 30
|
||||
go run ./hack/e2e.go ${E2E_OPT} -v --down
|
||||
go run ./hack/e2e.go ${E2E_OPT:-} -v --down
|
||||
fi
|
||||
if [[ "${gcp_list_resources}" == "true" ]]; then
|
||||
${gcp_list_resources_script} > "${gcp_resources_after}"
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user