@@ -187,7 +187,6 @@ func handle() error {
187
187
k8sDir := filepath .Join (k8sParentDir , "kubernetes" )
188
188
testParentDir := generateUniqueTmpDir ()
189
189
testDir := filepath .Join (testParentDir , "kubernetes" )
190
- k8sBuildBinDir := k8sInDockerBuildBinDir
191
190
defer removeDir (k8sParentDir )
192
191
defer removeDir (testParentDir )
193
192
@@ -217,11 +216,6 @@ func handle() error {
217
216
if err != nil {
218
217
return fmt .Errorf ("failed to build Kubernetes: %v" , err )
219
218
}
220
- err = buildKubernetes (testDir , "ginkgo" )
221
- if err != nil {
222
- return fmt .Errorf ("failed to build Gingko: %v" , err )
223
- }
224
- k8sBuildBinDir = k8sOutOfDockerBuildBinDir
225
219
} else {
226
220
testDir = k8sDir
227
221
}
@@ -277,11 +271,10 @@ func handle() error {
277
271
}
278
272
279
273
// Run the tests using the testDir kubernetes
280
- fullK8sBuildBinPath := filepath .Join (testDir , k8sBuildBinDir )
281
274
if len (* storageClassFile ) != 0 {
282
- err = runCSITests (pkgDir , fullK8sBuildBinPath , * testFocus , * storageClassFile , * gceZone )
275
+ err = runCSITests (pkgDir , k8sDir , * testFocus , * storageClassFile )
283
276
} else if * migrationTest {
284
- err = runMigrationTests (pkgDir , fullK8sBuildBinPath , * testFocus , * gceZone )
277
+ err = runMigrationTests (pkgDir , k8sDir , * testFocus )
285
278
} else {
286
279
return fmt .Errorf ("did not run either CSI or Migration test" )
287
280
}
@@ -306,21 +299,21 @@ func setEnvProject(project string) error {
306
299
return nil
307
300
}
308
301
309
- func runMigrationTests (pkgDir , k8sBinDir , testFocus , gceZone string ) error {
310
- return runTestsWithConfig (k8sBinDir , gceZone , testFocus , "-storage.migratedPlugins=kubernetes.io/gce-pd" )
302
+ func runMigrationTests (pkgDir , k8sDir , testFocus string ) error {
303
+ return runTestsWithConfig (k8sDir , testFocus , "- -storage.migratedPlugins=kubernetes.io/gce-pd" )
311
304
}
312
305
313
- func runCSITests (pkgDir , k8sBinDir , testFocus , storageClassFile , gceZone string ) error {
306
+ func runCSITests (pkgDir , k8sDir , testFocus , storageClassFile string ) error {
314
307
testDriverConfigFile , err := generateDriverConfigFile (pkgDir , storageClassFile )
315
308
if err != nil {
316
309
return err
317
310
}
318
- testConfigArg := fmt .Sprintf ("-storage.testdriver=%s" , testDriverConfigFile )
319
- return runTestsWithConfig (k8sBinDir , gceZone , testFocus , testConfigArg )
311
+ testConfigArg := fmt .Sprintf ("-- storage.testdriver=%s" , testDriverConfigFile )
312
+ return runTestsWithConfig (k8sDir , testFocus , testConfigArg )
320
313
}
321
314
322
- func runTestsWithConfig (k8sBinDir , gceZone , testFocus , testConfigArg string ) error {
323
- err := os .Chdir (k8sBinDir )
315
+ func runTestsWithConfig (k8sDir , testFocus , testConfigArg string ) error {
316
+ err := os .Chdir (k8sDir )
324
317
if err != nil {
325
318
return err
326
319
}
@@ -331,23 +324,17 @@ func runTestsWithConfig(k8sBinDir, gceZone, testFocus, testConfigArg string) err
331
324
artifactsDir , _ := os .LookupEnv ("ARTIFACTS" )
332
325
reportArg := fmt .Sprintf ("-report-dir=%s" , artifactsDir )
333
326
334
- testFocusArg := fmt .Sprintf ("-focus=%s" , testFocus )
335
-
336
- cmd := exec .Command ("./ginkgo" ,
337
- "-p" ,
338
- "-v" ,
339
- testFocusArg ,
340
- "-skip=\\ [Disruptive\\ ]|\\ [Serial\\ ]|\\ [Feature:.+\\ ]" ,
341
- "e2e.test" ,
342
- "--" ,
343
- "-v=5" ,
344
- reportArg ,
345
- "-provider=gce" ,
346
- "-node-os-distro=cos" ,
347
- fmt .Sprintf ("-num-nodes=%v" , * numNodes ),
348
- fmt .Sprintf ("-gce-zone=%s" , gceZone ),
349
- testConfigArg )
350
-
327
+ kubetestArgs := fmt .Sprintf ("--ginkgo.focus=%s --ginkgo.skip=%s %s %s" ,
328
+ testFocus ,
329
+ "\\ [Disruptive\\ ]|\\ [Serial\\ ]|\\ [Feature:.+\\ ]" ,
330
+ testConfigArg ,
331
+ reportArg )
332
+
333
+ cmd := exec .Command ("kubetest" ,
334
+ "--test" ,
335
+ "--ginkgo-parallel" ,
336
+ fmt .Sprintf ("--test_args=%s" , kubetestArgs ),
337
+ )
351
338
err = runCommand ("Running Tests" , cmd )
352
339
if err != nil {
353
340
return fmt .Errorf ("failed to run tests on e2e cluster: %v" , err )
0 commit comments