Skip to content

Commit 9a650b1

Browse files
committed
Copy kubernetes test binaries to _rundir, instead of _artifacts when running integration test on k8s master branch
1 parent 54297b1 commit 9a650b1

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

test/k8s-integration/driver.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,17 @@ func installDriver(testParams *testParameters, stagingImage, deployOverlayName s
2727

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

3531
// TODO (#138): in a local environment this is going to modify the actual kustomize files.
3632
// maybe a copy should be made instead
37-
out, err = exec.Command(
33+
kustomizeCommand := exec.Command(
3834
filepath.Join(testParams.pkgDir, "bin", "kustomize"),
3935
"edit",
4036
"set",
4137
"image",
42-
fmt.Sprintf("%s=%s:%s", pdImagePlaceholder, stagingImage, testParams.stagingVersion)).CombinedOutput()
38+
fmt.Sprintf("%s=%s:%s", pdImagePlaceholder, stagingImage, testParams.stagingVersion))
39+
kustomizeCommand.Dir = overlayDir
40+
out, err = kustomizeCommand.CombinedOutput()
4341
if err != nil {
4442
return fmt.Errorf("failed to edit kustomize: %s, err: %v", out, err.Error())
4543
}

test/k8s-integration/main.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -867,16 +867,11 @@ func runTestsWithConfig(testParams *testParameters, testConfigArg, reportPrefix
867867
// path sent to kubetest2 through its --artifacts path
868868

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

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

0 commit comments

Comments
 (0)