Kubernetes End-to-end Testing for Everyone
Implementing a test suite. This is the main focus of this blog post. The Kubernetes E2E framework is written in Go.
It relies on Ginkgo for managing tests and Gomega for assertions. These tools support “behavior driven development”, which describes expected behavior in “specs”. In this blog post, “test” is used to reference an individual Ginkgo.
It spec. Tests interact with the Kubernetes cluster using client-go. Bringing up a test cluster.
Tools like kubetest can help here. Running an E2E test suite against that cluster. Ginkgo test suites can be run with the ginkgo tool or as a normal Go test with go test.
Without any parameters, a Kubernetes E2E test suite will connect to the default cluster based on environment variables like KUBECONFIG, exactly like kubectl. Kubetest also knows how to run the Kubernetes E2E suite.