Skip to content

Commit b45b1e3

Browse files
authored
Merge pull request #351 from davidz627/fix/GKETestDir
Run tests from always existing kubernetes directory that contains the tests, not the gce build k8s directory
2 parents eb91fba + 94fec30 commit b45b1e3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/k8s-integration/main.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,9 @@ func handle() error {
272272

273273
// Run the tests using the testDir kubernetes
274274
if len(*storageClassFile) != 0 {
275-
err = runCSITests(pkgDir, k8sDir, *testFocus, *storageClassFile)
275+
err = runCSITests(pkgDir, testDir, *testFocus, *storageClassFile)
276276
} else if *migrationTest {
277-
err = runMigrationTests(pkgDir, k8sDir, *testFocus)
277+
err = runMigrationTests(pkgDir, testDir, *testFocus)
278278
} else {
279279
return fmt.Errorf("did not run either CSI or Migration test")
280280
}
@@ -299,21 +299,21 @@ func setEnvProject(project string) error {
299299
return nil
300300
}
301301

302-
func runMigrationTests(pkgDir, k8sDir, testFocus string) error {
303-
return runTestsWithConfig(k8sDir, testFocus, "--storage.migratedPlugins=kubernetes.io/gce-pd")
302+
func runMigrationTests(pkgDir, testDir, testFocus string) error {
303+
return runTestsWithConfig(testDir, testFocus, "--storage.migratedPlugins=kubernetes.io/gce-pd")
304304
}
305305

306-
func runCSITests(pkgDir, k8sDir, testFocus, storageClassFile string) error {
306+
func runCSITests(pkgDir, testDir, testFocus, storageClassFile string) error {
307307
testDriverConfigFile, err := generateDriverConfigFile(pkgDir, storageClassFile)
308308
if err != nil {
309309
return err
310310
}
311311
testConfigArg := fmt.Sprintf("--storage.testdriver=%s", testDriverConfigFile)
312-
return runTestsWithConfig(k8sDir, testFocus, testConfigArg)
312+
return runTestsWithConfig(testDir, testFocus, testConfigArg)
313313
}
314314

315-
func runTestsWithConfig(k8sDir, testFocus, testConfigArg string) error {
316-
err := os.Chdir(k8sDir)
315+
func runTestsWithConfig(testDir, testFocus, testConfigArg string) error {
316+
err := os.Chdir(testDir)
317317
if err != nil {
318318
return err
319319
}

0 commit comments

Comments
 (0)