这是indexloc提供的服务,不要输入任何密码
Skip to content

chore: add unit test coverage reporter #10641

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

Merged
merged 17 commits into from
Jul 8, 2025
Merged

chore: add unit test coverage reporter #10641

merged 17 commits into from
Jul 8, 2025

Conversation

anthonyshew
Copy link
Contributor

@anthonyshew anthonyshew commented Jul 5, 2025

Description

I've been using LLMs to write code a lot lately and realized that it makes the cost of authoring a unit test significantly lower. It's been changing my opinion on how many unit tests/how much coverage we should have. If the cost of a test is dramatically cheaper, would we want to increase our coverage? Is it too extreme to say now we want 100%?

To that end, I just wanted to see what our coverage is today. This PR adds a quick and dirty reporter, just to see how things look. I don't think its useful to run it in CI or anything of that nature yet, until we form a clearer opinion about what I mentioned in the previous paragraph.

This implementation is based on https://doc.rust-lang.org/rustc/instrument-coverage.html.

Testing Instructions

Run the commands that have been added.

@anthonyshew anthonyshew requested a review from a team as a code owner July 5, 2025 17:40
Copy link

vercel bot commented Jul 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 2:05pm
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 2:05pm
examples-gatsby-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 2:05pm
examples-kitchensink-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 2:05pm
examples-native-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 2:05pm
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 2:05pm
examples-svelte-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 2:05pm
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 2:05pm
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 2:05pm
turbo-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 8, 2025 2:05pm

@anthonyshew anthonyshew changed the title shew/coverage chore: add unit test coverage reporter Jul 5, 2025
Copy link
Member

@chris-olszewski chris-olszewski left a comment

Choose a reason for hiding this comment

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

I would love to get warning: 1674 functions have mismatched data resolved as the branch coverage is really what we need to work on. The claimed 70.91% line coverage is too high.

anthonyshew and others added 5 commits July 8, 2025 08:01
Co-authored-by: Chris Olszewski <chris.olszewski@vercel.com>
Co-authored-by: Chris Olszewski <chris.olszewski@vercel.com>
Co-authored-by: Chris Olszewski <chris.olszewski@vercel.com>
@anthonyshew
Copy link
Contributor Author

warning: 1636 functions have mismatched data

This warning means that the report is over-reporting.Poking around I'm seeing issues like llvm/llvm-project#72786, meaning there might not be much we can do here beyond trying to change versions of toolchains and tools. ITG.

@anthonyshew anthonyshew merged commit 3b1c77d into main Jul 8, 2025
41 checks passed
@anthonyshew anthonyshew deleted the shew/coverage branch July 8, 2025 14:32
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.

2 participants