-
Notifications
You must be signed in to change notification settings - Fork 816
Set go version to 1.14, to enable vendor builds by default. #2749
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
Changes from 3 commits
6dd9348
663e0ef
10ab21a
e1ec275
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/cortexproject/cortex | ||
|
||
go 1.13 | ||
go 1.14 | ||
|
||
require ( | ||
cloud.google.com/go/bigtable v1.2.0 | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -104,6 +104,7 @@ run_test() { | |||||||||||
local dir=$1 | ||||||||||||
if [ -z "$NO_GO_GET" ]; then | ||||||||||||
go get -t -tags "${TAGS[@]}" "$dir" | ||||||||||||
go mod vendor # re-vendor everything | ||||||||||||
fi | ||||||||||||
|
||||||||||||
local GO_TEST_ARGS_RUN=("${GO_TEST_ARGS[@]}") | ||||||||||||
|
@@ -147,6 +148,8 @@ fi | |||||||||||
|
||||||||||||
if [ -n "$SLOW" ] && [ -z "$COVERDIR" ]; then | ||||||||||||
go get github.com/weaveworks/tools/cover | ||||||||||||
go mod vendor # re-vendor everything | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about putting the Lines 19 to 23 in b64dabe
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will send PR to include cover tool in build image. |
||||||||||||
|
||||||||||||
cover "$coverdir"/* >profile.cov | ||||||||||||
rm -rf "$coverdir" | ||||||||||||
go tool cover -html=profile.cov -o=coverage.html | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why we need to run
go mod vendor
in this file?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason is to avoid error when go get fetches additional depedendency, but doesn’t put it into vendor. In go 1.14, if you have vendor directory, it is used by default, but vendor/modules.txt is verified against go.mod. Without calling go mod vendor here, that verification fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer if our test didn’t do additional go get, but I’m not sure why it’s here, so left it for now.
In case of cover tool later in the file, I think that should be part of the build image instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we remove the
-go-get
and-no-go-get
support at all, always enforcing the behaviour ofNO_GO_GET=true
(current default)?-go-get
is not used by any script we have, so the only way to use it is to manually calltools/test -go-get
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove it. This doesn't fix problem with
cover
tool, used when run under CIRCLECI.