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

Measure test coverage #9203

Open
JamieMagee opened this issue Mar 4, 2024 · 14 comments
Open

Measure test coverage #9203

JamieMagee opened this issue Mar 4, 2024 · 14 comments
Assignees
Labels
Batch How We Work: Feature. Outcome achieved within 1 iteration. Can live under an epic, or stand alone. EE Engineering Efficiency T: tech-debt ⚙️

Comments

@JamieMagee
Copy link
Contributor

Code improvement description

Test coverage is a simple measure of how much of the codebase has been tested. I think that setting specific coverage levels is not very helpful beyond a certain point, but it can help identify parts of the codebase that are poorly tested and may require more attention.

The most popular library for measuring code coverage in Ruby is simplecov.

@yeikel
Copy link
Contributor

yeikel commented Mar 5, 2024

Can you assign this to me?

@JamieMagee
Copy link
Contributor Author

@yeikel done. Thank you!

@smoookeeey
Copy link

Can you assign this to me?

@JamieMagee
Copy link
Contributor Author

@smoookeeey I assigned you too, but @yeikel asked to be assigned first. Please make sure you don't duplicate any work @yeikel might have already done.

@smoookeeey
Copy link

Yes I will make sure not too do that

@yeikel
Copy link
Contributor

yeikel commented Mar 5, 2024

I haven't started yet, and I won't have capacity until sometime next week. @smoookeeey, if you pick it up before that, feel free to create the PR and link it here

@smoookeeey
Copy link

I will look into it brother

@abdulapopoola
Copy link
Member

Thanks a lot @yeikel and @smoookeeey !

@abdulapopoola abdulapopoola added Batch How We Work: Feature. Outcome achieved within 1 iteration. Can live under an epic, or stand alone. and removed good first issue labels Mar 14, 2024
@JamieMagee
Copy link
Contributor Author

I just discovered that test coverage was previously added in #2576 to prevent a regression. Originally line coverage was set to 80% and branch coverage to 70%, with refuse_coverage_drop enabled to prevent any drops from occuring.

It was later gated behind the COVERAGE environment variable in #3339. However, because that environment variable wasn't set in GitHub Actions, code coverage was allowed to deteriorate. Subsequently, test coverage was removed in #7473.

@yeikel
Copy link
Contributor

yeikel commented Mar 16, 2024

I think that rather than enforcing a certain %, we can start reporting it for awareness

@JamieMagee
Copy link
Contributor Author

I agree. Reporting-only is a good start. Then something like refuse_coverage_drop to prevent backslides and act like a ratchet

@yeikel
Copy link
Contributor

yeikel commented Mar 25, 2024

@smoookeeey Are you still working on this? Feel free to create a draft PR whenever you're ready

@JamieMagee
Copy link
Contributor Author

@yeikel I think you can go ahead with this if you want.

@JamieMagee
Copy link
Contributor Author

@yeikel It didn't look like you were working on this, so I created #9595

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Batch How We Work: Feature. Outcome achieved within 1 iteration. Can live under an epic, or stand alone. EE Engineering Efficiency T: tech-debt ⚙️
Projects
None yet
Development

No branches or pull requests

4 participants