mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 20:11:54 +00:00
* appliance: golden/snapshot testing Use envtest (https://book.kubebuilder.io/reference/envtest.html) to start a real Kubernetes API server, backed by a real etcd instance, in tests. The only controller running is our appliance controller, so these tests assert on the changes our controller actually makes to Kubernetes API objects in response to some input, but don't depend on complex infrastruture like container runtimes or persistent volume controllers (since no such controllers are actually running, unlike in a useful Kubernetes cluster). This commit adds a test harness to the appliance package: * It starts the k8s API server only once, not once per test, as this is a relatively slow operation. * Helper functions to run each test in a unique namespace to avoid inter-test dependency. This opens the door to parallelism, but note that testify/suite doesn't currently support parallel tests. * Helper functions to load input ConfigMaps from fixture files. * Passing `-args appliance-update-golden-files` to `go test` will cause checked-in golden files to be updated. |
||
|---|---|---|
| .. | ||
| BUILD.bazel | ||