Skip to content

Commit

Permalink
gopls/internal/cache: add tolerance for builtin test variants
Browse files Browse the repository at this point in the history
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 <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
  • Loading branch information
findleyr committed Oct 18, 2024
1 parent a199121 commit 8128bcf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gopls/internal/cache/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ func (s *Snapshot) load(ctx context.Context, allowNetwork bool, scopes ...loadSc
s.setBuiltin(pkg.GoFiles[0])
continue
}
if packagesinternal.GetForTest(pkg) == "builtin" {
// We don't care about test variants of builtin. This caused test
// failures in https://go.dev/cl/620196, when a test file was added to
// builtin.
continue
}
// Skip test main packages.
if isTestMain(pkg, s.view.folder.Env.GOCACHE) {
continue
Expand Down

0 comments on commit 8128bcf

Please sign in to comment.