Allow per-environment ginkgo flags to be passed to the node e2e tests so that we can selectively disable slow tests in the PR builder when needed.

This commit is contained in:
Phillip Wittrock 2016-05-16 16:35:34 -07:00
parent f24b7a7391
commit 1d91d24548
5 changed files with 6 additions and 2 deletions

View File

@ -165,6 +165,7 @@ gather-resource-usage
gce-project gce-project
gce-service-account gce-service-account
gce-zone gce-zone
ginkgo-flags
gke-cluster gke-cluster
go-header-file go-header-file
google-json-key google-json-key

View File

@ -35,6 +35,7 @@ var sshOptions = flag.String("ssh-options", "", "Commandline options passed to s
var sshEnv = flag.String("ssh-env", "", "Use predefined ssh options for environment. Options: gce") var sshEnv = flag.String("ssh-env", "", "Use predefined ssh options for environment. Options: gce")
var testTimeoutSeconds = flag.Int("test-timeout", 45*60, "How long (in seconds) to wait for ginkgo tests to complete.") var testTimeoutSeconds = flag.Int("test-timeout", 45*60, "How long (in seconds) to wait for ginkgo tests to complete.")
var resultsDir = flag.String("results-dir", "/tmp/", "Directory to scp test results to.") var resultsDir = flag.String("results-dir", "/tmp/", "Directory to scp test results to.")
var ginkgoFlags = flag.String("ginkgo-flags", "", "Passed to ginkgo to specify additional flags such as --skip=.")
var sshOptionsMap map[string]string var sshOptionsMap map[string]string
@ -160,7 +161,7 @@ func RunRemote(archive string, host string, cleanup bool, junitFileNumber int) (
cmd = getSshCommand(" && ", cmd = getSshCommand(" && ",
fmt.Sprintf("cd %s", tmp), fmt.Sprintf("cd %s", tmp),
fmt.Sprintf("tar -xzvf ./%s", archiveName), fmt.Sprintf("tar -xzvf ./%s", archiveName),
fmt.Sprintf("timeout -k 30s %ds ./e2e_node.test --logtostderr --v 2 --build-services=false --stop-services=%t --node-name=%s --report-dir=%s/results --junit-file-number=%d", *testTimeoutSeconds, cleanup, host, tmp, junitFileNumber), fmt.Sprintf("timeout -k 30s %ds ./e2e_node.test --logtostderr --v 2 --build-services=false --stop-services=%t --node-name=%s --report-dir=%s/results --junit-file-number=%d %s", *testTimeoutSeconds, cleanup, host, tmp, junitFileNumber, *ginkgoFlags),
) )
glog.Infof("Starting tests on %s", host) glog.Infof("Starting tests on %s", host)
output, err := RunSshCommand("ssh", host, "--", "sh", "-c", cmd) output, err := RunSshCommand("ssh", host, "--", "sh", "-c", cmd)

View File

@ -40,4 +40,4 @@ mkdir -p ${ARTIFACTS}
go run test/e2e_node/runner/run_e2e.go --logtostderr --vmodule=*=2 --ssh-env="gce" \ go run test/e2e_node/runner/run_e2e.go --logtostderr --vmodule=*=2 --ssh-env="gce" \
--zone="$GCE_ZONE" --project="$GCE_PROJECT" \ --zone="$GCE_ZONE" --project="$GCE_PROJECT" \
--hosts="$GCE_HOSTS" --images="$GCE_IMAGES" --cleanup="$CLEANUP" \ --hosts="$GCE_HOSTS" --images="$GCE_IMAGES" --cleanup="$CLEANUP" \
--results-dir="$ARTIFACTS" --results-dir="$ARTIFACTS" --ginkgo-flags="$GINKGO_FLAGS"

View File

@ -8,3 +8,4 @@ GCE_ZONE=us-central1-f
GCE_PROJECT=kubernetes-jenkins GCE_PROJECT=kubernetes-jenkins
INSTALL_GODEP=true INSTALL_GODEP=true
CLEANUP=true CLEANUP=true
GINKGO_FLAGS=

View File

@ -8,3 +8,4 @@ GCE_ZONE=us-central1-f
GCE_PROJECT=kubernetes-jenkins-pull GCE_PROJECT=kubernetes-jenkins-pull
INSTALL_GODEP=true INSTALL_GODEP=true
CLEANUP=true CLEANUP=true
GINKGO_FLAGS=