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

chore(test): use vault.fullname in Helm test #912

Merged
merged 3 commits into from
Aug 23, 2023
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
2 changes: 1 addition & 1 deletion templates/tests/server-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SPDX-License-Identifier: MPL-2.0
apiVersion: v1
kind: Pod
metadata:
name: "{{ .Release.Name }}-server-test"
name: {{ template "vault.fullname" . }}-server-test
namespace: {{ include "vault.namespace" . }}
annotations:
"helm.sh/hook": test
Expand Down
27 changes: 27 additions & 0 deletions test/unit/server-test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,33 @@ load _helpers

#--------------------------------------------------------------------

@test "server/standalone-server-test-Pod: default metadata.name" {
cd `chart_dir`
local actual=$(helm template \
--show-only templates/tests/server-test.yaml \
. | tee /dev/stderr |
yq -r '.metadata.name' | tee /dev/stderr)
[ "${actual}" = "release-name-vault-server-test" ]
}

@test "server/standalone-server-test-Pod: release metadata.name vault" {
cd `chart_dir`
local actual=$(helm template vault \
--show-only templates/tests/server-test.yaml \
. | tee /dev/stderr |
yq -r '.metadata.name' | tee /dev/stderr)
[ "${actual}" = "vault-server-test" ]
}

@test "server/standalone-server-test-Pod: release metadata.name foo" {
cd `chart_dir`
local actual=$(helm template foo \
--show-only templates/tests/server-test.yaml \
. | tee /dev/stderr |
yq -r '.metadata.name' | tee /dev/stderr)
[ "${actual}" = "foo-vault-server-test" ]
}

@test "server/standalone-server-test-Pod: default server.standalone.enabled" {
cd `chart_dir`
local actual=$(helm template \
Expand Down
Loading