@@ -94,19 +94,16 @@ func Test_runner_Run(t *testing.T) {
94
94
// to allow unit tests to work
95
95
assert .NoError (t , flags .SetupFlags (tt .config ))
96
96
assert .NoError (t , flag .Set ("test.testlogfile" , "" ))
97
- got , err := r .Run (context .TODO (), tt .config , tt .tc , tt .tests ... )
97
+ err := r .Run (context .TODO (), tt .config , tt .tc , tt .tests ... )
98
98
if tt .wantErr {
99
99
assert .Error (t , err )
100
100
} else {
101
101
assert .NoError (t , err )
102
102
}
103
- if tt .want == nil {
104
- assert .Nil (t , got )
105
- } else {
106
- assert .NotNil (t , got )
107
- assert .Equal (t , tt .want .failed , got .Failed ())
108
- assert .Equal (t , tt .want .passed , got .Passed ())
109
- assert .Equal (t , tt .want .skipped , got .Skipped ())
103
+ if tt .want != nil {
104
+ assert .Equal (t , tt .want .failed , tc .Failed ())
105
+ assert .Equal (t , tt .want .passed , tc .Passed ())
106
+ assert .Equal (t , tt .want .skipped , tc .Skipped ())
110
107
}
111
108
})
112
109
}
@@ -158,7 +155,7 @@ func Test_runner_run(t *testing.T) {
158
155
r := & runner {
159
156
clock : clock.RealClock {},
160
157
}
161
- _ , err := r .run (context .TODO (), tt .m , model.Configuration {}, enginecontext .EmptyContext (), tt .tests ... )
158
+ err := r .run (context .TODO (), tt .m , model.Configuration {}, enginecontext .EmptyContext (), tt .tests ... )
162
159
if tt .wantErr {
163
160
assert .Error (t , err )
164
161
} else {
@@ -229,17 +226,6 @@ func TestRun(t *testing.T) {
229
226
},
230
227
restConfig : nil ,
231
228
wantErr : false ,
232
- }, {
233
- name : "Zero Tests with JSON Report" ,
234
- tests : []discovery.Test {},
235
- config : model.Configuration {
236
- Timeouts : config .Spec .Timeouts ,
237
- Report : & v1alpha2.ReportOptions {
238
- Format : v1alpha2 .JSONFormat ,
239
- },
240
- },
241
- restConfig : & rest.Config {},
242
- wantErr : false ,
243
229
}, {
244
230
name : "Success Case with 1 Test" ,
245
231
tests : []discovery.Test {
@@ -270,49 +256,6 @@ func TestRun(t *testing.T) {
270
256
restConfig : & rest.Config {},
271
257
mockReturn : 2 ,
272
258
wantErr : true ,
273
- }, {
274
- name : "Success Case with 1 Test with XML Report" ,
275
- tests : []discovery.Test {
276
- {
277
- Err : nil ,
278
- Test : & model.Test {
279
- ObjectMeta : metav1.ObjectMeta {
280
- Name : "test1" ,
281
- },
282
- },
283
- },
284
- },
285
- config : model.Configuration {
286
- Timeouts : config .Spec .Timeouts ,
287
- Report : & v1alpha2.ReportOptions {
288
- Format : v1alpha2 .XMLFormat ,
289
- Name : "chainsaw" ,
290
- },
291
- },
292
- restConfig : & rest.Config {},
293
- mockReturn : 0 ,
294
- wantErr : false ,
295
- }, {
296
- name : "Error in saving Report" ,
297
- tests : []discovery.Test {
298
- {
299
- Err : nil ,
300
- Test : & model.Test {
301
- ObjectMeta : metav1.ObjectMeta {
302
- Name : "test1" ,
303
- },
304
- },
305
- },
306
- },
307
- config : model.Configuration {
308
- Timeouts : config .Spec .Timeouts ,
309
- Report : & v1alpha2.ReportOptions {
310
- Format : "abc" ,
311
- },
312
- },
313
- restConfig : & rest.Config {},
314
- mockReturn : 0 ,
315
- wantErr : true ,
316
259
}}
317
260
for _ , tt := range tests {
318
261
t .Run (tt .name , func (t * testing.T ) {
@@ -325,7 +268,7 @@ func TestRun(t *testing.T) {
325
268
ctx := context .TODO ()
326
269
tc , err := InitContext (tt .config , tt .restConfig , nil )
327
270
assert .NoError (t , err )
328
- _ , err = runner .run (ctx , mockMainStart , tt .config , tc , tt .tests ... )
271
+ err = runner .run (ctx , mockMainStart , tt .config , tc , tt .tests ... )
329
272
if tt .wantErr {
330
273
assert .Error (t , err )
331
274
} else {
0 commit comments