go/internal/gcimporter: skip typeparam import tests on unified builders
CL 351855 introduced a typeparam test that imported the constraints
package. As reported in golang/go#48595, this package is currently
breaking with the unified export data format.
Updates golang/go#48595
Change-Id: I1b77955c767a2e890d8d8829cca6455a4e79c5ee
Reviewed-on: https://go-review.googlesource.com/c/tools/+/352853
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
diff --git a/go/internal/gcimporter/iexport_go118_test.go b/go/internal/gcimporter/iexport_go118_test.go
index 1710753..3c9610e 100644
--- a/go/internal/gcimporter/iexport_go118_test.go
+++ b/go/internal/gcimporter/iexport_go118_test.go
@@ -76,6 +76,10 @@
t.Fatal(err)
}
+ if isUnifiedBuilder() {
+ t.Skip("unified export data format is currently unsupported")
+ }
+
for _, entry := range list {
if entry.IsDir() || !strings.HasSuffix(entry.Name(), ".go") {
// For now, only consider standalone go files.
diff --git a/go/internal/gcimporter/iexport_test.go b/go/internal/gcimporter/iexport_test.go
index e1e9d7f..084679b 100644
--- a/go/internal/gcimporter/iexport_test.go
+++ b/go/internal/gcimporter/iexport_test.go
@@ -63,6 +63,12 @@
return buf.Bytes(), nil
}
+// isUnifiedBuilder reports whether we are executing on a go builder that uses
+// unified export data.
+func isUnifiedBuilder() bool {
+ return os.Getenv("GO_BUILDER_NAME") == "linux-amd64-unified"
+}
+
func TestIExportData_stdlib(t *testing.T) {
if runtime.Compiler == "gccgo" {
t.Skip("gccgo standard library is inaccessible")
@@ -88,7 +94,7 @@
// TryBots.
//
// TODO(#48595): fix this test with GOEXPERIMENT=unified.
- isUnified := os.Getenv("GO_BUILDER_NAME") == "linux-amd64-unified"
+ isUnified := isUnifiedBuilder()
for _, path := range buildutil.AllPackages(conf.Build) {
if !(isUnified && testenv.UsesGenerics(path)) {
conf.Import(path)