-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
ci: update to Go 1.16.6 on CI #8324
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 10 commits
339fb46
bf4cf14
a9dfe38
7f2630b
9d6cbdf
b5f5419
f0ae6e3
98d2739
db2684f
d346840
5c0061e
c1339c8
4ebec49
3a7eaaf
c40f8d1
e162f1a
b3f1d65
ef1703c
679c004
70b3882
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 |
---|---|---|
|
@@ -33,7 +33,7 @@ default_environment: &default_environment | |
executors: | ||
golang: | ||
docker: | ||
- image: circleci/golang:1.15.2 | ||
- image: cimg/go:1.16.6 | ||
working_directory: ~/ipfs/go-ipfs | ||
environment: | ||
<<: *default_environment | ||
|
@@ -58,7 +58,7 @@ executors: | |
E2E_IPFSD_TYPE: go | ||
dockerizer: | ||
docker: | ||
- image: circleci/golang:1.15.2 | ||
- image: cimg/go:1.16.6 | ||
environment: | ||
IMAGE_NAME: ipfs/go-ipfs | ||
WIP_IMAGE_TAG: wip | ||
|
@@ -126,6 +126,12 @@ jobs: | |
TEST_VERBOSE: 1 | ||
steps: | ||
- run: sudo apt update | ||
- run: | | ||
mkdir ~/localgo && cd ~/localgo | ||
wget https://golang.org/dl/go1.16.6.linux-amd64.tar.gz | ||
tar xfz go1.16.6.linux-amd64.tar.gz | ||
echo "export PATH=$(pwd)/go/bin:$PATH" >> $BASH_ENV | ||
- run: go version | ||
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's the reason why we're doing this/what happens when we don't? Is this because the machine executor doesn't have the same version of Go as the golang ones? 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. Good question, this might be unnecessary code, it was carried over from #8138. Let me dig deeper. 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. Yeah this is required because the sharness test is using an Ubuntu image which is on Go 1.15.2, not the Go image. |
||
- run: sudo apt install socat net-tools | ||
- checkout | ||
|
||
|
@@ -151,7 +157,6 @@ jobs: | |
- run: | ||
echo TEST_DOCKER_HOST=$TEST_DOCKER_HOST && | ||
make -O -j 3 coverage/sharness_tests.coverprofile test/sharness/test-results/sharness.xml TEST_GENERATE_JUNIT=1 CONTINUE_ON_S_FAILURE=1 TEST_DOCKER_HOST=$TEST_DOCKER_HOST | ||
|
||
- run: | ||
when: always | ||
command: bash <(curl -s https://codecov.io/bash) -cF sharness -X search -f coverage/sharness_tests.coverprofile | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Note: when updating the go minor version here, also update the go-channel in snap/snapcraft.yml | ||
FROM golang:1.15.2-buster | ||
FROM golang:1.16.6-buster | ||
LABEL maintainer="Steven Allen <[email protected]>" | ||
|
||
# Install deps | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,17 +9,15 @@ | |
# use the ipfs tool to test against | ||
|
||
# add current directory to path, for ipfs tool. | ||
if test "$MAKE_SKIP_PATH" != "1"; then | ||
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 changed with 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'm not sure exactly why this fixes it. Presumably something somewhere else has a side efffect of setting the PATH so that it contains the correct ipfs binary for the test, which is what the sharness tests were implicitly relying on. Something changed with 1.16 such that the ipfs binary is no longer found in the PATH. I spent a few hours trying to find where, unsuccessfully. I couldn't find any rationale for MAKE_SKIP_PATH and the tests pass when I disable it, b/c PATH is setup correctly before each test run (pointing to the coverage binary). 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'm not totally sure, but I think the idea here is that you can locally run sharness tests on your machine from the sharness test folder without causing weird issues. Could you double check those work. It seems like removing that flag shouldn't change anything (we set it to 1 in the makefile and then check if it equals 1).
What was failing before and with which code changes? You've also changed a couple commands here (e.g. from 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 did figure this out finally. It was due to this:
(link) That writes a PATH env var to BASH_ENV, and BASH_ENV is inherited by every subshell, so every time a subshell is run, Bash applies env vars in BASH_ENV which overwrite whatever PATH was inherited from the parent process, which means setting PATH in any Makefile (or any other env in BASH_ENV) is silently ignored. (Setting PATH with BASH_ENV is what CircleCI docs recommend....) |
||
BIN=$(cd .. && echo `pwd`/bin) | ||
BIN2=$(cd ../.. && echo `pwd`/cmd/ipfs) | ||
PATH=${BIN2}:${BIN}:${PATH} | ||
|
||
# assert the `ipfs` we're using is the right one. | ||
if test `which ipfs` != ${BIN2}/ipfs; then | ||
echo >&2 "Cannot find the tests' local ipfs tool." | ||
echo >&2 "Please check test and ipfs tool installation." | ||
exit 1 | ||
fi | ||
BIN=$(cd .. && pwd)/bin | ||
BIN2=$(cd ../.. && pwd)/cmd/ipfs | ||
PATH=${BIN2}:${BIN}:${PATH} | ||
|
||
# assert the `ipfs` we're using is the right one. | ||
if test "$(which ipfs)" != "${BIN2}/ipfs"; then | ||
echo >&2 "Cannot find the tests' local ipfs tool." | ||
echo >&2 "Please check test and ipfs tool installation." | ||
exit 1 | ||
fi | ||
|
||
# set sharness verbosity. we set the env var directly as | ||
|
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.
Should be 1.16.7