-
Notifications
You must be signed in to change notification settings - Fork 341
[no-relnote] Enable CodeCov #958
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR enables CodeCov integration to track Go unit test coverage. It adds a new CodeCov upload step under the "test" job and makes minor adjustments to the GitHub Actions workflow configuration.
- Added CodeCov action in the "test" job.
- Configured environment variables for Go version extraction.
- Maintained setup consistency across testing and build steps.
Reviewed Changes
File | Description |
---|---|
.github/workflows/golang.yaml | Added CodeCov step for coverage reporting and adjusted version setup |
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
.github/workflows/golang.yaml:96
- The variable substitution operator differs from the one in the test job (':='). Consider using the consistent syntax ':=' for extracting GOLANG_VERSION unless the differing behavior is intentional.
echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION ?= }" >> $GITHUB_ENV
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
umm let's leave this for later on, we might need to move Go actions to hosted runners if we want to pass the secret during PR |
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GOLANG_VERSION }} | ||
|
||
- run: make test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we change this to make coverage
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it actually makes sense from the perspective of a Makefile file functionality; make coverage
would actually generate an output artifact. So I am not against it, I'll leave it as your call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need the coverage.out
artifact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it actually makes sense from the perspective of a Makefile file functionality; make coverage would actually generate an output artifact. So I am not against it, I'll leave it as your call
Sorry, I don't understand what you're saying here. We have two targets:
make test
make coverage
The first generates coverage.out
and the second filters out coverage related to mocks to generate a .no-mocks
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I was not aware of the make coverage
but for codecov
we need the output file from make test
.github/workflows/golang.yaml
Outdated
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.out | ||
fail_ci_if_error: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to block CI on an external system failing?
That's not true. Secrets are not available on PRs from forks, but should be available from the |
ture, I forgot about copy-pr-bot I was thinking in the old way o passing secrets. still will retake this PR after we cut the release |
/ok to test |
Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
Here's a look of how we would be able to visualize the results |
@tariq1890 if you like this, we could replace the |
@ArangoGutierrez as a general question, how does |
It is free for OSS repos. |
@elezar, any thoughts on this? |
Please confirm whether this can be run from a PR through the copy bot? You also have not answered by question as to how this compares to |
Here's a detailed comparison Comparison: Coveralls vs. Codecov (GitHub Actions – Code Coverage)
Summary:
References: |
@elezar PTAL |
This patch enables CodeCov to track or Go unit test coverage