How to run e2e tests on custom cluster within Kubernetes.

7/12/2017

https://github.com/kubernetes/community/blob/master/contributors/devel/e2e-tests.md#testing-against-local-clusters

I have been following the above guide, but I keep getting this error:

2017/07/12 09:53:58 util.go:131: Step './cluster/kubectl.sh version --match-server-version=false' finished in 20.604745ms
2017/07/12 09:53:58 util.go:129: Running: ./hack/e2e-internal/e2e-status.sh
WARNING: The bash deployment for AWS is obsolete. The
v1.5.x releases are the last to support cluster/kube-up.sh with AWS.
For a list of viable alternatives, (...)
2017/07/12 09:53:58 util.go:131: Step './hack/e2e-internal/e2e-status.sh' finished in 18.71843ms
2017/07/12 09:53:58 main.go:216: Something went wrong: encountered 2 errors: [error during ./cluster/kubectl.sh version --match-server-version=false: exit status 1 error during ./hack/e2e-internal/e2e-status.sh: exit status 1]
2017/07/12 09:53:58 e2e.go:78: err: exit status 1

How do I fix this, what am I doing wrong?

-- phpnovice
e2e-testing
kubernetes

2 Answers

1/25/2018

Some supplements

You can also compile ginkgo:

make WHAT=vendor/github.com/onsi/ginkgo/ginkgo

Some options are useful:(ginkgo --help to see details)

-flakeAttempts
-focus
-nodes
-outputdir
-skip
-v

To run tests parellely:(set --node=1 for serial tests)

./_output/bin/ginkgo --nodes=25 --flakeAttempts=2 \ 
./_output/bin/e2e.test -- --host="http://127.0.0.1:8080" \
--provider="local" --ginkgo.v=true --kubeconfig="~/.kube/config" \
--ginkgo.focus="Conformance" --ginkgo.skip="Serial|Slow" \
--ginkgo.failFast=false

And if you want to launch local cluster for e2e testing, hack/local-up-cluster.sh is handy.

-- wineinlib
Source: StackOverflow

7/12/2017

If you just want to execute e2e tests without setting up the whole cluster, you can compile them from kubernetes repository: make all WHAT=test/e2e/e2e.test, and then run this compiled e2e binary against your cluster: ./e2e.test --host="<your apiserver>" --provider=local --kubeconfig=<kubeconfig location> -ginkgo.Focus="/[Conformance/]". Conformance tests should pass for any kubernetes cluster, but of course you can set any filter you want. To list all available tests, type: ./e2e.test --ginkgo.DryRun.

-- Adam Otto
Source: StackOverflow