aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2023-05-08 16:31:23 -0400
committerAustin Clements <austin@google.com>2023-05-12 12:35:05 +0000
commit3943fc14d35c117f2256fb789743d9f075c9aba5 (patch)
treefc282062b14c176950da4f672202e9b922ea1395
parentb26c3927bd9b250715a7f8652b3cd5c16475ff07 (diff)
downloadgo-3943fc14d35c117f2256fb789743d9f075c9aba5.tar.gz
go-3943fc14d35c117f2256fb789743d9f075c9aba5.zip
misc/reboot: move to cmd/internal/bootstrap_test
This is the last test run from misc by dist. For #37486. Change-Id: I1a70ded29ba0de548c9a16611ba987a258121e80 Reviewed-on: https://go-review.googlesource.com/c/go/+/493606 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
-rw-r--r--src/cmd/dist/test.go7
-rw-r--r--src/cmd/internal/bootstrap_test/experiment_toolid_test.go (renamed from misc/reboot/experiment_toolid_test.go)5
-rw-r--r--src/cmd/internal/bootstrap_test/overlaydir_test.go (renamed from misc/reboot/overlaydir_test.go)2
-rw-r--r--src/cmd/internal/bootstrap_test/reboot_test.go (renamed from misc/reboot/reboot_test.go)14
4 files changed, 12 insertions, 16 deletions
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
index 6e77c7e07e..7ec10aecac 100644
--- a/src/cmd/dist/test.go
+++ b/src/cmd/dist/test.go
@@ -887,13 +887,6 @@ func (t *tester) registerTests() {
if goos == "darwin" || ((goos == "linux" || goos == "windows") && goarch == "amd64") {
t.registerTest("api", "", &goTest{dir: "cmd/api", timeout: 5 * time.Minute, testFlags: []string{"-check"}})
}
-
- // Ensure that the toolchain can bootstrap itself.
- // This test adds another ~45s to all.bash if run sequentially, so run it only on the builders.
- // Not meaningful on wasm/js or wasm/wasip1.
- if os.Getenv("GO_BUILDER_NAME") != "" && goos != "android" && !t.iOS() && goos != "js" && goos != "wasip1" {
- t.registerTest("reboot", "", &goTest{dir: "../misc/reboot", timeout: 5 * time.Minute})
- }
}
// isRegisteredTestName reports whether a test named testName has already
diff --git a/misc/reboot/experiment_toolid_test.go b/src/cmd/internal/bootstrap_test/experiment_toolid_test.go
index 87a828e32f..cc60509ecb 100644
--- a/misc/reboot/experiment_toolid_test.go
+++ b/src/cmd/internal/bootstrap_test/experiment_toolid_test.go
@@ -5,12 +5,13 @@
//go:build explicit
// +build explicit
-// Package experiment_toolid_test verifies that GOEXPERIMENT settings built
+// This test verifies that GOEXPERIMENT settings built
// into the toolchain influence tool ids in the Go command.
// This test requires bootstrapping the toolchain twice, so it's very expensive.
// It must be run explicitly with -tags=explicit.
// Verifies golang.org/issue/33091.
-package reboot_test
+
+package bootstrap_test
import (
"bytes"
diff --git a/misc/reboot/overlaydir_test.go b/src/cmd/internal/bootstrap_test/overlaydir_test.go
index 71faf0936b..5812c453ac 100644
--- a/misc/reboot/overlaydir_test.go
+++ b/src/cmd/internal/bootstrap_test/overlaydir_test.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package reboot_test
+package bootstrap_test
import (
"io"
diff --git a/misc/reboot/reboot_test.go b/src/cmd/internal/bootstrap_test/reboot_test.go
index 94d61e000e..eca024fa89 100644
--- a/misc/reboot/reboot_test.go
+++ b/src/cmd/internal/bootstrap_test/reboot_test.go
@@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Package reboot_test verifies that the current GOROOT can be used to bootstrap
+// Package bootstrap_test verifies that the current GOROOT can be used to bootstrap
// itself.
-package reboot_test
+package bootstrap_test
import (
"fmt"
+ "internal/testenv"
"io"
"os"
"os/exec"
@@ -22,12 +23,13 @@ func TestRepeatBootstrap(t *testing.T) {
if testing.Short() {
t.Skipf("skipping test that rebuilds the entire toolchain")
}
-
- realGoroot, err := filepath.Abs(filepath.Join("..", ".."))
- if err != nil {
- t.Fatal(err)
+ switch runtime.GOOS {
+ case "android", "ios", "js", "wasip1":
+ t.Skipf("skipping because the toolchain does not have to bootstrap on GOOS=%s", runtime.GOOS)
}
+ realGoroot := testenv.GOROOT(t)
+
// To ensure that bootstrapping doesn't unexpectedly depend
// on the Go repo's git metadata, add a fake (unreadable) git
// directory above the simulated GOROOT.