@@ -32,11 +32,12 @@ default_environment: &default_environment
3232 CIRCLE_TEST_REPORTS : /tmp/circleci-test-results
3333 CIRCLE_ARTIFACTS : /tmp/circleci-artifacts
3434 GIT_PAGER : cat
35+ IPFS_CHECK_RCMGR_DEFAULTS : 1
3536
3637executors :
3738 golang :
3839 docker :
39- - image : cimg/go:1.16.15
40+ - image : cimg/go:1.18.3
4041 working_directory : ~/ipfs/go-ipfs
4142 environment :
4243 << : *default_environment
@@ -61,14 +62,15 @@ executors:
6162 E2E_IPFSD_TYPE : go
6263 dockerizer :
6364 docker :
64- - image : cimg/go:1.16.15
65+ - image : cimg/go:1.18.3
6566 environment :
6667 IMAGE_NAME : ipfs/go-ipfs
6768 WIP_IMAGE_TAG : wip
6869
6970jobs :
7071 gobuild :
7172 executor : golang
73+ resource_class : 2xlarge+
7274 steps :
7375 - checkout
7476 - *make_out_dirs
@@ -106,7 +108,10 @@ jobs:
106108 command : bash <(curl -s https://codecov.io/bash) -cF unittests -X search -f coverage/unit_tests.coverprofile
107109 - run :
108110 command : |
109- # we want to test the examples against the current version of go-ipfs
111+ # we want to first test with the go-ipfs in the go.mod file
112+ go test -v ./...
113+
114+ # we also want to test the examples against the current version of go-ipfs
110115 # however, that version might be in a fork so we need to replace the dependency
111116
112117 # backup the go.mod and go.sum files to restore them after we run the tests
@@ -116,11 +121,18 @@ jobs:
116121 # make sure the examples run against the current version of go-ipfs
117122 go mod edit -replace github.com/ipfs/go-ipfs=./../../..
118123 go mod tidy
124+
125+ # use the internal config package when we test the current version of go-ipfs
126+ sed -i.bak 's;"github.com/ipfs/go-ipfs-config";"github.com/ipfs/go-ipfs/config";' ./main.go
127+
119128 go test -v ./...
120129
121130 # restore the go.mod and go.sum files to their original state
122131 mv go.mod.bak go.mod
123132 mv go.sum.bak go.sum
133+
134+ # restore the main.go to its original state
135+ mv main.go.bak main.go
124136 working_directory : ~/ipfs/go-ipfs/docs/examples/go-ipfs-as-a-library
125137
126138 - run :
@@ -143,15 +155,15 @@ jobs:
143155 working_directory : ~/ipfs/go-ipfs
144156 environment :
145157 << : *default_environment
146- TEST_NO_DOCKER : 1
158+ TEST_NO_DOCKER : 0
147159 TEST_NO_FUSE : 1
148160 TEST_VERBOSE : 1
149161 steps :
150162 - run : sudo apt update
151163 - run : |
152164 mkdir ~/localgo && cd ~/localgo
153- wget https://golang.org/dl/go1.16.15 .linux-amd64.tar.gz
154- tar xfz go1.16.15 .linux-amd64.tar.gz
165+ wget https://golang.org/dl/go1.18.3 .linux-amd64.tar.gz
166+ tar xfz go1.18.3 .linux-amd64.tar.gz
155167 echo "export PATH=$(pwd)/go/bin:\$PATH" >> ~/.bashrc
156168 - run : go version
157169 - run : sudo apt install socat net-tools
@@ -166,7 +178,7 @@ jobs:
166178 git checkout FETCH_HEAD
167179 - run :
168180 cd rb-pinning-service-api &&
169- docker-compose pull &&
181+ (for i in {1..3}; do docker-compose pull && break || sleep 5; done) &&
170182 docker-compose up -d
171183
172184 - *make_out_dirs
@@ -217,33 +229,43 @@ jobs:
217229 - *store_gomod
218230 interop :
219231 docker :
220- - image : cimg/go:1.16 -node
232+ - image : cimg/go:1.18.3 -node
221233 parallelism : 4
234+ resource_class : large
222235 steps :
223236 - *make_out_dirs
224237 - attach_workspace :
225238 at : /tmp/circleci-workspace
239+ - restore_cache :
240+ keys :
241+ - v1-interop-{{ .Branch }}-{{ .Revision }}
242+ - v1-interop-{{ .Branch }}-
243+ - v1-interop-
226244 - run :
227245 name : Installing dependencies
228246 command : |
229247 npm init -y
230248 npm install ipfs@^0.61.0
231- npm install ipfs-interop@^8.0.0
249+ npm install ipfs-interop@^8.0.10
232250233251 working_directory : ~/ipfs/go-ipfs/interop
234252 - run :
235253 name : Running tests
236254 command : |
237255 mkdir -p /tmp/test-results/interop/
238256 export MOCHA_FILE="$(mktemp /tmp/test-results/interop/unit.XXXXXX.xml)"
239- npx ipfs-interop -- -t node -f $(sed -n -e "s|^require( '\(.*\)') $|test/\1|p" node_modules/ipfs-interop/test/node.js | circleci tests split) -- --reporter mocha-circleci-reporter
257+ npx ipfs-interop -- -t node -f $(sed -n -e "s|^import '\(.*\)'$|test/\1|p" node_modules/ipfs-interop/test/node.js | circleci tests split --split-by=timings ) -- --reporter mocha-circleci-reporter
240258 working_directory : ~/ipfs/go-ipfs/interop
241259 environment :
242260 LIBP2P_TCP_REUSEPORT : false
243261 LIBP2P_ALLOW_WEAK_RSA_KEYS : 1
244262 IPFS_GO_EXEC : /tmp/circleci-workspace/bin/ipfs
245263 - store_test_results :
246264 path : /tmp/test-results
265+ - save_cache :
266+ key : v1-interop-{{ .Branch }}-{{ .Revision }}
267+ paths :
268+ - ~/ipfs/go-ipfs/interop/node_modules
247269 go-ipfs-api :
248270 executor : golang
249271 steps :
@@ -271,7 +293,7 @@ jobs:
271293 - v1-go-api-{{ checksum "~/ipfs/go-ipfs/go-ipfs-api/go.sum" }}
272294 - v1-go-api-
273295 - run :
274- command : go test -v ./...
296+ command : go test -count=1 - v ./...
275297 working_directory : ~/ipfs/go-ipfs/go-ipfs-api
276298 - save_cache :
277299 key : v1-go-api-{{ checksum "~/ipfs/go-ipfs/go-ipfs-api/go.sum" }}
@@ -292,18 +314,15 @@ jobs:
292314 command : |
293315 git clone https://github.com/ipfs/go-ipfs-http-client.git
294316 git -C go-ipfs-http-client log -1
295- cd go-ipfs-http-client
296- git checkout v0.2.0
297- cd ..
298317 - restore_cache :
299318 keys :
300319 - v1-http-client-{{ checksum "~/ipfs/go-ipfs/go-ipfs-http-client/go.sum" }}
301320 - v1-http-client-
302321 - run :
303- name : go test -v ./...
322+ name : go test -count=1 - v ./...
304323 command : |
305324 export PATH=/tmp/circleci-workspace/bin:$PATH
306- go test -v ./...
325+ go test -count=1 - v ./...
307326 working_directory : ~/ipfs/go-ipfs/go-ipfs-http-client
308327 - save_cache :
309328 key : v1-http-client-{{ checksum "~/ipfs/go-ipfs/go-ipfs-http-client/go.sum" }}
@@ -329,6 +348,7 @@ jobs:
329348 name : Installing dependencies
330349 command : |
331350 npm install
351+ npx playwright install
332352 working_directory : ~/ipfs/go-ipfs/ipfs-webui
333353 - run :
334354 name : Running upstream tests (finish early if they fail)
@@ -344,6 +364,7 @@ jobs:
344364 - save_cache :
345365 key : v1-ipfs-webui-{{ checksum "~/ipfs/go-ipfs/ipfs-webui/package-lock.json" }}
346366 paths :
367+ - ~/.cache/ms-playwright
347368 - ~/ipfs/go-ipfs/ipfs-webui/node_modules
348369 # We only run build as a test here. DockerHub images are built and published
349370 # by Github Action now: https://github.com/ipfs/go-ipfs/pull/8467
0 commit comments