Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diff GCP resource usage in soak tests too #17610

Merged
merged 1 commit into from
Nov 24, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 13 additions & 7 deletions hack/jenkins/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,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 @@ -1667,9 +1668,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 @@ -1717,12 +1720,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