Skip to content
Open
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 integration_test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func TestHelmTestShouldSucceed(t *testing.T) {
l := framework.NewLoader("testdata/helmtest")
l := framework.NewLoader("testdata/helmtest", framework.WithAdditionalTestDirs("testdata/helmtest/additional_directory"))
s, err := l.LoadSuite()
require.NoError(t, err)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tests:
- name: "use inhereited defined function"
expect:
container(.deployments.nginx; "nginx") | assertThat(. != null)
8 changes: 8 additions & 0 deletions integration_test/testdata/helmtest/suite.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
defs: |
def container(obj; name):
obj.spec.template.spec.containers[] | select(.name == name);
server:
visibleSchemas:
- kubernetes-1.20.2

tests:
- name: "use defined function"
expect:
container(.deployments.nginx; "nginx") | assertThat(. != null)
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
- name: nginx
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
Expand Down
2 changes: 1 addition & 1 deletion integration_test/testdata/nginx-example/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ image:

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
fullnameOverride: "nginx"

serviceAccount:
# Specifies whether a service account should be created
Expand Down