@@ -29,7 +29,7 @@ import (
29
29
"github.com/stretchr/testify/assert"
30
30
)
31
31
32
- func newTestingHelmIntegration (cfg config.Configuration ) Testing {
32
+ func newTestingHelmIntegration (cfg config.Configuration , extraSetArgs string ) Testing {
33
33
fakeMockLinter := new (fakeLinter )
34
34
procExec := exec .NewProcessExecutor (true )
35
35
extraArgs := strings .Fields (cfg .HelmExtraArgs )
@@ -40,7 +40,7 @@ func newTestingHelmIntegration(cfg config.Configuration) Testing {
40
40
chartUtils : util.ChartUtils {},
41
41
accountValidator : fakeAccountValidator {},
42
42
linter : fakeMockLinter ,
43
- helm : tool .NewHelm (procExec , extraArgs ),
43
+ helm : tool .NewHelm (procExec , extraArgs , strings . Fields ( extraSetArgs ) ),
44
44
kubectl : tool .NewKubectl (procExec ),
45
45
}
46
46
}
@@ -51,6 +51,7 @@ func TestInstallChart(t *testing.T) {
51
51
cfg config.Configuration
52
52
chartDir string
53
53
output TestResult
54
+ extraSet string
54
55
}
55
56
56
57
cases := []testCase {
@@ -63,6 +64,7 @@ func TestInstallChart(t *testing.T) {
63
64
},
64
65
"test_charts/must-pass-upgrade-install" ,
65
66
TestResult {mustNewChart ("test_charts/must-pass-upgrade-install" ), nil },
67
+ "" ,
66
68
},
67
69
{
68
70
"install only in random namespace" ,
@@ -71,12 +73,22 @@ func TestInstallChart(t *testing.T) {
71
73
},
72
74
"test_charts/must-pass-upgrade-install" ,
73
75
TestResult {mustNewChart ("test_charts/must-pass-upgrade-install" ), nil },
76
+ "" ,
77
+ },
78
+ {
79
+ "install with override set" ,
80
+ config.Configuration {
81
+ Debug : true ,
82
+ },
83
+ "test_charts/must-pass-upgrade-install" ,
84
+ TestResult {mustNewChart ("test_charts/must-pass-upgrade-install" ), nil },
85
+ "--set=image.tag=latest" ,
74
86
},
75
87
}
76
88
77
89
for _ , tc := range cases {
78
90
t .Run (tc .name , func (t * testing.T ) {
79
- ct := newTestingHelmIntegration (tc .cfg )
91
+ ct := newTestingHelmIntegration (tc .cfg , tc . extraSet )
80
92
namespace := tc .cfg .Namespace
81
93
if namespace != "" {
82
94
ct .kubectl .CreateNamespace (namespace )
@@ -107,7 +119,7 @@ func TestUpgradeChart(t *testing.T) {
107
119
Debug : true ,
108
120
Upgrade : true ,
109
121
}
110
- ct := newTestingHelmIntegration (cfg )
122
+ ct := newTestingHelmIntegration (cfg , "" )
111
123
processError := fmt .Errorf ("Error waiting for process: exit status 1" )
112
124
113
125
cases := []testCase {
0 commit comments