Skip to content

Commit 7f6c263

Browse files
issue-555: added extra test
Signed-off-by: ivan katliarchuk <[email protected]>
1 parent 7c98b91 commit 7f6c263

File tree

7 files changed

+56
-8
lines changed

7 files changed

+56
-8
lines changed

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ SUPPORTED := chart \
3737
issue-494 \
3838
issue-497 \
3939
issue-499 \
40-
issue-504
40+
issue-504 \
41+
issue-555
4142

42-
ISSUE := issue-499
43+
ISSUE := issue-555
4344

4445
FILTER_FOLDER := $(filter $(folder),$(SUPPORTED))
4546

@@ -119,9 +120,9 @@ unit-test-plugin: ## Execute Unit tests locally with plugin --debugPlugin
119120
$(info Running unit tests (upstream) for $(ISSUE)...)
120121
@helm unittest -f 'tests/*.yaml' --debugPlugin $(ISSUE)
121122

122-
unit-test-local: ## Execute Unit tests with locally build (--debugPlugin)
123+
unit-test-local: ## Execute Unit tests with locally build (--debugPlugin) --debugPlugin
123124
$(info Running unit tests for $(ISSUE)...)
124-
@$(LOCAL_UNIT_TEST) -f 'tests/*.yaml' --debugPlugin $(ISSUE)
125+
@$(LOCAL_UNIT_TEST) -f 'tests/*.yaml' $(ISSUE)
125126

126127
unit-test-current: ## Execute Unit tests with locally build (--debugPlugin)
127128
@$(LOCAL_UNIT_TEST) -f 'tests/*.yaml' --coverage $(ISSUE)

issue-499/tests/falied_msg_test.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ tests:
55
- it: should fail when No failed document
66
asserts:
77
- failedTemplate:
8-
errorPattern: |-
9-
`runAsNonRoot` is set to `true` but `runAsUser` is set to `0` \(root\)
10-
- failedTemplate:
11-
errorMessage: "`runAsNonRoot` is set to `true` but `runAsUser` is set to `0` (root)"
8+
errorPattern: "`runAsNonRoot` is set to `true` but `runAsUser` is set to `0` \(root\)"
9+
# - failedTemplate:
10+
# errorMessage: "\n`runAsNonRoot` is set to `true` but `runAsUser` is set to `0` \(root\)"

issue-555/Chart.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v2
2+
description: Allow for skipping specific tests
3+
name: document-selector-panic
4+
version: 0.1.0
5+
issueLink: https://github.com/helm-unittest/helm-unittest/issues/555
6+
supportedLinks:
7+
- https://github.com/helm-unittest/helm-unittest/issues/555

issue-555/templates/first-cfg.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{- if .Values.enabled }}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: second-config-map
6+
{{- end}}
7+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: second-cfg

issue-555/tests/simple_test.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
suite: document selector to match any template
2+
templates:
3+
- "*"
4+
tests:
5+
- it: full document selector
6+
# set:
7+
# enabled: true
8+
# documentSelector:
9+
# # path: kind
10+
# # value: ConfigMap
11+
# skipEmptyTemplates: true
12+
asserts:
13+
- exists:
14+
path: kind
15+
documentSelector:
16+
# skipEmptyTemplates: true
17+
# path: kind
18+
# value: Configmap
19+
20+
# MORE tests required

issue-555/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
hosts:
2+
- chart-example.local
3+
- chart-example.remote
4+
5+
hostsMap:
6+
- name: value0
7+
attribute: attribute0
8+
- name: value1
9+
attribute: attribute1

0 commit comments

Comments
 (0)