From 28dd2f65d6189427eab0e0d19dbf44d733210504 Mon Sep 17 00:00:00 2001 From: BradAF Date: Tue, 5 Mar 2019 17:25:57 +0000 Subject: [PATCH 1/4] Updated Makefile test to enable GO111MODULE=on for dev and test secions. See https://github.com/lightningnetwork/lnd/issues/2612 for similar issue. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d92fec42aec9..5fb70bb32102 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ bin: fmtcheck generate # dev creates binaries for testing Terraform locally. These are put # into ./bin/ as well as $GOPATH/bin dev: fmtcheck generate - go install -mod=vendor . + GO111MODULE=on go install -mod=vendor . quickdev: generate go install -mod=vendor . @@ -32,7 +32,7 @@ plugin-dev: generate # we run this one package at a time here because running the entire suite in # one command creates memory usage issues when running in Travis-CI. test: fmtcheck generate - go list -mod=vendor $(TEST) | xargs -t -n4 go test $(TESTARGS) -mod=vendor -timeout=2m -parallel=4 + GO111MODULE=on go list -mod=vendor $(TEST) | GO111MODULE=on xargs -t -n4 go test $(TESTARGS) -mod=vendor -timeout=2m -parallel=4 # testacc runs acceptance tests testacc: fmtcheck generate From eb008d1fda8a5b325793f4824d6633be1396ea8e Mon Sep 17 00:00:00 2001 From: BradAF Date: Tue, 5 Mar 2019 17:51:26 +0000 Subject: [PATCH 2/4] Updated command/init_test.go function TestInit_fromModule_explicitDest changed: err := os.MkdirAll(dir, os.ModePerm) added: defer os.RemoveAll(dir) defer testChdir(t, dir)() --- command/init_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/command/init_test.go b/command/init_test.go index c0a198452932..308fa903b2fe 100644 --- a/command/init_test.go +++ b/command/init_test.go @@ -67,7 +67,10 @@ func TestInit_multipleArgs(t *testing.T) { func TestInit_fromModule_explicitDest(t *testing.T) { dir := tempDir(t) - err := os.Mkdir(dir, os.ModePerm) + err := os.MkdirAll(dir, os.ModePerm) + defer os.RemoveAll(dir) + defer testChdir(t, dir)() + if err != nil { t.Fatal(err) } From fbdeb7d63bc0cdd2cab99613d77efe5182fcf45a Mon Sep 17 00:00:00 2001 From: BradAF Date: Tue, 5 Mar 2019 17:56:13 +0000 Subject: [PATCH 3/4] Updated plugin/discovery/get_test.go: Changed lines 173 and 178 with wrong type of %q to %v --- plugin/discovery/get_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/discovery/get_test.go b/plugin/discovery/get_test.go index 84dd686504c4..3cd669218195 100644 --- a/plugin/discovery/get_test.go +++ b/plugin/discovery/get_test.go @@ -170,12 +170,12 @@ func TestVersionListing(t *testing.T) { } if len(versions) != len(expected) { - t.Fatalf("Received wrong number of versions. expected: %q, got: %q", expected, versions) + t.Fatalf("Received wrong number of versions. expected: %v, got: %v", expected, versions) } for i, v := range versions { if v.Version != expected[i].Version { - t.Fatalf("incorrect version: %q, expected %q", v, expected[i]) + t.Fatalf("incorrect version: %v, expected %v", v, expected[i]) } } } From 1ca7b3f2889669ca23e9457f16aaf014b2f0e399 Mon Sep 17 00:00:00 2001 From: BradAF Date: Tue, 5 Mar 2019 18:02:19 +0000 Subject: [PATCH 4/4] Updated registry/client_test.go: Changed line 235 with wrong type of %q to %v --- registry/client_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/client_test.go b/registry/client_test.go index 0796f5f33a8e..5ed651f6b33a 100644 --- a/registry/client_test.go +++ b/registry/client_test.go @@ -232,7 +232,7 @@ func TestLookupProviderVersions(t *testing.T) { for _, v := range resp.Versions { _, err := version.NewVersion(v.Version) if err != nil { - t.Fatalf("invalid version %q: %s", v, err) + t.Fatalf("invalid version %v: %s", v, err) } } }