The Go coverage tool does not currently support recording a coverage
data profile across packages, so we must manually combine these coverage
profiles and use it to produce an HTML report when KUBE_COVER is
nonempty. The exact value of KUBE_COVER is now ignored; KUBE_COVERMODE
can be used to set the coverage mode from the default of "atomic".
Additionally, if KUBE_GOVERALLS_BIN is set, hack/test-go.sh will attempt
to report coverage results to Coveralls.io. This is intended to be used
with the Travis build.
Since Jenkins has hopefully been set up properly to read test failures
from junit*.xml files, only exit with a nonzero status when there are
infrastructure failures. If there are only test failures, the nonzero
exit status will be ignored.
Also, disable Ginkgo's colors to make the Jenkin console logs more
readable.
For now, keep the finishRunning() wrapper but use a straight cmd.Run()
call instead of the convoluted goroutine trying to catch signals.
It turns out that Unix process group handling is enough to interrupt
pending processes when stopping the run with something like a Ctrl+C
which should be enough.
Tested:
- Full e2e run with hack/e2e-test.sh, two tests failed but looks like
they've been failing before this change.
- Started a hack/e2e.go -v -build and interrupted it with Ctrl+C,
confirmed that build-release.sh was killed in the process.
This does away with the giant dump from cobra for kubectl and instead
generates md files which contain similar information, but one per verb.
This might work well as part of the cobra project, instead of doing it
in kube, but this gets us nice, linked, documentation right now. If
people like it, I will try to get something similar into cobra.
Try to cleanup if there is a failure in script at any point.
Handle undefined vars in cleanup.
Wait longer for apiserver.
Exit if apiserver doesn't come up.
And actually, make it more better: Go ahead and tear down the cluster
even when tests fail, but (hopefully) relay the test exit status
correctly. This fails if there's a double error (if -down *also*
fails, we'll fail due to errexit), but either way is a build failure,
and this means that the teardown of a test failure build isn't getting
charged to the next run.
Export the KUBE_CONFIG_FILE environment variable pointing to the test
output when calling cluster/kubectl.sh directly.
Tested by running:
$ go run ./hack/e2e.go -v -ctl='version --match-server-version=false'
This gets rid of bashWrap() and of running bash -s passing it a script
on stdin. Also get rid of most of the runBash*() helpers.
In particular, `go run hack/e2e.go -build` will now work when it needs
to ask whether it is OK to download a large docker image, it used to
fail since stdin was not available for the bash script using the `read`
command.
Tested by running a full `hack/e2e-test.sh` run including the build
stage without the docker image loaded, which used to fail before this
change.
Before we get too many suites baked, I want to get spec randomization
in, just so no one accidentally thinks things flow from top to bottom.
The random seed is printed with every run:
Random Seed: 1423194521 - Will randomize all specs
and can be reproduced using --ginkgo.seed
* Add a test/e2e/shell.go that slurps up everything in hack/e2e-suite
and runs it as a bash test, borrowing all the code from hack/e2e.go.
* Rip out all the crap in hack/e2e.go that deal with multiple tests
* Move hack/e2e-suite/goe2e.sh to hack/ginkgo-e2e.sh so that it
doesn't get slurped up.
Simply incorporate some of the boilerplate from hack/e2e.go into the
scripts in hack/e2e-suite.
Use environment variables with default values to allow overrides in
kubectl command line and to use a versioned package root.
Tested:
- Ran `go run hack/e2e.go -test` on a test cluster.
- Ran the test cases individually.
- Ran hack/e2e-suite/goe2e.sh -t Pods to confirm it takes arguments.
- Also fixed cluster/test-network.sh (which should be more and more irrelevant.)
This is another step in removing external dependencies of the Go e2e tests.
Remove references to this file on list of files required to run e2e tests.
Also use an unique name for the pod, so that failure in cleanup of a
previous run should not break a new run with a name conflict.
Tested by running cmd/e2e -t TestPodUpdate against an API server in GCE.
This will increase build times on Jenkins, but should make the build
times consistent and make them pull from sources every time versus
leftover artifacts. Also upping timeout. (Try to address recent
some aborted builds.)
This is another step in removing external dependencies of the Go e2e tests.
Also remove other references to this file.
Tested by running cmd/e2e -t TestKubeletSendsEvent against an API server in GCE.