Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github/workflows: remove coverage workflow #19424

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/coverage.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ 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
upload-coverage-report:
COVERDIR=covdir ./scripts/codecov_upload.sh

.PHONY: fuzz
fuzz:
Expand Down
12 changes: 9 additions & 3 deletions scripts/codecov_upload.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#!/usr/bin/env bash

# Script used to collect and upload test coverage (mostly by travis).
# Usage ./test_coverage_upload.sh [log_file]
# Script used to collect and upload test coverage.

set -o pipefail

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI. I saw an error related to this script in another PR,

'cov' PASSED and completed at Sat Feb 22 17:08:13 UTC 2025
              
SUCCESS
./scripts/codecov_upload.sh
/dev/fd/63: line 2: syntax error near unexpected token `<'
/dev/fd/63: line 2: `<html><head>'
make: *** [Makefile:67: upload-coverage-report] Error 2
+ EXIT_VALUE=2
+ set +o xtrace

Refer to https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/etcd-io_etcd/19426/pull-etcd-coverage-report/1893341510284349440

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is highly likely that Codecov answered with an HTTP error. We could try to add retries or just run a /retest (or vendorize the script, which I don't think is a good idea). The previous behavior was not to do any retrying, but it should be easy to implement this. Let me know your thoughts.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or vendorize the script,

I don't think it's a good idea either. We don't want to maintain/update it periodically.

The previous behavior was not to do any retrying, but it should be easy to implement this. Let me know your thoughts.

I think we should at least to avoid misleading error message. The error should be something like "failed to download the codecov script" instead of "syntax error near unexpected token `<'". Can we breakdown the one line script into multiple lines something like below,

curl -s https://codecov.io/bash -o codecov.sh
bash codecov.sh -f ./covdir/all.coverprofile -cF all

bash <(curl -s https://codecov.io/bash) -f "${COVERDIR}/all.coverprofile" \
-cF all \
-C "${PULL_PULL_SHA}" \
-r "${REPO_OWNER}/${REPO_NAME}" \
-P "${PULL_NUMBER}" \
-b "${BUILD_ID}" \
-B "${PULL_BASE_REF}" \
-N "${PULL_BASE_SHA}"
Loading