fix_: final coverage reports merging (#5384)

This commit is contained in:
Igor Sirotin 2024-06-19 17:57:44 +01:00 committed by GitHub
parent bd816f1e29
commit d00df557c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -114,6 +114,8 @@ fi
echo -e "${GRN}Testing HEAD:${RST} $(git rev-parse HEAD)"
rm -rf ./**/*.coverage.out
for package in ${UNIT_TEST_PACKAGES}; do
for ((i=1; i<=UNIT_TEST_COUNT; i++)); do
if ! is_parallelizable "${package}" || [[ "$UNIT_TEST_FAILFAST" == 'true' ]]; then
@ -132,9 +134,9 @@ for package in ${UNIT_TEST_PACKAGES}; do
done
# Gather test coverage results
rm -f c.out
echo "mode: atomic" > c.out
grep -h -v "^mode:" ./**/*.coverage.out >> c.out
rm -rf ./**/*.coverage.out
grep -r -h -v "^mode:" --include "*.coverage.out" >> c.out
if [[ $UNIT_TEST_REPORT_CODECLIMATE == 'true' ]]; then
# https://docs.codeclimate.com/docs/jenkins#jenkins-ci-builds

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -eu
coverage_file_path="${PACKAGE_DIR}/$(mktemp coverage.out.rerun.XXXXXXXXXX)"
coverage_file_path="$(mktemp coverage.out.rerun.XXXXXXXXXX --tmpdir="${PACKAGE_DIR}")"
go test -json \
-covermode=atomic \
-coverprofile="${coverage_file_path}" \