Skip to content

Commit

Permalink
Merge pull request #19364 from ivanvc/improve-coverage-upload
Browse files Browse the repository at this point in the history
codecov: improve coverage upload
  • Loading branch information
serathius authored Feb 10, 2025
2 parents 38bb52a + 6c86654 commit e499f01
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
mkdir "${TARGET}"
case "${TARGET}" in
linux-amd64-coverage)
GOARCH=amd64 ./scripts/codecov_upload.sh
GOARCH=amd64 make upload-coverage-report
;;
*)
echo "Failed to find target"
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ test-e2e-release: build
test-robustness:
PASSES="robustness" ./scripts/test.sh $(GO_TEST_FLAGS)

.PHONY: test-coverage
test-coverage:
COVERDIR=covdir PASSES="build cov" ./scripts/test.sh $(GO_TEST_FLAGS)

.PHONY: upload-coverage-report
upload-coverage-report: test-coverage
./scripts/codecov_upload.sh

.PHONY: fuzz
fuzz:
./scripts/fuzzing.sh
Expand Down
11 changes: 1 addition & 10 deletions scripts/codecov_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,5 @@

set -o pipefail

LOG_FILE=${1:-test-coverage.log}

# We collect the coverage
COVERDIR=covdir PASSES='build cov' ./scripts/test.sh 2>&1 | tee "${LOG_FILE}"
test_success="$?"

# We try to upload whatever we have:
bash <(curl -s https://codecov.io/bash) -f ./covdir/all.coverprofile -cF all || exit 2

# Expose the original status of the test coverage execution.
exit ${test_success}
bash <(curl -s https://codecov.io/bash) -f ./covdir/all.coverprofile -cF all

0 comments on commit e499f01

Please sign in to comment.