Skip to content

Commit be649bc

Browse files
authored
Add more tests to the chart (newrelic#599)
* Add more tests to the chart * bump chart version
1 parent 8055e44 commit be649bc

File tree

2 files changed

+79
-15
lines changed

2 files changed

+79
-15
lines changed

charts/newrelic-infrastructure/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sources:
88
- https://github.com/newrelic/nri-kubernetes/tree/main/charts/newrelic-infrastructure
99
- https://github.com/newrelic/infrastructure-agent/
1010

11-
version: 3.11.0
11+
version: 3.11.1
1212
appVersion: 3.6.0
1313

1414
dependencies:

charts/newrelic-infrastructure/tests/nodeSelectors_test.yaml

Lines changed: 78 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,53 +13,84 @@ templates:
1313
- templates/agent-configmap.yaml
1414
- templates/secret.yaml
1515
tests:
16-
- it: nodeSelector is populated from common-library
16+
- it: nodeSelector is populated from global by common-library
1717
set:
1818
licenseKey: test
1919
cluster: test
20-
nodeSelector:
21-
disktype: ssd
20+
global:
21+
nodeSelector:
22+
disktype: ssd
2223
asserts:
2324
- equal:
2425
path: spec.template.spec.nodeSelector
2526
value:
2627
disktype: ssd
2728
template: templates/ksm/deployment.yaml
29+
- equal:
30+
path: spec.template.spec.nodeSelector
31+
value:
32+
disktype: ssd
33+
template: templates/kubelet/daemonset.yaml
34+
- equal:
35+
path: spec.template.spec.nodeSelector
36+
value:
37+
disktype: ssd
38+
template: templates/controlplane/daemonset.yaml
2839

29-
- it: nodeSelector is populated from ksm tree value
40+
- it: nodeSelector is populated from chart's root by common-library
3041
set:
3142
licenseKey: test
3243
cluster: test
33-
ksm:
34-
nodeSelector:
35-
disktype: real
3644
nodeSelector:
3745
disktype: ssd
3846
asserts:
3947
- equal:
4048
path: spec.template.spec.nodeSelector
4149
value:
42-
disktype: real
50+
disktype: ssd
4351
template: templates/ksm/deployment.yaml
52+
- equal:
53+
path: spec.template.spec.nodeSelector
54+
value:
55+
disktype: ssd
56+
template: templates/kubelet/daemonset.yaml
57+
- equal:
58+
path: spec.template.spec.nodeSelector
59+
value:
60+
disktype: ssd
61+
template: templates/controlplane/daemonset.yaml
4462

45-
- it: nodeSelector is populated from common-library
63+
- it: nodeSelector is overridable
4664
set:
4765
licenseKey: test
4866
cluster: test
67+
global:
68+
nodeSelector:
69+
disktype: ssd
4970
nodeSelector:
50-
disktype: ssd
71+
disktype: real
5172
asserts:
5273
- equal:
5374
path: spec.template.spec.nodeSelector
5475
value:
55-
disktype: ssd
76+
disktype: real
77+
template: templates/ksm/deployment.yaml
78+
- equal:
79+
path: spec.template.spec.nodeSelector
80+
value:
81+
disktype: real
5682
template: templates/kubelet/daemonset.yaml
83+
- equal:
84+
path: spec.template.spec.nodeSelector
85+
value:
86+
disktype: real
87+
template: templates/controlplane/daemonset.yaml
5788

58-
- it: nodeSelector is populated from kubelet tree value
89+
- it: nodeSelector is populated from ksm tree value
5990
set:
6091
licenseKey: test
6192
cluster: test
62-
kubelet:
93+
ksm:
6394
nodeSelector:
6495
disktype: real
6596
nodeSelector:
@@ -69,15 +100,38 @@ tests:
69100
path: spec.template.spec.nodeSelector
70101
value:
71102
disktype: real
103+
template: templates/ksm/deployment.yaml
104+
- equal:
105+
path: spec.template.spec.nodeSelector
106+
value:
107+
disktype: ssd
72108
template: templates/kubelet/daemonset.yaml
109+
- equal:
110+
path: spec.template.spec.nodeSelector
111+
value:
112+
disktype: ssd
113+
template: templates/controlplane/daemonset.yaml
73114

74-
- it: nodeSelector is populated from common-library
115+
- it: nodeSelector is populated from kubelet tree value
75116
set:
76117
licenseKey: test
77118
cluster: test
119+
kubelet:
120+
nodeSelector:
121+
disktype: real
78122
nodeSelector:
79123
disktype: ssd
80124
asserts:
125+
- equal:
126+
path: spec.template.spec.nodeSelector
127+
value:
128+
disktype: ssd
129+
template: templates/ksm/deployment.yaml
130+
- equal:
131+
path: spec.template.spec.nodeSelector
132+
value:
133+
disktype: real
134+
template: templates/kubelet/daemonset.yaml
81135
- equal:
82136
path: spec.template.spec.nodeSelector
83137
value:
@@ -94,6 +148,16 @@ tests:
94148
nodeSelector:
95149
disktype: ssd
96150
asserts:
151+
- equal:
152+
path: spec.template.spec.nodeSelector
153+
value:
154+
disktype: ssd
155+
template: templates/ksm/deployment.yaml
156+
- equal:
157+
path: spec.template.spec.nodeSelector
158+
value:
159+
disktype: ssd
160+
template: templates/kubelet/daemonset.yaml
97161
- equal:
98162
path: spec.template.spec.nodeSelector
99163
value:

0 commit comments

Comments
 (0)