Add e2e tests

Use kind cluster to perform e2e tests.

Introduce e2e_suite_test that sets-up a kind cluster and required controllers using sylvactl bootstrap to perform e2e tests of the operator.

In order to ease development and enable step debugging, the sylva-units-release operator is deployed out-of cluster. For that purpose we need to expose source controller outside of kind cluster.

It depends on sylvactl!352 (merged) that is adding bootstrap command and package to sylvactl.

Ultimately, it also relies on sylva-projects/sylva-core!4101 (merged) as we need the capability to add the preview layer of values.

By running 'go test ./test/e2e/...', we will:

  • Create a kind cluster and install flux and external secret operator in it using sylvactl/pkg/bootstrap module
  • Expose flux source controller to make it reachable from outside of the cluster
  • Start sylva-units-operator controller out of cluster, and configure it to use the exposed source controller
  • Run tests that require interactions with source controller on the cluster

Following environment variables can be provided depending on the context:

  • http_proxy, https_proxy, no_proxy to reach internet
  • PERSIST_E2E_TEST_ENV will prevent the test-suite from deleting the kind cluster at the end of test to iterate quickly while developping/debugging new tests. In that case, kubeconfig will be saved to path/to/sylva-units-operator/test-suo-kubeconfig.
  • DOCKER_HOST should be provided when remote docker engine is used (essentially usefull in CI where we're using docker-in-docker)

Closes: #39 (closed)

Edited by Francois Eleouet

Merge request reports

Loading