forked from hashicorp/vault-helm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add schema unit tests (hashicorp#530)
- Loading branch information
1 parent
4cdd308
commit 661bcb3
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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="nope" | ||
[ "$status" -eq 1 ] | ||
[ "${lines[2]}" = "- csi.enabled: Invalid type. Expected: boolean, given: string" ] | ||
|
||
run helm template . --set csi.enabled=true | ||
[ "$status" -eq 0 ] | ||
} | ||
|
||
@test "schema: injector enabled datatype" { | ||
cd `chart_dir` | ||
run helm template . --set injector.enabled="nope" | ||
[ "$status" -eq 1 ] | ||
[ "${lines[2]}" = "- injector.enabled: Invalid type. Expected: boolean, given: string" ] | ||
|
||
run helm template . --set injector.enabled=true | ||
[ "$status" -eq 0 ] | ||
} | ||
|
||
@test "schema: server enabled datatype" { | ||
cd `chart_dir` | ||
run helm template . --set server.enabled="nope" | ||
[ "$status" -eq 1 ] | ||
[ "${lines[2]}" = "- server.enabled: Invalid type. Expected: boolean, given: string" ] | ||
|
||
run helm template . --set server.enabled=true | ||
[ "$status" -eq 0 ] | ||
} | ||
|
||
@test "schema: ui enabled datatype" { | ||
cd `chart_dir` | ||
run helm template . --set ui.enabled="nope" | ||
[ "$status" -eq 1 ] | ||
[ "${lines[2]}" = "- ui.enabled: Invalid type. Expected: boolean, given: string" ] | ||
|
||
run helm template . --set ui.enabled=true | ||
[ "$status" -eq 0 ] | ||
} |