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

test: add code coverage reporting #1069

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

fmuyassarov
Copy link
Member

@fmuyassarov fmuyassarov commented Mar 1, 2023

Add code coverage reporting so that the report is then available to the PR author and reviewers via codecov GitHub app.

@marquiz for uploading/reporting the coverage results, we need to run make test. We already run the make test with one of the Prow job and I didn't want to add another one in the form of GitHub action. But GA is the most straightforward way of adding codecov and uploading it. There is an uploader available which can be executed from shell as well, so that can be added into Prow job run section, but for that codecov requires the token. We could store the token as a secret on GitHub but I don't know if there is a way actually for the Prow to ready/fetch that token. At least I have not seen anything like that.

With GitHub actions it is not a problem, because we just pass the ${{ secrets.CODECOV_TOKEN }} and voilà.

Do you have any other alternatives in mind or if not shall I go for adding another make test as GitHub action? I also thought that maybe we drop running unit tests from Prow to avoid duplication but Prow runs on much faster environment than what GitHub provides for free.

Fixes: #1033

Add code coverage reporting so that the report is then available
to the PR author and reviewers via codecov GitHub app.

Signed-off-by: Muyassarov, Feruzjon <[email protected]>
@netlify
Copy link

netlify bot commented Mar 1, 2023

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
🔨 Latest commit 82b388f
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-nfd/deploys/63ff4a2a0ca5930008169845
😎 Deploy Preview https://deploy-preview-1069--kubernetes-sigs-nfd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 1, 2023
@k8s-ci-robot k8s-ci-robot requested review from kad and zvonkok March 1, 2023 12:50
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 1, 2023
@fmuyassarov
Copy link
Member Author

@marquiz Actually from #1033, I see that you have already mentioned that we can add codecov token as a secret in the k8s test-infra cluster. Do you know what's the procedure for that?

Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

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

Thanks @fmuyassarov for working on this.

I think integrating it into prow/test-infra (instead of Github actions) would be the way to go, as you pondered

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 1, 2023
@fmuyassarov
Copy link
Member Author

fmuyassarov commented Mar 2, 2023

/cc @ArangoGutierrez

Just general update: we need to add a secret into the test infra k8s cluster and I'm in progress of reaching out the team responsible for that. Once done, I will submit another patch in the test-infra to add codecov report uploading steps.

@marquiz
Copy link
Contributor

marquiz commented Mar 2, 2023

Just general update: we need to add a secret into the test infra k8s cluster and I'm in progress of reaching out the team responsible for that. Once done, I will submit another patch in the test-infra to add codecov report uploading steps.

But this PR is not dependent on that

@fmuyassarov
Copy link
Member Author

Just general update: we need to add a secret into the test infra k8s cluster and I'm in progress of reaching out the team responsible for that. Once done, I will submit another patch in the test-infra to add codecov report uploading steps.

But this PR is not dependent on that

yes yes. It was just a heads up for Eduardo, because we discussed with you the plan in slack but not here.

@ArangoGutierrez
Copy link
Contributor

Just general update: we need to add a secret into the test infra k8s cluster and I'm in progress of reaching out the team responsible for that. Once done, I will submit another patch in the test-infra to add codecov report uploading steps.

But this PR is not dependent on that

yes yes. It was just a heads up for Eduardo, because we discussed with you the plan in slack but not here.

So... Can I lgtm? or wait?

@marquiz
Copy link
Contributor

marquiz commented Mar 6, 2023

So... Can I lgtm?

You can

Copy link
Contributor

@ArangoGutierrez ArangoGutierrez left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 7, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 9ed5916d3f727df86ca25f25154030a913ae89b8

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ArangoGutierrez, fmuyassarov, marquiz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 9e55028 into kubernetes-sigs:master Mar 7, 2023
@fmuyassarov fmuyassarov deleted the codecov branch March 7, 2023 15:00
@marquiz marquiz mentioned this pull request Apr 12, 2023
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable codecov reporting
4 participants