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

VAULT-571 Matching documented behavior and consul #703

Merged
merged 11 commits into from
Mar 21, 2022
Prev Previous commit
Next Next commit
VAULT-571 Add back schema tests
  • Loading branch information
Christopher Swenson committed Mar 17, 2022
commit 0a02648d87f579cafe1e4273dfc2cbe8248d1a6a
46 changes: 46 additions & 0 deletions test/unit/schema.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bats

load _helpers

# These tests are just to verify there is a schema file used in the chart. Since
# .enabled is defined as a boolean type for each of the top-level blocks in the
# schema, setting it as a string fails 'helm template'.
@test "schema: csi enabled datatype" {
cd `chart_dir`
run helm template . --set csi.enabled="123"
[ "$status" -eq 1 ]
[ "${lines[2]}" = "- csi.enabled: Invalid type. Expected: [boolean,string], given: integer" ]

run helm template . --set csi.enabled=true
[ "$status" -eq 0 ]
}

@test "schema: injector enabled datatype" {
cd `chart_dir`
run helm template . --set injector.enabled="123"
[ "$status" -eq 1 ]
[ "${lines[2]}" = "- injector.enabled: Invalid type. Expected: [boolean,string], given: integer" ]

run helm template . --set injector.enabled=true
[ "$status" -eq 0 ]
}

@test "schema: server enabled datatype" {
cd `chart_dir`
run helm template . --set server.enabled="123"
[ "$status" -eq 1 ]
[ "${lines[2]}" = "- server.enabled: Invalid type. Expected: [boolean,string], given: integer" ]

run helm template . --set server.enabled=true
[ "$status" -eq 0 ]
}

@test "schema: ui enabled datatype" {
cd `chart_dir`
run helm template . --set ui.enabled="123"
[ "$status" -eq 1 ]
[ "${lines[2]}" = "- ui.enabled: Invalid type. Expected: [boolean,string], given: integer" ]

run helm template . --set ui.enabled=true
[ "$status" -eq 0 ]
}