This suite tests the end-to-end operation of the open-feature-operator.
Tests are written with kuttl and assertions are executed from a curl enabled Job. Ngnix reverse proxy is used as the workload where flagd get injected using OFO annotations.
It is recommended to run and validate e2e test locally before opening a pull request.
To run locally (commands are executed from the project root level),
docker build . -t open-feature-operator-local:validate
kind create cluster --config ./test/e2e/kind-cluster.yml --name e2e-tests
kind load docker-image open-feature-operator-local:validate --name e2e-tests
IMG=open-feature-operator-local:validate make deploy-operator
IMG=open-feature-operator-local:validate make e2e-test-kuttl
Alternatively, you can use e2e-test-validate-local
Makefile rule to execute all above and cleanup the kind cluster,
make e2e-test-validate-local
After the test run, make sure test status by validating kuttl output,
--- PASS: kuttl (48.71s)
--- PASS: kuttl/harness (0.00s)
--- PASS: kuttl/harness/assets (0.01s)
--- PASS: kuttl/harness/flagd-disabled (12.58s)
--- PASS: kuttl/harness/inject-flagd (26.41s)
--- PASS: kuttl/harness/fsconfig-file-sync (31.73s)
--- PASS: kuttl/harness/fsconfig-k8s-sync (31.74s)
--- PASS: kuttl/harness/fsconfig-flagd-proxy-sync (48.49s)
You can use kuttl command options to execute individual tests. Consider the example command below,
$ kubectl kuttl test –start-kind=false ./test/e2e/kuttl –config=kuttl-test.yaml –test=flagd-disabled