Skip to content

Commit

Permalink
Merge pull request kubernetes#27898 from lavalamp/fixv
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Detect flakes in PR builder e2e runs

Won't be mergable until onsi/ginkgo#261 is agreed upon and merged.

Tossing a PR here to get the e2e test to run on it.
  • Loading branch information
k8s-merge-robot authored Jul 18, 2016
2 parents d92f685 + e91c5d0 commit cbda93e
Show file tree
Hide file tree
Showing 15 changed files with 135 additions and 28 deletions.
9 changes: 9 additions & 0 deletions hack/ginkgo-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ e2e_test=$(kube::util::find-binary "e2e.test")

GINKGO_PARALLEL=${GINKGO_PARALLEL:-n} # set to 'y' to run tests in parallel

# If 'y', will rerun failed tests once to give them a second chance.
GINKGO_TOLERATE_FLAKES=${GINKGO_TOLERATE_FLAKES:-n}

# The number of tests that can run in parallel depends on what tests
# are running and on the size of the cluster. Too many, and tests will
# fail due to resource contention. 25 is a reasonable default for a
Expand Down Expand Up @@ -101,13 +104,19 @@ elif [[ ${GINKGO_PARALLEL} =~ ^[yY]$ ]]; then
ginkgo_args+=("--nodes=25")
fi

FLAKE_ATTEMPTS=1
if [[ "${GINKGO_TOLERATE_FLAKES}" == "y" ]]; then
FLAKE_ATTEMPTS=2
fi

# The --host setting is used only when providing --auth_config
# If --kubeconfig is used, the host to use is retrieved from the .kubeconfig
# file and the one provided with --host is ignored.
# Add path for things like running kubectl binary.
export PATH=$(dirname "${e2e_test}"):"${PATH}"
"${ginkgo}" "${ginkgo_args[@]:+${ginkgo_args[@]}}" "${e2e_test}" -- \
"${auth_config[@]:+${auth_config[@]}}" \
--ginkgo.flakeAttempts="${FLAKE_ATTEMPTS}" \
--host="${KUBE_MASTER_URL}" \
--provider="${KUBERNETES_PROVIDER}" \
--gce-project="${PROJECT:-}" \
Expand Down
22 changes: 21 additions & 1 deletion hack/jenkins/upload-to-gcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,19 @@ fi

if [[ ${JOB_NAME} =~ -pull- ]]; then
: ${JENKINS_GCS_LOGS_PATH:="gs://kubernetes-jenkins/pr-logs/pull/${ghprbPullId:-unknown}"}
: ${JENKINS_GCS_LATEST_PATH:="gs://kubernetes-jenkins/pr-logs/directory"}
: ${JENKINS_GCS_LOGS_INDIRECT:="gs://kubernetes-jenkins/pr-logs/directory/${JOB_NAME}"}
else
: ${JENKINS_GCS_LOGS_PATH:="gs://kubernetes-jenkins/logs"}
: ${JENKINS_GCS_LATEST_PATH:="gs://kubernetes-jenkins/logs"}
: ${JENKINS_GCS_LOGS_INDIRECT:=""}
fi

readonly artifacts_path="${WORKSPACE}/_artifacts"
readonly gcs_job_path="${JENKINS_GCS_LOGS_PATH}/${JOB_NAME}"
readonly gcs_build_path="${gcs_job_path}/${BUILD_NUMBER}"
readonly gcs_latest_path="${JENKINS_GCS_LATEST_PATH}/${JOB_NAME}"
readonly gcs_indirect_path="${JENKINS_GCS_LOGS_INDIRECT}"
readonly gcs_acl="public-read"
readonly results_url=${gcs_build_path//"gs:/"/"https://console.cloud.google.com/storage/browser"}
readonly timestamp=$(date +%s)
Expand Down Expand Up @@ -115,11 +121,25 @@ function upload_artifacts_and_build_result() {
echo "Uploading build log"
gsutil -q cp -Z -a "${gcs_acl}" "${WORKSPACE}/build-log.txt" "${gcs_build_path}"
fi

# For pull jobs, keep a canonical ordering for tools that want to examine
# the output.
if [[ "${gcs_indirect_path}" != "" ]]; then
echo "Writing ${gcs_build_path} to ${gcs_indirect_path}/${BUILD_NUMBER}.txt"
echo "${gcs_build_path}" | \
gsutil -q -h "Content-Type:text/plain" \
cp -a "${gcs_acl}" - "${gcs_indirect_path}/${BUILD_NUMBER}.txt" || continue
echo "Marking build ${BUILD_NUMBER} as the latest completed build for this PR"
echo "${BUILD_NUMBER}" | \
gsutil -q -h "Content-Type:text/plain" -h "Cache-Control:private, max-age=0, no-transform" \
cp -a "${gcs_acl}" - "${gcs_job_path}/latest-build.txt" || continue
fi

# Mark this build as the latest completed.
echo "Marking build ${BUILD_NUMBER} as the latest completed build"
echo "${BUILD_NUMBER}" | \
gsutil -q -h "Content-Type:text/plain" -h "Cache-Control:private, max-age=0, no-transform" \
cp -a "${gcs_acl}" - "${gcs_job_path}/latest-build.txt" || continue
cp -a "${gcs_acl}" - "${gcs_latest_path}/latest-build.txt" || continue
break # all uploads succeeded if we hit this point
done

Expand Down
7 changes: 7 additions & 0 deletions vendor/github.com/onsi/ginkgo/config/config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/onsi/ginkgo/ginkgo/help_command.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions vendor/github.com/onsi/ginkgo/ginkgo_dsl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions vendor/github.com/onsi/ginkgo/internal/leafnodes/benchmarker.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions vendor/github.com/onsi/ginkgo/internal/spec/spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 31 additions & 7 deletions vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 19 additions & 2 deletions vendor/github.com/onsi/ginkgo/types/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cbda93e

Please sign in to comment.