Skip to content

Commit 986fbff

Browse files
test
Signed-off-by: ivan katliarchuk <[email protected]>
1 parent 2129773 commit 986fbff

File tree

6 files changed

+46
-3
lines changed

6 files changed

+46
-3
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
DOCKER_HELM_UNITITEST_IMAGE := helmunittest/helm-unittest:3.16.1-0.6.3
77
LOCAL_UNIT_TEST := $(HOME)/source/self/go-workshop/helm-unittest-tmp/untt
88

9-
ISSUE := issue-457
9+
ISSUE := issue-471
1010

1111
SUPPORTED := chart \
1212
issue-156 \
@@ -34,7 +34,8 @@ SUPPORTED := chart \
3434
issue-431 \
3535
issue-x \
3636
issue-351 \
37-
issue-457
37+
issue-457 \
38+
issue-471
3839

3940
FILTER_FOLDER := $(filter $(folder),$(SUPPORTED))
4041

@@ -93,7 +94,10 @@ template: ## Helm template to validate
9394
@helm template namespaces $(ISSUE) \
9495
--output-dir .output \
9596
--debug \
96-
--values $(ISSUE)/values.yaml
97+
--values $(ISSUE)/values.yaml \
98+
--set hosts[0]=abrakadabra.local \
99+
--set hosts[2]=abrakadabra-v2.local \
100+
--set hostsMap[1].attribute=new-attribute1
97101

98102
deps: ## Helm dependencies
99103
@helm dependency build $(ISSUE)

issue-471/Chart.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v2
2+
description: An example chart with customized subchart
3+
name: with-subchart
4+
version: 0.1.0
5+
issueLink: https://github.com/helm-unittest/helm-unittest/issues/471
6+
supportedLinks:
7+
- https://codeberg.org/forgejo-contrib/forgejo-helm
8+
todo:
9+
- make sure set values in root level

issue-471/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
# - matchSnapshot: {}

issue-471/templates/simple.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
anArray: {{ .Values.hosts }}
2+
anArrayValues:
3+
{{- range $host := .Values.hosts }}
4+
- host: {{ $host }}
5+
{{- end }}
6+
7+
# test
8+
anHostMap:
9+
{{- range $el := .Values.hostsMap }}
10+
- name: {{ $el.name }}
11+
attribute: {{ $el.attribute }}
12+
{{- end -}}

issue-471/tests/simple_test.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
suite: just a test
2+
templates:
3+
- template.yaml
4+
chart:
5+
version: 1.2.3
6+
tests:
7+
- it: paradox

issue-471/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)