.circleci: 改进test执行

避免go test执行两次

避免因push到codecov失败造成测试失败

  1457 @@ -10576,5 +10576,33 @@ yunion.io/x/onecloud/pkg/webconsole/comm
  1458  yunion.io/x/onecloud/pkg/webconsole/command/ssh_command.go:147:                        GetData
  1459  yunion.io/x/onecloud/pkg/webconsole/command/ssh_command.go:164:                        ShowInf
  1460  total:                                                                         (statements)
  1461 -Push /tmp/coverage.8mKa1lRFeG/profile.out to codecov.io^M
  1462 -Exited with code 7
  1463 \ No newline at end of file
  1464 +Push /tmp/coverage.GrWO8OlTrX/profile.out to codecov.io^M
  1465 +^M
  1466 +  _____          _^M
  1467 + / ____|        | |^M
  1468 +| |     ___   __| | ___  ___ _____   __^M
  1469 +| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /^M
  1470 +| |___| (_) | (_| |  __/ (_| (_) \ V /^M
  1471 + \_____\___/ \__,_|\___|\___\___/ \_/^M
  1472 +                              Bash-8a28df4^M
  1473 +^M
  1474 +^M
  1475 +==> Circle CI detected.^M
  1476 +    project root: .^M
  1477 +--> token set from env^M
  1478 +    Yaml found at: vendor/github.com/gin-gonic/gin/codecov.yml^M
  1479 +    -> Found 1 reports^M
  1480 +==> Detecting git/mercurial file structure^M
  1481 +==> Reading reports^M
  1482 +    + /tmp/coverage.GrWO8OlTrX/profile.out bytes=2221509^M
This commit is contained in:
Yousong Zhou
2019-07-15 03:42:46 +00:00
parent c5d6f425e1
commit 50a9bd8360
2 changed files with 5 additions and 5 deletions
+4 -2
View File
@@ -31,7 +31,7 @@ covermode=${COVERMODE:-atomic}
coverdir=$(mktemp -d /tmp/coverage.XXXXXXXXXX)
profile="${coverdir}/profile.out"
if [ -z "$pkgs" ]; then
pkgs="$(go list ./... | egrep -v 'host-image|hostimage')"
pkgs="$(go list -mod vendor ./... | grep -vE 'host-image|hostimage')"
fi
echo "mode: $covermode" >"$profile"
@@ -48,6 +48,8 @@ case "${1-}" in
go tool cover -html "$profile"
;;
--codecov)
push_to_codecov
if ! push_to_codecov; then
echo "ignored: push to codecov failed" >&2
fi
;;
esac