Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove -i from 'go test' to allow running unit tests locally with go 1.11.x and GO111MODULE=on #202

Merged
merged 1 commit into from Feb 5, 2019

Conversation

pdecat
Copy link
Contributor

@pdecat pdecat commented Feb 5, 2019

With GO111MODULE=on, running tests locally fail:

# make test
==> Checking that code complies with gofmt requirements...
go test -i $(go list ./... |grep -v 'vendor') || exit 1
go test golang_org/x/crypto/cryptobyte/asn1: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/crypto/cryptobyte/asn1.a: permission denied
go test golang_org/x/net/dns/dnsmessage: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/net/dns/dnsmessage.a: permission denied
go test golang_org/x/crypto/curve25519: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/crypto/curve25519.a: permission denied
go test golang_org/x/crypto/internal/chacha20: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/crypto/internal/chacha20.a: permission denied
go test golang_org/x/crypto/poly1305: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/crypto/poly1305.a: permission denied
go test golang_org/x/text/transform: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/text/transform.a: permission denied
go test golang_org/x/net/http2/hpack: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/net/http2/hpack.a: permission denied
go test golang_org/x/text/unicode/bidi: open /usr/local/go/pkg/linux_amd64/vendor/golang_org/x/text/unicode/bidi.a: permission denied
make: *** [GNUmakefile:25: test] Error 1

The fix will be in go 1.12: golang/go#27285

But won't be backported to go 1.11:

This has a simple workaround (stop using -i) and the fix is invasive (renaming src/vendor), so probably not worth backporting.

cf. golang/go#27389 (comment)

cc @alexsomesan

@ghost ghost added the size/XS label Feb 5, 2019
@pdecat
Copy link
Contributor Author

pdecat commented Feb 5, 2019

I've just checked and there's the same issue with terraform-provider-kubernetes.

terraform-provider-aws does not have the -i: https://github.com/terraform-providers/terraform-provider-aws/blob/master/GNUmakefile#L14

Copy link
Member

@alexsomesan alexsomesan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This didn't manifest for me because my GOROOT is under $HOME on my machine (installed via asdf).

@pdecat
Copy link
Contributor Author

pdecat commented Feb 5, 2019

FWIW, I install golang on Ubuntu with godeb hence the restricted path.

@hashicorp hashicorp locked and limited conversation to collaborators Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants