Skip to content

build kubectl for test kube directory #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions test/k8s-integration/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func handle() error {
}
err = buildKubernetes(testDir, "WHAT=test/e2e/e2e.test")
if err != nil {
return fmt.Errorf("failed to build Kubernetes: %v", err)
return fmt.Errorf("failed to build Kubernetes e2e: %v", err)
}
} else {
testDir = k8sDir
Expand Down Expand Up @@ -321,6 +321,12 @@ func runTestsWithConfig(testDir, testFocus, testConfigArg string) error {
homeDir, _ := os.LookupEnv("HOME")
os.Setenv("KUBECONFIG", filepath.Join(homeDir, ".kube/config"))

cmd := exec.Command("export", "KUBECTL_PATH=$(which kubectl)")
err = runCommand("Exporting KUBECTL_PATH", cmd)
if err != nil {
return fmt.Errorf("failed to export kubectl path: %v", err)
}

artifactsDir, _ := os.LookupEnv("ARTIFACTS")
reportArg := fmt.Sprintf("-report-dir=%s", artifactsDir)

Expand All @@ -330,9 +336,10 @@ func runTestsWithConfig(testDir, testFocus, testConfigArg string) error {
testConfigArg,
reportArg)

cmd := exec.Command("kubetest",
cmd = exec.Command("kubetest",
"--test",
"--ginkgo-parallel",
"--check-version-skew=false",
fmt.Sprintf("--test_args=%s", kubetestArgs),
)
err = runCommand("Running Tests", cmd)
Expand Down