2024-05-17 14:00:44 +00:00
# OpenBao Helm Tests
2021-05-14 15:59:36 +00:00
2024-05-17 14:00:44 +00:00
## Running OpenBao Helm Acceptance tests
2020-05-27 16:21:16 +00:00
2021-07-12 17:00:12 +00:00
The Makefile at the top level of this repo contains a few target that should help with running acceptance tests in your own GKE instance or in a kind cluster.
2020-05-27 16:21:16 +00:00
2021-07-12 17:00:12 +00:00
### Running in a GKE cluster
* Set the `GOOGLE_CREDENTIALS` and `CLOUDSDK_CORE_PROJECT` variables at the top of the file. `GOOGLE_CREDENTIALS` should contain the local path to your Google Cloud Platform account credentials in JSON format. `CLOUDSDK_CORE_PROJECT` should be set to the ID of your GCP project.
2020-05-27 16:21:16 +00:00
* Run `make test-image` to create the docker image (with dependencies installed) that will be re-used in the below steps.
* Run `make test-provision` to provision the GKE cluster using terraform.
* Run `make test-acceptance` to run the acceptance tests in this already provisioned cluster.
* You can choose to only run certain tests by setting the ACCEPTANCE_TESTS variable and re-running the above target.
2021-05-14 15:59:36 +00:00
* Run `make test-destroy` when you have finished testing and want to tear-down and remove the cluster.
2021-07-12 17:00:12 +00:00
### Running in a kind cluster
* Run `make test-acceptance LOCAL_ACCEPTANCE_TESTS=true`
* You can choose to only run certain tests by setting the `ACCEPTANCE_TESTS` variable and re-running the above target.
* Run `make delete-kind` when you have finished testing and want to tear-down and remove the cluster.
* You can set an alternate kind cluster name by specifying the `KIND_CLUSTER_NAME` variable for any of the above targets.
* You can set an alternate K8S version by specifying the `KIND_K8S_VERSION` variable for any of the above targets.
See [kind-quick-start ](https://kind.sigs.k8s.io/docs/user/quick-start/ ) if you don't have kind installed on your system.
2021-05-14 15:59:36 +00:00
## Running chart verification tests
If [chart-verifier ](https://github.com/redhat-certification/chart-verifier ) is built and available in your PATH, run:
bats test/chart/verifier.bats
Or if you'd rather use the latest chart-verifier docker container, set
USE_DOCKER:
USE_DOCKER=true bats test/chart/verifier.bats
## Generating the values json schema
There is a make target for generating values.schema.json:
make values-schema
It relies on the helm [schema-gen plugin][schema-gen]. Note that some manual
editing will be required, since several properties accept multiple data types.
[schema-gen]: https://github.com/karuppiah7890/helm-schema-gen
2021-05-28 00:09:50 +00:00
## Helm test
2024-05-17 14:00:44 +00:00
OpenBao Helm also contains a simple helm test under
2021-05-28 00:09:50 +00:00
[templates/tests/ ](../templates/tests/ ) that may be run against a helm release:
helm test < RELEASE_NAME >