diff --git a/.circleci/config.yml b/.circleci/config.yml index a903d98972..19e5860f6a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,9 +49,7 @@ jobs: - run: name: unit_test command: | - pkgs="$((go list -mod vendor ./... || true) | grep -vE '/(host-image|hostimage)\>' | circleci tests split)" - go test -v -mod vendor -ldflags '-w' $pkgs - pkgs="$pkgs" ./scripts/coverage.sh --codecov + ./scripts/coverage.sh --codecov - save_cache: key: onecloud-test-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }} paths: diff --git a/scripts/coverage.sh b/scripts/coverage.sh index 766014aa82..b108ecbe7e 100755 --- a/scripts/coverage.sh +++ b/scripts/coverage.sh @@ -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