]> Cypherpunks repositories - gostls13.git/commitdiff
go/build: set GO111MODULE=off explicitly in TestImportVendor*
authorBryan C. Mills <bcmills@google.com>
Thu, 28 Feb 2019 21:47:17 +0000 (16:47 -0500)
committerBryan C. Mills <bcmills@google.com>
Fri, 1 Mar 2019 16:27:27 +0000 (16:27 +0000)
These tests check for GOPATH-mode vendoring behavior, so make sure
they're in GOPATH mode.

Updates #30228

Change-Id: I646f59b67cb76dacd07adc3f6ed15ed63f4e22a4
Reviewed-on: https://go-review.googlesource.com/c/164620
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/go/build/build_test.go

index db8b12eabf83c32952adc1cef8980f2b7241f2d7..cfcb8167a1abfb25222e94a8b8b8cfd75ca37523 100644 (file)
@@ -350,6 +350,10 @@ func TestImportDirNotExist(t *testing.T) {
 
 func TestImportVendor(t *testing.T) {
        testenv.MustHaveGoBuild(t) // really must just have source
+
+       defer os.Setenv("GO111MODULE", os.Getenv("GO111MODULE"))
+       os.Setenv("GO111MODULE", "off")
+
        ctxt := Default
        wd, err := os.Getwd()
        if err != nil {
@@ -368,6 +372,10 @@ func TestImportVendor(t *testing.T) {
 
 func TestImportVendorFailure(t *testing.T) {
        testenv.MustHaveGoBuild(t) // really must just have source
+
+       defer os.Setenv("GO111MODULE", os.Getenv("GO111MODULE"))
+       os.Setenv("GO111MODULE", "off")
+
        ctxt := Default
        wd, err := os.Getwd()
        if err != nil {
@@ -387,6 +395,10 @@ func TestImportVendorFailure(t *testing.T) {
 
 func TestImportVendorParentFailure(t *testing.T) {
        testenv.MustHaveGoBuild(t) // really must just have source
+
+       defer os.Setenv("GO111MODULE", os.Getenv("GO111MODULE"))
+       os.Setenv("GO111MODULE", "off")
+
        ctxt := Default
        wd, err := os.Getwd()
        if err != nil {