@@ -202,6 +202,8 @@ func TestAppendDryRunFlags(t *testing.T) {
202202 type args struct {
203203 dryRun string
204204 expected []string
205+ helm helmexec.Interface
206+ flags []string
205207 }
206208 tests := []struct {
207209 name string
@@ -210,11 +212,8 @@ func TestAppendDryRunFlags(t *testing.T) {
210212 {
211213 name : "do dry-run on client" ,
212214 args : args {
213- << << << < Updated upstream
214- dryRun : "client" ,
215- == == == =
216215 flags : []string {},
217- dry - run : "client" ,
216+ dryRun : "client" ,
218217 helm : testutil .NewVersionHelmExec ("3.13.0" ),
219218 expected : []string {"--dry-run" , "client" },
220219 },
@@ -223,38 +222,34 @@ func TestAppendDryRunFlags(t *testing.T) {
223222 name : "empty dry-run means client" ,
224223 args : args {
225224 flags : []string {},
226- dry - run : "" ,
225+ dryRun : "" ,
227226 helm : testutil .NewVersionHelmExec ("3.13.0" ),
228- >> >> >> > Stashed changes
229227 expected : []string {"--dry-run" , "client" },
230228 },
231229 },
232230 {
233231 name : "do dry-run on server" ,
234232 args : args {
235- << << << < Updated upstream
236- dryRun : "server" ,
237- == == == =
238233 flags : []string {},
239- dry - run : "server" ,
234+ dryRun : "server" ,
240235 helm : testutil .NewVersionHelmExec ("3.13.0" ),
241- >> >> >> > Stashed changes
242236 expected : []string {"--dry-run" , "server" },
243237 },
244- {
245- name : "no version below 3.13.0" ,
246- args : args {
247- flags : []string {},
248- dry - run : "server" ,
249- helm : testutil .NewVersionHelmExec ("3.12.1" ),
250- expected : []string {},
251- },
238+ },
239+ {
240+ name : "no version below 3.13.0" ,
241+ args : args {
242+ flags : []string {},
243+ dryRun : "server" ,
244+ helm : testutil .NewVersionHelmExec ("3.12.1" ),
245+ expected : []string {},
246+ },
252247 },
253248 }
254249 for _ , tt := range tests {
255250 t .Run (tt .name , func (t * testing.T ) {
256251 st := & HelmState {}
257- got := st .appendDryRunFlags ([]string {}, & SyncOpts {
252+ got := st .appendDryRunFlags ([]string {}, tt . args . helm , & SyncOpts {
258253 DryRun : tt .args .dryRun ,
259254 })
260255 require .Equalf (t , tt .args .expected , got , "appendDryRunFlags() = %v, want %v" , got , tt .args .expected )
0 commit comments