Skip to content

Copy kubernetes test binaries to _rundir, instead of _artifacts when running integration test on k8s master branch #1927

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

Merged
Show file tree
Hide file tree
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
10 changes: 4 additions & 6 deletions test/k8s-integration/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,17 @@ func installDriver(testParams *testParameters, stagingImage, deployOverlayName s

// Edit ci kustomization to use given image tag
overlayDir := getOverlayDir(testParams.pkgDir, deployOverlayName)
err = os.Chdir(overlayDir)
if err != nil {
return fmt.Errorf("failed to change to overlay directory: %s, err: %v", out, err.Error())
}

// TODO (#138): in a local environment this is going to modify the actual kustomize files.
// maybe a copy should be made instead
out, err = exec.Command(
kustomizeCommand := exec.Command(
filepath.Join(testParams.pkgDir, "bin", "kustomize"),
"edit",
"set",
"image",
fmt.Sprintf("%s=%s:%s", pdImagePlaceholder, stagingImage, testParams.stagingVersion)).CombinedOutput()
fmt.Sprintf("%s=%s:%s", pdImagePlaceholder, stagingImage, testParams.stagingVersion))
kustomizeCommand.Dir = overlayDir
out, err = kustomizeCommand.CombinedOutput()
if err != nil {
return fmt.Errorf("failed to edit kustomize: %s, err: %v", out, err.Error())
}
Expand Down
9 changes: 2 additions & 7 deletions test/k8s-integration/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -867,16 +867,11 @@ func runTestsWithConfig(testParams *testParameters, testConfigArg, reportPrefix
// path sent to kubetest2 through its --artifacts path

// pkg/_artifacts is the default value that kubetests uses for --artifacts
kubernetesTestBinariesPath := filepath.Join(testParams.pkgDir, "_artifacts")
if kubetestDumpDir != "" {
// a custom artifacts dir was set
kubernetesTestBinariesPath = kubetestDumpDir
}
kubernetesTestBinariesPath := filepath.Join(testParams.pkgDir, "_rundir")
kubernetesTestBinariesPath = filepath.Join(kubernetesTestBinariesPath, runID)

klog.Infof("Copying kubernetes binaries to path=%s to run the tests", kubernetesTestBinariesPath)
err := copyKubernetesTestBinaries(testParams.k8sSourceDir, kubernetesTestBinariesPath)
if err != nil {
if err := copyKubernetesTestBinaries(testParams.k8sSourceDir, kubernetesTestBinariesPath); err != nil {
return fmt.Errorf("failed to copy the kubernetes test binaries, err=%v", err.Error())
}
kubeTest2Args = append(kubeTest2Args, "--use-built-binaries")
Expand Down