go/refactor/importgraph
Bryan C. Mills 1fd30d290b refactor/importgraph: set env from packagestest.Export and check errors from Build
This test was written for GOPATH mode, and subsequently updated to use
packagestest at a time when GO111MODULE defaulted to "auto" (in this
case, off). As a result, the test was failing to set environment
variables relevant to the test, such as GO111MODULE=off.

The missing environment was causing errors that were subsequently
masked by a missing error check: the errors returned by
importgraph.Build were only read in an "if false" block.

This CL adds the missing environment variables and error checks. Using
the correct environment may or may not fix the observed test failures.

For golang/go#37823

Change-Id: I75844e6fdf47222aa4f953c8c4fbcc93cec606c9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/367846
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-11-30 22:42:17 +00:00
..
graph.go refactor/importgraph: document that graphs are cyclic 2016-03-03 22:47:59 +00:00
graph_test.go refactor/importgraph: set env from packagestest.Export and check errors from Build 2021-11-30 22:42:17 +00:00