Skip to content

Commit 5d7988b

Browse files
author
Bryan C. Mills
committed
go/packages,internal/lsp: skip memory-intensive tests on the linux-arm builder
Updates golang/go#32834 Updates golang/go#30309 Change-Id: I75edb84776216523d00fadfb2e2d94ae08533c03 Reviewed-on: https://go-review.googlesource.com/c/tools/+/192336 Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent ee1fc86 commit 5d7988b

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

go/packages/packages_test.go

+9
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ import (
2626
"golang.org/x/tools/go/packages/packagestest"
2727
)
2828

29+
func TestMain(m *testing.M) {
30+
if os.Getenv("GO_BUILDER_NAME") == "linux-arm" {
31+
fmt.Fprintf(os.Stderr, "skipping test: linux-arm builder lacks sufficient memory (https://golang.org/issue/32834)\n")
32+
os.Exit(0)
33+
}
34+
35+
os.Exit(m.Run())
36+
}
37+
2938
// TODO(adonovan): more test cases to write:
3039
//
3140
// - When the tests fail, make them print a 'cd & load' command

internal/lsp/cmd/cmd_test.go

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package cmd_test
77
import (
88
"bytes"
99
"context"
10+
"fmt"
1011
"io/ioutil"
1112
"os"
1213
"path/filepath"
@@ -18,6 +19,15 @@ import (
1819
"golang.org/x/tools/internal/lsp/tests"
1920
)
2021

22+
func TestMain(m *testing.M) {
23+
if os.Getenv("GO_BUILDER_NAME") == "linux-arm" {
24+
fmt.Fprintf(os.Stderr, "skipping test: linux-arm builder lacks sufficient memory (https://golang.org/issue/32834)\n")
25+
os.Exit(0)
26+
}
27+
28+
os.Exit(m.Run())
29+
}
30+
2131
type runner struct {
2232
exporter packagestest.Exporter
2333
data *tests.Data

internal/lsp/lsp_test.go

+10
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"context"
1010
"fmt"
1111
"go/token"
12+
"os"
1213
"os/exec"
1314
"path/filepath"
1415
"sort"
@@ -24,6 +25,15 @@ import (
2425
"golang.org/x/tools/internal/span"
2526
)
2627

28+
func TestMain(m *testing.M) {
29+
if os.Getenv("GO_BUILDER_NAME") == "linux-arm" {
30+
fmt.Fprintf(os.Stderr, "skipping test: linux-arm builder lacks sufficient memory (https://golang.org/issue/32834)\n")
31+
os.Exit(0)
32+
}
33+
34+
os.Exit(m.Run())
35+
}
36+
2737
func TestLSP(t *testing.T) {
2838
packagestest.TestAll(t, testLSP)
2939
}

0 commit comments

Comments
 (0)