Merge pull request #21122 from ihmccreery/refactor-rebased

e2e.sh refactor
This commit is contained in:
Isaac Hollander McCreery 2016-02-17 13:04:21 -08:00
commit abd92a2112
2 changed files with 287 additions and 561 deletions

View File

@ -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