
* Refactor chart for 1.0, add tests, update TF * Fix typo in helper comment * Add NOTES for post install instructions * Fix typo in NOTES * Fix replication port for enterprise * Change updateStrategy to OnDelete * Add icon * Remove cluster address from config * Update README, add contributing doc * Update README * Change HA replicas to 3
84 lines
2.7 KiB
Bash
Executable file
84 lines
2.7 KiB
Bash
Executable file
#!/usr/bin/env bats
|
|
|
|
load _helpers
|
|
|
|
@test "server/ConfigMap: enabled by default" {
|
|
cd `chart_dir`
|
|
local actual=$(helm template \
|
|
-x templates/server-config-configmap.yaml \
|
|
. | tee /dev/stderr |
|
|
yq 'length > 0' | tee /dev/stderr)
|
|
[ "${actual}" = "true" ]
|
|
|
|
local actual=$(helm template \
|
|
-x templates/server-config-configmap.yaml \
|
|
--set 'server.ha.enabled=true' \
|
|
. | tee /dev/stderr |
|
|
yq 'length > 0' | tee /dev/stderr)
|
|
[ "${actual}" = "true" ]
|
|
|
|
local actual=$(helm template \
|
|
-x templates/server-config-configmap.yaml \
|
|
--set 'server.standalone.enabled=true' \
|
|
. | tee /dev/stderr |
|
|
yq 'length > 0' | tee /dev/stderr)
|
|
[ "${actual}" = "true" ]
|
|
}
|
|
|
|
@test "server/ConfigMap: disabled by server.dev.enabled true" {
|
|
cd `chart_dir`
|
|
local actual=$(helm template \
|
|
-x templates/server-config-configmap.yaml \
|
|
--set 'server.dev.enabled=true' \
|
|
. | tee /dev/stderr |
|
|
yq 'length > 0' | tee /dev/stderr)
|
|
[ "${actual}" = "false" ]
|
|
}
|
|
|
|
@test "server/ConfigMap: disable with global.enabled" {
|
|
cd `chart_dir`
|
|
local actual=$(helm template \
|
|
-x templates/server-config-configmap.yaml \
|
|
--set 'global.enabled=false' \
|
|
. | tee /dev/stderr |
|
|
yq 'length > 0' | tee /dev/stderr)
|
|
[ "${actual}" = "false" ]
|
|
}
|
|
|
|
@test "server/ConfigMap: standalone extraConfig is set" {
|
|
cd `chart_dir`
|
|
local actual=$(helm template \
|
|
-x templates/server-config-configmap.yaml \
|
|
--set 'server.standalone.enabled=true' \
|
|
--set 'server.standalone.config="{\"hello\": \"world\"}"' \
|
|
. | tee /dev/stderr |
|
|
yq '.data["extraconfig-from-values.hcl"] | match("world") | length' | tee /dev/stderr)
|
|
[ ! -z "${actual}" ]
|
|
|
|
local actual=$(helm template \
|
|
-x templates/server-config-configmap.yaml \
|
|
--set 'server.standalone.enabled=true' \
|
|
--set 'server.standalone.config="{\"foo\": \"bar\"}"' \
|
|
. | tee /dev/stderr |
|
|
yq '.data["extraconfig-from-values.hcl"] | match("bar") | length' | tee /dev/stderr)
|
|
[ ! -z "${actual}" ]
|
|
}
|
|
|
|
@test "server/ConfigMap: ha extraConfig is set" {
|
|
cd `chart_dir`
|
|
local actual=$(helm template \
|
|
-x templates/server-config-configmap.yaml \
|
|
--set 'server.ha.enabled=true' \
|
|
--set 'server.ha.config="{\"hello\": \"world\"}"' \
|
|
. | tee /dev/stderr |
|
|
yq '.data["extraconfig-from-values.hcl"] | match("world") | length' | tee /dev/stderr)
|
|
[ ! -z "${actual}" ]
|
|
|
|
local actual=$(helm template \
|
|
-x templates/server-config-configmap.yaml \
|
|
--set 'server.ha.enabled=true' \
|
|
--set 'server.ha.config="{\"foo\": \"bar\"}"' \
|
|
. | tee /dev/stderr |
|
|
yq '.data["extraconfig-from-values.hcl"] | match("bar") | length' | tee /dev/stderr)
|
|
[ ! -z "${actual}" ]
|
|
}
|