Skip to content

Commit

Permalink
Add Jenkins e2e test job for multi-zone Ubernetes Lite
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinton Hoole committed Feb 16, 2016
1 parent 8081956 commit b4a3559
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
12 changes: 11 additions & 1 deletion cluster/gce/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,17 @@ function test-teardown {
--project "${PROJECT}" \
--quiet \
"${NODE_TAG}-${INSTANCE_PREFIX}-nodeports" || true
"${KUBE_ROOT}/cluster/kube-down.sh"
if [[ ${MULTIZONE:-} == "true" ]]; then
local zones=( ${E2E_ZONES} )
# tear them down in reverse order, finally tearing down the master too.
for ((zone_num=${#zones[@]}-1; zone_num>0; zone_num--))
do
KUBE_GCE_ZONE="${zones[zone_num]}" KUBE_USE_EXISTING_MASTER="true" "${KUBE_ROOT}/cluster/kube-down.sh"
done
KUBE_GCE_ZONE="${zones[0]}" KUBE_USE_EXISTING_MASTER="false" "${KUBE_ROOT}/cluster/kube-down.sh"
else
"${KUBE_ROOT}/cluster/kube-down.sh"
fi
}

# SSH to a node by name ($1) and run a command ($2).
Expand Down
11 changes: 10 additions & 1 deletion hack/e2e-internal/e2e-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,14 @@ source "${KUBE_VERSION_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh"

prepare-e2e

KUBE_TEST_DEBUG=y "${KUBE_VERSION_ROOT}/cluster/kube-up.sh"
if [[ ${MULTIZONE:-} == "true" ]]; then
for KUBE_GCE_ZONE in ${E2E_ZONES}
do
KUBE_GCE_ZONE="${KUBE_GCE_ZONE}" KUBE_USE_EXISTING_MASTER="${KUBE_USE_EXISTING_MASTER:-}" KUBE_TEST_DEBUG=y "${KUBE_VERSION_ROOT}/cluster/kube-up.sh"
KUBE_USE_EXISTING_MASTER="true" # For subsequent zones we use the existing master
done
else
KUBE_TEST_DEBUG=y "${KUBE_VERSION_ROOT}/cluster/kube-up.sh"
fi

test-setup
22 changes: 22 additions & 0 deletions hack/jenkins/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,26 @@ case ${JOB_NAME} in
: ${PROJECT:="k8s-jkns-e2e-gce-slow"}
: ${FAIL_ON_GCP_RESOURCE_LEAK:="true"}
;;

# Runs all non-flaky, non-slow tests on GCE, sequentially,
# and in a multi-zone ("Ubernetes Lite") cluster.
kubernetes-e2e-gce-ubernetes-lite)
: ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-ubelite"}
: ${E2E_PUBLISH_GREEN_VERSION:="true"}
: ${E2E_NETWORK:="e2e-gce-ubelite"}
: ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \
${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \
${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \
)"}
: ${KUBE_GCE_INSTANCE_PREFIX="e2e-gce-ubelite"}
: ${PROJECT:="k8s-jkns-e2e-gce-ubelite"}
: ${ENABLE_DEPLOYMENTS:=true}
: ${FAIL_ON_GCP_RESOURCE_LEAK:="true"}
: ${E2E_MULTIZONE:="true"}
: ${E2E_ZONE:=""}
: ${E2E_ZONES:=us-central1-a us-central1-b us-central1-f}
;;

# Run the [Serial], [Disruptive], and [Feature:Restart] tests on GCE.
kubernetes-e2e-gce-serial)
Expand Down Expand Up @@ -742,6 +762,7 @@ export AWS_SHARED_CREDENTIALS_FILE=${AWS_SHARED_CREDENTIALS_FILE:-}
# GCE variables
export INSTANCE_PREFIX=${E2E_CLUSTER_NAME}
export KUBE_GCE_ZONE=${E2E_ZONE}
export MULTIZONE=${E2E_MULTIZONE:-} # for building multi-zone Ubernetes Lite clusters
export KUBE_GCE_NETWORK=${E2E_NETWORK}
export KUBE_GCE_INSTANCE_PREFIX=${KUBE_GCE_INSTANCE_PREFIX:-}
export KUBE_GCE_NODE_PROJECT=${KUBE_GCE_NODE_PROJECT:-}
Expand Down Expand Up @@ -804,6 +825,7 @@ export E2E_TEST="${E2E_TEST:-true}"
export E2E_DOWN="${E2E_DOWN:-true}"
export E2E_CLEAN_START="${E2E_CLEAN_START:-}"
export E2E_PUBLISH_GREEN_VERSION="${E2E_PUBLISH_GREEN_VERSION:-false}"
export E2E_ZONES=${E2E_ZONES:-} # for building multi-zone Ubernetes Lite clusters
# Used by hack/ginkgo-e2e.sh to enable ginkgo's parallel test runner.
export GINKGO_PARALLEL=${GINKGO_PARALLEL:-}
export GINKGO_PARALLEL_NODES=${GINKGO_PARALLEL_NODES:-}
Expand Down
5 changes: 5 additions & 0 deletions hack/jenkins/job-configs/kubernetes-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@
- 'gce-examples':
description: 'Run e2e examples test on GCE using the latest successful Kubernetes build.'
timeout: 90
- 'gce-ubernetes-lite':
description: 'Run E2E tests on GCE across multiple zones using the latest successful build.'
timeout: 150
emails: '$DEFAULT_RECIPIENTS, [email protected], [email protected]'
test-owner: 'quinton'
jobs:
- 'kubernetes-e2e-{suffix}'

Expand Down

0 comments on commit b4a3559

Please sign in to comment.