Skip to content

Commit fd47d1b

Browse files
authored
Merge pull request #19447 from k8s-infra-cherrypick-robot/cherry-pick-19364-to-release-3.6
[release-3.6] codecov: improve coverage upload
2 parents 0e40f37 + db62c7c commit fd47d1b

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

.github/workflows/coverage.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
mkdir "${TARGET}"
2626
case "${TARGET}" in
2727
linux-amd64-coverage)
28-
GOARCH=amd64 ./scripts/codecov_upload.sh
28+
GOARCH=amd64 make upload-coverage-report
2929
;;
3030
*)
3131
echo "Failed to find target"

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ test-e2e-release: build
5858
test-robustness:
5959
PASSES="robustness" ./scripts/test.sh $(GO_TEST_FLAGS)
6060

61+
.PHONY: test-coverage
62+
test-coverage:
63+
COVERDIR=covdir PASSES="build cov" ./scripts/test.sh $(GO_TEST_FLAGS)
64+
65+
.PHONY: upload-coverage-report
66+
upload-coverage-report: test-coverage
67+
./scripts/codecov_upload.sh
68+
6169
.PHONY: fuzz
6270
fuzz:
6371
./scripts/fuzzing.sh

scripts/codecov_upload.sh

+1-10
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,5 @@
55

66
set -o pipefail
77

8-
LOG_FILE=${1:-test-coverage.log}
9-
10-
# We collect the coverage
11-
COVERDIR=covdir PASSES='build cov' ./scripts/test.sh 2>&1 | tee "${LOG_FILE}"
12-
test_success="$?"
13-
148
# We try to upload whatever we have:
15-
bash <(curl -s https://codecov.io/bash) -f ./covdir/all.coverprofile -cF all || exit 2
16-
17-
# Expose the original status of the test coverage execution.
18-
exit ${test_success}
9+
bash <(curl -s https://codecov.io/bash) -f ./covdir/all.coverprofile -cF all

0 commit comments

Comments
 (0)