Skip to content

Commit

Permalink
Merge pull request kubernetes#17610 from ixdy/resource-check
Browse files Browse the repository at this point in the history
Auto commit by PR queue bot
  • Loading branch information
k8s-merge-robot committed Nov 24, 2015
2 parents 0dbadda + 0a465da commit 3117fa4
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions hack/jenkins/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ case ${JOB_NAME} in
: ${KUBE_GCE_INSTANCE_PREFIX:="gce-soak-weekly-1-1"}
: ${KUBE_GCS_STAGING_PATH_SUFFIX:="soak-1.1"}
: ${PROJECT:="kubernetes-jenkins"}
: ${FAIL_ON_GCP_RESOURCE_LEAK:="true"}
;;

# Runs tests on GCE soak cluster for latest 1.1 ci release.
Expand Down Expand Up @@ -1685,9 +1686,11 @@ fi
### Set up ###
if [[ "${E2E_UP,,}" == "true" ]]; then
go run ./hack/e2e.go ${E2E_OPT} -v --down
if [[ "${gcp_list_resources}" == "true" ]]; then
${gcp_list_resources_script} > "${gcp_resources_before}"
fi
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 -v --ctl="version --match-server-version=false"
if [[ "${gcp_list_resources}" == "true" ]]; then
Expand Down Expand Up @@ -1735,12 +1738,15 @@ if [[ "${E2E_DOWN,,}" == "true" ]]; then
# for the wait between attempts.
sleep 30
go run ./hack/e2e.go ${E2E_OPT} -v --down
if [[ "${gcp_list_resources}" == "true" ]]; then
${gcp_list_resources_script} > "${gcp_resources_after}"
fi
fi
if [[ "${gcp_list_resources}" == "true" ]]; then
${gcp_list_resources_script} > "${gcp_resources_after}"
fi

if [[ -f "${gcp_resources_before}" && -f "${gcp_resources_after}" ]]; then
# Compare resources if either the cluster was
# * started and destroyed (normal e2e)
# * neither started nor destroyed (soak test)
if [[ "${E2E_UP:-}" == "${E2E_DOWN:-}" && -f "${gcp_resources_before}" && -f "${gcp_resources_after}" ]]; then
if ! diff -sw -U0 -F'^\[.*\]$' "${gcp_resources_before}" "${gcp_resources_after}" && [[ "${FAIL_ON_GCP_RESOURCE_LEAK:-}" == "true" ]]; then
echo "!!! FAIL: Google Cloud Platform resources leaked while running tests!"
exit 1
Expand Down

0 comments on commit 3117fa4

Please sign in to comment.