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

feat: use llvm-cov for coverage #478

Merged
merged 17 commits into from
Dec 7, 2022
Merged

Conversation

baszalmstra
Copy link
Collaborator

Use llvm-cov instead of tarpauling to compute coverage. LLVM-cov uses recently stabilized code coverage metrics emitted by the rust compiler. This also then works on Windows and MacOS and can be collected while running the regular tests.

I did have to change some tests to no longer use the name of the thread that is executing the tests. This is because that behavior (which was unstable in the first place) doesn't work with llvm-cov.

@baszalmstra baszalmstra requested a review from Wodann November 14, 2022 20:31
@baszalmstra baszalmstra self-assigned this Nov 14, 2022
Copy link
Collaborator

@Wodann Wodann left a comment

Choose a reason for hiding this comment

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

I'm curious to see whether there is a performance overhead compared to nextest

@codecov
Copy link

codecov bot commented Nov 16, 2022

Codecov Report

Merging #478 (5cf727d) into main (b475164) will increase coverage by 7.85%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #478      +/-   ##
==========================================
+ Coverage   79.31%   87.16%   +7.85%     
==========================================
  Files         256      271      +15     
  Lines       13496    29356   +15860     
==========================================
+ Hits        10704    25588   +14884     
- Misses       2792     3768     +976     
Impacted Files Coverage Δ
crates/mun_codegen/src/test.rs 99.58% <100.00%> (ø)
crates/mun_project/src/project_manifest.rs 70.73% <0.00%> (-29.27%) ⬇️
crates/mun_hir/src/ty/primitives.rs 44.29% <0.00%> (-24.46%) ⬇️
crates/mun_memory/src/type/ffi/struct.rs 76.79% <0.00%> (-15.35%) ⬇️
crates/mun_memory/src/gc.rs 85.71% <0.00%> (-14.29%) ⬇️
crates/mun_diagnostics/src/lib.rs 86.66% <0.00%> (-13.34%) ⬇️
crates/mun_hir/src/diagnostics.rs 65.13% <0.00%> (-11.60%) ⬇️
crates/mun_language_server/src/config.rs 88.88% <0.00%> (-11.12%) ⬇️
crates/mun_syntax/src/syntax_node.rs 77.50% <0.00%> (-10.00%) ⬇️
crates/mun_compiler/src/driver/config.rs 91.66% <0.00%> (-8.34%) ⬇️
... and 269 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@baszalmstra
Copy link
Collaborator Author

Looks like its working properly! Except on windows. I figured that llvm-cov is using another cargo profile which I have to make sure is also used during doctesting, otherwise the build will take much longer and disc space will run out.

@Wodann
Copy link
Collaborator

Wodann commented Nov 18, 2022

The dreaded out of storage issue is back 😢

Did you still have options to try to reduce storage usage? Can we split main tests vs example tests?

@baszalmstra
Copy link
Collaborator Author

The dreaded out of storage issue is back 😢

Did you still have options to try to reduce storage usage? Can we split main tests vs example tests?

Yeah! I already have an idea as outlined in the comment above!

@baszalmstra
Copy link
Collaborator Author

@Wodann It works! Finally!

@baszalmstra baszalmstra merged commit e14879c into mun-lang:main Dec 7, 2022
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