From 94fec30bb684f5cd462e5465ede07a39dd10e564 Mon Sep 17 00:00:00 2001 From: David Zhu Date: Fri, 19 Jul 2019 11:33:22 -0700 Subject: [PATCH] Run tests from always existing kubernetes directory that contains the tests, not the gce build k8s directory --- test/k8s-integration/main.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/k8s-integration/main.go b/test/k8s-integration/main.go index 2a5d7e82d..b23d0a92c 100644 --- a/test/k8s-integration/main.go +++ b/test/k8s-integration/main.go @@ -272,9 +272,9 @@ func handle() error { // Run the tests using the testDir kubernetes if len(*storageClassFile) != 0 { - err = runCSITests(pkgDir, k8sDir, *testFocus, *storageClassFile) + err = runCSITests(pkgDir, testDir, *testFocus, *storageClassFile) } else if *migrationTest { - err = runMigrationTests(pkgDir, k8sDir, *testFocus) + err = runMigrationTests(pkgDir, testDir, *testFocus) } else { return fmt.Errorf("did not run either CSI or Migration test") } @@ -299,21 +299,21 @@ func setEnvProject(project string) error { return nil } -func runMigrationTests(pkgDir, k8sDir, testFocus string) error { - return runTestsWithConfig(k8sDir, testFocus, "--storage.migratedPlugins=kubernetes.io/gce-pd") +func runMigrationTests(pkgDir, testDir, testFocus string) error { + return runTestsWithConfig(testDir, testFocus, "--storage.migratedPlugins=kubernetes.io/gce-pd") } -func runCSITests(pkgDir, k8sDir, testFocus, storageClassFile string) error { +func runCSITests(pkgDir, testDir, testFocus, storageClassFile string) error { testDriverConfigFile, err := generateDriverConfigFile(pkgDir, storageClassFile) if err != nil { return err } testConfigArg := fmt.Sprintf("--storage.testdriver=%s", testDriverConfigFile) - return runTestsWithConfig(k8sDir, testFocus, testConfigArg) + return runTestsWithConfig(testDir, testFocus, testConfigArg) } -func runTestsWithConfig(k8sDir, testFocus, testConfigArg string) error { - err := os.Chdir(k8sDir) +func runTestsWithConfig(testDir, testFocus, testConfigArg string) error { + err := os.Chdir(testDir) if err != nil { return err }