Skip to content

Commit da36f79

Browse files
committed
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 <[email protected]> Run-TryBot: Robert Findley <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent 64bbad1 commit da36f79

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

go/internal/gcimporter/iexport_go118_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ func TestImportTypeparamTests(t *testing.T) {
7676
t.Fatal(err)
7777
}
7878

79+
if isUnifiedBuilder() {
80+
t.Skip("unified export data format is currently unsupported")
81+
}
82+
7983
for _, entry := range list {
8084
if entry.IsDir() || !strings.HasSuffix(entry.Name(), ".go") {
8185
// For now, only consider standalone go files.

go/internal/gcimporter/iexport_test.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ func iexport(fset *token.FileSet, pkg *types.Package) ([]byte, error) {
6363
return buf.Bytes(), nil
6464
}
6565

66+
// isUnifiedBuilder reports whether we are executing on a go builder that uses
67+
// unified export data.
68+
func isUnifiedBuilder() bool {
69+
return os.Getenv("GO_BUILDER_NAME") == "linux-amd64-unified"
70+
}
71+
6672
func TestIExportData_stdlib(t *testing.T) {
6773
if runtime.Compiler == "gccgo" {
6874
t.Skip("gccgo standard library is inaccessible")
@@ -88,7 +94,7 @@ func TestIExportData_stdlib(t *testing.T) {
8894
// TryBots.
8995
//
9096
// TODO(#48595): fix this test with GOEXPERIMENT=unified.
91-
isUnified := os.Getenv("GO_BUILDER_NAME") == "linux-amd64-unified"
97+
isUnified := isUnifiedBuilder()
9298
for _, path := range buildutil.AllPackages(conf.Build) {
9399
if !(isUnified && testenv.UsesGenerics(path)) {
94100
conf.Import(path)

0 commit comments

Comments
 (0)