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

tests(nss/testutils): Update coverage generation and merging #105

Merged
merged 4 commits into from
Nov 20, 2023

Conversation

denisonbarbosa
Copy link
Member

Since Go 1.20, we now have more tools to handle coverage data and binary instrumentation so we should adapt our existing helpers to use those tools. By using them, we can simplify the code and reduce the maintenance load that was imposed by the old helpers.

Tests now should be run with the gotestcov script added in this PR. It runs the tests with all the required flags to enable coverage and runs additional commands to convert the Go raw coverage files to textfmt format, merge the Rust coverage into it and then show the results.

UDENG-1679

@denisonbarbosa denisonbarbosa marked this pull request as ready for review November 10, 2023 10:09
@denisonbarbosa denisonbarbosa requested a review from a team as a code owner November 10, 2023 10:09
gotestcov Show resolved Hide resolved
@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered ☂️

gotestcov Outdated Show resolved Hide resolved
Copy link
Member

@didrocks didrocks left a comment

Choose a reason for hiding this comment

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

Ok, this looks way cleaner and the direction we agreed upon!

I have a couple of comments on the CI + using the script itself.

Just a warning: I didn’t check the coverage result myself, do you mind attaching them in some way?

.github/workflows/qa.yaml Outdated Show resolved Hide resolved
.github/workflows/qa.yaml Outdated Show resolved Hide resolved
gotestcov Outdated Show resolved Hide resolved
@denisonbarbosa
Copy link
Member Author

Just a warning: I didn’t check the coverage result myself, do you mind attaching them in some way?

@didrocks Yeah, I thought codecov would already show us the report, but it needs to see the main coverage first.
I'll attach the coverage files (the textfmt files and the .html one) to this comment.
cover.zip

With the tools added in Go 1.20, some of the helpers we had aren't
necessary anymore so we can clean them up.
Coverage collection and merging will be done by our test script, so we
can clean the source code.
We already have this tool for a while now, but it was not a part of the
repository. Since some changes were made to it to update the way we
gather the coverage, it should be added to the repo (even if
temporarily)
We updated the way we collect the test coverage, so the CI workflow
should reflect this as well.
@denisonbarbosa denisonbarbosa merged commit e1710bb into main Nov 20, 2023
5 checks passed
@denisonbarbosa denisonbarbosa deleted the test-coverage-updates branch November 20, 2023 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants