Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added values json schema #513

Merged
merged 7 commits into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ CLOUDSDK_CORE_PROJECT?=vault-helm-dev-246514
# set to run a single test - e.g acceptance/server-ha-enterprise-dr.bats
ACCEPTANCE_TESTS?=acceptance

# Generate json schema for chart values. See test/README.md for more details.
values-schema:
helm schema-gen values.yaml > values.schema.json

test-image:
@docker build --rm -t $(TEST_IMAGE) -f $(CURDIR)/test/docker/Test.dockerfile $(CURDIR)

Expand Down Expand Up @@ -62,4 +66,4 @@ provision-cluster:
destroy-cluster:
terraform destroy -auto-approve

.PHONY: test-image test-unit test-bats test test-acceptance test-destroy test-provision acceptance provision-cluster destroy-cluster
.PHONY: values-schema test-image test-unit test-bats test test-acceptance test-destroy test-provision acceptance provision-cluster destroy-cluster
28 changes: 26 additions & 2 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Running Vault Helm Acceptance tests
# Vault Helm Tests

## Running Vault Helm Acceptance tests

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.

Expand All @@ -7,4 +9,26 @@ The Makefile at the top level of this repo contains a few target that should hel
* 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.
* Run `make test-destroy` when you have finished testing and want to tear-down and remove the cluster.
* Run `make test-destroy` when you have finished testing and want to tear-down and remove the cluster.

## 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
9 changes: 4 additions & 5 deletions test/chart/verifier.bats
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ teardown_file() {
check_result contains-values
}

@test "contains-values-schema" {
check_result contains-values-schema
}

@test "images-are-certified" {
skip "Skipping until this has been addressed"
check_result images-are-certified
Expand All @@ -70,8 +74,3 @@ teardown_file() {
skip "Skipping until this has been addressed"
check_result contains-test
}

@test "contains-values-schema" {
skip "Skipping until this has been addressed"
check_result contains-values-schema
}
Loading