提交 93c75321 作者: Jakub Sztandera

make: Replace json-to-junit with gotestsum

License: MIT
Signed-off-by: 's avatarJakub Sztandera <kubuxu@protonmail.ch>

License: MIT
Signed-off-by: 's avatarJakub Sztandera <kubuxu@protonmail.ch>
上级 86132458
......@@ -45,9 +45,14 @@ jobs:
- run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && curl -s https://codecov.io/bash > codecov
- run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && make -j 1 test/unit/gotest.junit.xml
- run: |
cd "$HOME/.go_workspace/src/$IMPORT_PATH" \
&& make -j 1 test/unit/gotest.junit.xml \
&& [[ ! $(jq -s -c 'map(select(.Action == "fail")) | .[]' test/unit/gotest.json) ]]
- run: cd "$HOME/.go_workspace/src/$IMPORT_PATH" && bash codecov -cF unittests -X search -f coverage/unit_tests.coverprofile
- run: mv "$HOME/.go_workspace/src/${IMPORT_PATH}/test/unit/gotest.junit.xml" /tmp/circleci-test-results
- run:
when: always
command: mv "$HOME/.go_workspace/src/${IMPORT_PATH}/test/unit/gotest.junit.xml" /tmp/circleci-test-results
- store_test_results:
path: /tmp/circleci-test-results
# Save artifacts
......
......@@ -109,5 +109,8 @@ require (
github.com/whyrusleeping/tar-utils v0.0.0-20180509141711-8c6c8ba81d5c
golang.org/x/sys v0.0.0-20190302025703-b6889370fb10
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
gopkg.in/cheggaaa/pb.v1 v1.0.28
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
gotest.tools/gotestsum v0.3.3
)
......@@ -26,6 +26,10 @@ $(d)/json-to-junit: test/dependencies/json-to-junit
$(go-build-relative)
TGTS_$(d) += $(d)/json-to-junit
$(d)/gotestsum:
$(call go-build,gotest.tools/gotestsum)
TGTS_$(d) += $(d)/gotestsum
$(d)/hang-fds:
$(call go-build,github.com/ipfs/hang-fds)
TGTS_$(d) += $(d)/hang-fds
......
......@@ -3,6 +3,7 @@
package tools
import (
_ "gotest.tools/gotestsum"
_ "github.com/multiformats/go-multihash/multihash"
_ "github.com/jbenet/go-random-files/random-files"
_ "github.com/ipfs/hang-fds"
......
......@@ -2,7 +2,7 @@ include mk/header.mk
CLEAN += $(d)/gotest.json $(d)/gotest.junit.xml
$(d)/gotest.junit.xml: clean test/bin/json-to-junit coverage/unit_tests.coverprofile
cat $(@D)/gotest.json | json-to-junit > $(@D)/gotest.junit.xml
$(d)/gotest.junit.xml: clean test/bin/gotestsum coverage/unit_tests.coverprofile
gotestsum --no-color --junitfile $@ --raw-command cat $(@D)/gotest.json
include mk/footer.mk
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论