Skip to content

Commit

Permalink
gopls: set GOWORK=off for loads from debug and safetoken tests
Browse files Browse the repository at this point in the history
Using -mod=mod when calling go/packages.Load causes tests to fail when
GOWORK is set, so set GOWORK=off explicitly.

Change-Id: I3b25bd7042c23bfe10223cb466a10e1accaf2ba0
Reviewed-on: https://go-review.googlesource.com/c/tools/+/493615
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
  • Loading branch information
findleyr committed May 8, 2023
1 parent c93329a commit d5af889
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions gopls/internal/lsp/safetoken/safetoken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func TestGoplsSourceDoesNotCallTokenFileMethods(t *testing.T) {
cfg.Env = os.Environ()
cfg.Env = append(cfg.Env,
"GOPACKAGESDRIVER=off",
"GOWORK=off", // necessary for -mod=mod below
"GOFLAGS=-mod=mod",
)

Expand Down
1 change: 1 addition & 0 deletions gopls/test/debug/debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestTemplates(t *testing.T) {
cfg.Env = os.Environ()
cfg.Env = append(cfg.Env,
"GOPACKAGESDRIVER=off",
"GOWORK=off", // necessary for -mod=mod below
"GOFLAGS=-mod=mod",
)

Expand Down

0 comments on commit d5af889

Please sign in to comment.