Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Add a coverage test #215

Merged
merged 12 commits into from
Oct 2, 2023
Merged

Add a coverage test #215

merged 12 commits into from
Oct 2, 2023

Conversation

dnkolegov
Copy link
Contributor

@dnkolegov dnkolegov commented Sep 29, 2023

This PR adds a simple tool to measure test coverage by running make coverage and running the same as a workflow on CI/CD.

The current threshold is 10 %. If the coverage of line, blocks, or functions is low, then the threshold then the workflow panics.

Screenshot 2023-09-29 at 11 38 16

Copy link
Contributor

@adlrocha adlrocha left a comment

Choose a reason for hiding this comment

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

This is really useful. Thanks!

Just a few questions:

  • The pipeline checks the coverage threshold for all the lines of code in the project, right? Not for the ones changed in the PRs. This means that before we enforce this check we should have a baseline threshold over the one we currently have because if not CI will always be unhappy. The issue with this is that if we set the threshold initially too low, new PRs may only cover that small threshold. In any case, this is useful, and we can merge and try to dedicate a sprint to improve coverage.
  • Also, I guess the new bindings included in the repo have been auto-generated, right? I am asking to understand if this may be an issue: Update rust binding #211 (review)

@adlrocha adlrocha mentioned this pull request Oct 2, 2023
@dnkolegov
Copy link
Contributor Author

The pipeline checks the coverage threshold for all the lines of code in the project, right?

Correct. I believe it is very easy to find that threshold, especially in our case. The main idea is to be sure we do not decrease the coverage by adding new code.

Also, I guess the new bindings included in the repo have been auto-generated, right?

Will fix.

@dnkolegov
Copy link
Contributor Author

dnkolegov commented Oct 2, 2023

Created an issue to track the coverage threshold consensus-shipyard/ipc#56

@dnkolegov dnkolegov merged commit 8ed3cb6 into dev Oct 2, 2023
5 checks passed
@dnkolegov dnkolegov deleted the covtest branch October 2, 2023 16:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants