From b9b626d0612137a03d5c0d36e12e68f414ddbfaa Mon Sep 17 00:00:00 2001 From: Ayush Ranjan Date: Wed, 8 May 2024 07:30:39 -0700 Subject: [PATCH] Bump golang runtime tests to Go 1.22. - `go tool dist` was removed in favour of using `go run cmd/dist`. - The tests in `test/` directory should be run normally using `go test`. See https://github.com/golang/go/commit/7a0799b2c0bdfaf745dbd8c74a3db2f3d238fd1b. PiperOrigin-RevId: 631793797 --- .buildkite/pipeline.yaml | 4 ++-- images/runtimes/go1.20/Dockerfile.x86_64 | 4 ---- images/runtimes/go1.22/Dockerfile.x86_64 | 5 +++++ test/runtimes/BUILD | 4 ++-- test/runtimes/README.md | 2 +- test/runtimes/exclude/go1.20.csv | 10 ---------- test/runtimes/exclude/go1.22.csv | 9 +++++++++ test/runtimes/proctor/lib/go.go | 7 +++---- 8 files changed, 22 insertions(+), 23 deletions(-) delete mode 100644 images/runtimes/go1.20/Dockerfile.x86_64 create mode 100644 images/runtimes/go1.22/Dockerfile.x86_64 delete mode 100644 test/runtimes/exclude/go1.20.csv create mode 100644 test/runtimes/exclude/go1.22.csv diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index af12a47f0..633ffab32 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -518,7 +518,7 @@ steps: - <<: *common <<: *docker label: ":golang: Go runtime tests" - command: make go1.20-runtime-tests RUNTIME_ARGS=--directfs + command: make go1.22-runtime-tests RUNTIME_ARGS=--directfs parallelism: 10 agents: <<: *platform_specific_agents @@ -562,7 +562,7 @@ steps: - <<: *common <<: *docker label: ":golang: Go runtime tests (goferfs)" - command: make go1.20-runtime-tests RUNTIME_ARGS=--directfs=false + command: make go1.22-runtime-tests RUNTIME_ARGS=--directfs=false parallelism: 10 if: build.branch == "master" agents: diff --git a/images/runtimes/go1.20/Dockerfile.x86_64 b/images/runtimes/go1.20/Dockerfile.x86_64 deleted file mode 100644 index 94efb9cfd..000000000 --- a/images/runtimes/go1.20/Dockerfile.x86_64 +++ /dev/null @@ -1,4 +0,0 @@ -FROM golang:1.20 - -# Compile the tests during build to save time during testing. -RUN ["go", "tool", "dist", "test", "-compile-only"] diff --git a/images/runtimes/go1.22/Dockerfile.x86_64 b/images/runtimes/go1.22/Dockerfile.x86_64 new file mode 100644 index 000000000..f75ea7b19 --- /dev/null +++ b/images/runtimes/go1.22/Dockerfile.x86_64 @@ -0,0 +1,5 @@ +FROM golang:1.22 + +# Compile the tests during build to save time during testing. +ENV GOROOT=/usr/local/go +RUN ["go", "run", "cmd/dist", "test", "-compile-only"] diff --git a/test/runtimes/BUILD b/test/runtimes/BUILD index 1f9a6dd40..a1fadcdb8 100644 --- a/test/runtimes/BUILD +++ b/test/runtimes/BUILD @@ -7,8 +7,8 @@ package( ) runtime_test( - name = "go1.20", - exclude_file = "exclude/go1.20.csv", + name = "go1.22", + exclude_file = "exclude/go1.22.csv", lang = "go", shard_count = more_shards, ) diff --git a/test/runtimes/README.md b/test/runtimes/README.md index bfb44eceb..cf9e1dd5f 100644 --- a/test/runtimes/README.md +++ b/test/runtimes/README.md @@ -28,7 +28,7 @@ Note: java runtime test take 1+ hours with 16 cores. Language | Version | Running the test suite -------- | ------- | ---------------------------------- -Go | 1.20 | `make go1.20-runtime-tests` +Go | 1.22 | `make go1.22-runtime-tests` Java | 17 | `make java17-runtime-tests` NodeJS | 16.13.2 | `make nodejs16.13.2-runtime-tests` Php | 8.1.1 | `make php8.1.1-runtime-tests` diff --git a/test/runtimes/exclude/go1.20.csv b/test/runtimes/exclude/go1.20.csv deleted file mode 100644 index 1ff196813..000000000 --- a/test/runtimes/exclude/go1.20.csv +++ /dev/null @@ -1,10 +0,0 @@ -test name,bug id,comment -cgo_errors,,FLAKY -cgo_test,, -go_test:cmd/go,,FLAKY -go_test:net,b/162473575,setsockopt: protocol not available. -go_test:os/signal,b/118780860,/dev/pts not properly supported. Also being tracked in b/29356795. -go_test:syscall,b/118781998,bad bytes -- bad mem addr; FcntlFlock(F_GETLK) not supported. -test:0_1,,FLAKY -testcarchive,b/118782924,FLAKY -testshared,,FLAKY diff --git a/test/runtimes/exclude/go1.22.csv b/test/runtimes/exclude/go1.22.csv new file mode 100644 index 000000000..c1f836891 --- /dev/null +++ b/test/runtimes/exclude/go1.22.csv @@ -0,0 +1,9 @@ +test name,bug id,comment +cmd/cgo/internal/testerrors,b/339191886,Too slow +cmd/cgo/internal/testsanitizers,b/339101787, +cmd/go,b/339179763, +cmd/internal/testdir:0_1,,tries to run ALL tests in 'test/' directory and times out +cmd/link,b/339311479, +cmd/link/internal/ld,b/339311479, +os/signal,b/339311315, +syscall,b/118781998, diff --git a/test/runtimes/proctor/lib/go.go b/test/runtimes/proctor/lib/go.go index bc568055d..47d91ce7e 100644 --- a/test/runtimes/proctor/lib/go.go +++ b/test/runtimes/proctor/lib/go.go @@ -46,7 +46,7 @@ var _ TestRunner = goRunner{} // ListTests implements TestRunner.ListTests. func (goRunner) ListTests() ([]string, error) { // Go tool dist test tests. - args := []string{"tool", "dist", "test", "-list"} + args := []string{"run", "cmd/dist", "test", "-list"} cmd := exec.Command("go", args...) cmd.Stderr = os.Stderr out, err := cmd.Output() @@ -87,7 +87,7 @@ func (goRunner) TestCmds(tests []string) []*exec.Cmd { var cmds []*exec.Cmd if len(toolTests) > 0 { - cmd := exec.Command("go", "tool", "dist", "test", "-v", "-no-rebuild", "-run", strings.Join(toolTests, "|")) + cmd := exec.Command("go", "run", "cmd/dist", "test", "-v", "-no-rebuild", "-run", strings.Join(toolTests, "|")) // Bump up timeout. Some go tool tests take more than 3 minutes to run. // golang/go/src/cmd/dist/test.go:registerStdTest() sets default timeout to // 3 minutes which can only be increased via GO_TEST_TIMEOUT_SCALE. @@ -95,8 +95,7 @@ func (goRunner) TestCmds(tests []string) []*exec.Cmd { cmds = append(cmds, cmd) } if len(onDiskTests) > 0 { - cmd := exec.Command("go", append([]string{"run", "run.go", "-v", "--"}, onDiskTests...)...) - cmd.Dir = goTestDir + cmd := exec.Command("go", []string{"test", "cmd/internal/testdir", fmt.Sprintf("-run='Test/(%s)'", strings.Join(onDiskTests, "|"))}...) cmds = append(cmds, cmd) }