Skip to content

Commit a1c2380

Browse files
Add automated go version extraction for e2e tests with fuse b/379879910
1 parent f1588b0 commit a1c2380

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

test/e2e/testsuites/gcsfuse_integration.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,9 @@ func (t *gcsFuseCSIGCSFuseIntegrationTestSuite) DefineTests(driver storageframew
233233
tPod.VerifyExecInPodSucceedWithFullOutput(f, specs.TesterContainerName, "apt-get update && apt-get install -y google-cloud-cli")
234234

235235
ginkgo.By("Checking that the gcsfuse integration tests exits with no error")
236-
baseTestCommand := fmt.Sprintf("export GOTOOLCHAIN=go1.23.4 && export PATH=$PATH:/usr/local/go/bin && cd %v/%v && GODEBUG=asyncpreemptoff=1 go test . -p 1 --integrationTest -v --mountedDirectory=%v", gcsfuseIntegrationTestsBasePath, testName, mountPath)
236+
237+
setGoVersion := fmt.Sprintf("GO_VERSION=$(grep -o 'go[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+' ./gcsfuse/tools/cd_scripts/e2e_test.sh | sed 's/go//')")
238+
baseTestCommand := fmt.Sprintf("%v && export GOTOOLCHAIN=go$GO_VERSION && export PATH=$PATH:/usr/local/go/bin && cd %v/%v && GODEBUG=asyncpreemptoff=1 go test . -p 1 --integrationTest -v --mountedDirectory=%v", setGoVersion, gcsfuseIntegrationTestsBasePath, testName, mountPath)
237239
baseTestCommandWithTestBucket := baseTestCommand + fmt.Sprintf(" --testbucket=%v", bucketName)
238240

239241
var finalTestCommand string

test/e2e/testsuites/gcsfuse_integration_file_cache.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ func (t *gcsFuseCSIGCSFuseIntegrationFileCacheTestSuite) DefineTests(driver stor
173173
tPod.VerifyExecInPodSucceed(f, specs.TesterContainerName, fmt.Sprintf("git clone --branch %v https://github.com/GoogleCloudPlatform/gcsfuse.git", gcsfuseTestBranch))
174174
tPod.VerifyExecInPodSucceed(f, specs.TesterContainerName, "ln -s /usr/bin/python3 /usr/bin/python")
175175

176-
baseTestCommand := fmt.Sprintf("export GOTOOLCHAIN=go1.23.4 && export PATH=$PATH:/usr/local/go/bin && cd %v/read_cache && GODEBUG=asyncpreemptoff=1 go test . -p 1 --integrationTest -v --mountedDirectory=%v --testbucket=%v -run %v", gcsfuseIntegrationTestsBasePath, mountPath, bucketName, testName)
176+
setGoVersion := fmt.Sprintf("GO_VERSION=$(grep -o 'go[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+' ./gcsfuse/tools/cd_scripts/e2e_test.sh | sed 's/go//')")
177+
baseTestCommand := fmt.Sprintf("%v && export GOTOOLCHAIN=go$GO_VERSION && export PATH=$PATH:/usr/local/go/bin && cd %v/read_cache && GODEBUG=asyncpreemptoff=1 go test . -p 1 --integrationTest -v --mountedDirectory=%v --testbucket=%v -run %v", setGoVersion, gcsfuseIntegrationTestsBasePath, mountPath, bucketName, testName)
177178
tPod.VerifyExecInPodSucceedWithFullOutput(f, specs.TesterContainerName, baseTestCommand)
178179
}
179180

test/e2e/testsuites/gcsfuse_integration_file_cache_parallel_downloads.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ func (t *gcsFuseCSIGCSFuseIntegrationFileCacheParallelDownloadsTestSuite) Define
179179
tPod.VerifyExecInPodSucceed(f, specs.TesterContainerName, fmt.Sprintf("git clone --branch %v https://github.com/GoogleCloudPlatform/gcsfuse.git", gcsfuseTestBranch))
180180
tPod.VerifyExecInPodSucceed(f, specs.TesterContainerName, "ln -s /usr/bin/python3 /usr/bin/python")
181181

182-
baseTestCommand := fmt.Sprintf("export GOTOOLCHAIN=go1.23.4 && export PATH=$PATH:/usr/local/go/bin && cd %v/read_cache && GODEBUG=asyncpreemptoff=1 go test . -p 1 --integrationTest -v --mountedDirectory=%v --testbucket=%v -run %v", gcsfuseIntegrationTestsBasePath, mountPath, bucketName, testName)
182+
setGoVersion := fmt.Sprintf("GO_VERSION=$(grep -o 'go[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+' ./gcsfuse/tools/cd_scripts/e2e_test.sh | sed 's/go//')")
183+
baseTestCommand := fmt.Sprintf("%v && export GOTOOLCHAIN=go$GO_VERSION && export PATH=$PATH:/usr/local/go/bin && cd %v/read_cache && GODEBUG=asyncpreemptoff=1 go test . -p 1 --integrationTest -v --mountedDirectory=%v --testbucket=%v -run %v", setGoVersion, gcsfuseIntegrationTestsBasePath, mountPath, bucketName, testName)
183184
tPod.VerifyExecInPodSucceedWithFullOutput(f, specs.TesterContainerName, baseTestCommand)
184185
}
185186

0 commit comments

Comments
 (0)