Skip to content

Commit 8128bcf

Browse files
committed
gopls/internal/cache: add tolerance for builtin test variants
Gopls tests are failing on CL 620196, where a test file is being added to the builtin package. The failures were caused by test workspace picking up new std dependencies through the builtin test variants, which were being handled like normal packages. Queries like completion or workspace symbols were affected, as they scan transitive imports. Ignore builtin test variants to fix the breakage. Change-Id: Ia1a99918b0bfb470c74470fa82e03e49fa460b06 Reviewed-on: https://go-review.googlesource.com/c/tools/+/621095 Reviewed-by: Alan Donovan <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent a199121 commit 8128bcf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

gopls/internal/cache/load.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,12 @@ func (s *Snapshot) load(ctx context.Context, allowNetwork bool, scopes ...loadSc
249249
s.setBuiltin(pkg.GoFiles[0])
250250
continue
251251
}
252+
if packagesinternal.GetForTest(pkg) == "builtin" {
253+
// We don't care about test variants of builtin. This caused test
254+
// failures in https://go.dev/cl/620196, when a test file was added to
255+
// builtin.
256+
continue
257+
}
252258
// Skip test main packages.
253259
if isTestMain(pkg, s.view.folder.Env.GOCACHE) {
254260
continue

0 commit comments

Comments
 (0)