-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Test Coverage Reporting #14343
Test Coverage Reporting #14343
Conversation
d6198ed
to
2149314
Compare
@josevalim Do you have any preference on how to deal with the (See https://github.com/elixir-lang/elixir/actions/runs/13929976188/job/38984368756?pr=14343) |
@maennchen probably the best option is to check if coverage is enabled and perform only a partial assertion (i.e. break this assertion in two), the second one wrapped by a conditional. |
@josevalim Ok, I will do that. Do you btw. know the reason why this doesn't work while cover compiled? |
2149314
to
943b7be
Compare
We traverse the stored ast when analyzing the error message but when cover compiling the information is lost. |
943b7be
to
a4e7a7b
Compare
@josevalim I got it down to one test failure:
The |
@maennchen i would have to investigate locally which order is being printed. It seems it was supposed to be alphabetical. |
e4420f0
to
64f4c8d
Compare
8d07aca
to
66ee072
Compare
Splitting PR into multiple PRs. Marking as draft until done. |
66ee072
to
e190fad
Compare
4ce9a07
to
0901ddd
Compare
642dfde
to
b325ae0
Compare
cover/ex_unit_elixir.coverdata: | ||
$(Q) COVER="1" $(MAKE) test_stdlib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a left-over?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is intentionally as a dependency of the cover
target.
The idea is that you can call make cover
and it will run all the tests with coverage. (I tried to make it simple for non-regular contributors as well to get the coverage report.)
17cee14
to
582ffec
Compare
Thank you, codewise, this looks good. We just need to improve the quality of the report a bit. For this PR, I think the only thing we need to do is to exclude deprecated modules from the report. Is this possible? In theory we should be able to filter by this:
But I don't know if the best moment is when running tests or when assembling coverage. I would also skip the The other tests we should improve the coverage through separate pull requests. What are your thoughts? |
On Deprecation: I'm trying it out. I would directly exclude them from cover compiling. At that stage I should still have access to the unmodified AST including docs. On the Kernel: Looking through the HTML, I think it still valuable to include it in the reporting. Stuff like this is helpful when writing tests and the coverage is at 80% which isn't that low.: However with I would however prefer to draw the line after the deprecation exclusion for this specific PR. The rest I would do in separate PRs as you propose. |
582ffec
to
b3cdd38
Compare
PR is updated with exclusion of deprecated modules. |
💚 💙 💜 💛 ❤️ |
You are right. I did a mistake between Kernel.CLI and Kernel. Kernel.CLI is tested... but it uses separate OS processes, so it does not get measured. :) |
FYI on the OpenSSF Best Practices Badge: There's some requirements in the higher levels (Silver / Gold). While I don't suggest to try to fulfill them at this time, this may be relevant to prepare for it a bit longer term. Silver:
Gold:
|
Changes
Implements test coverage reporting.
Requirements
mix test.coverage
for reporting (generated lines etc.)TODOs / Issues
mix test.coverage
Summaries depend onmix
being present. Find a way to avoid duplicating code.FunctionClauseError
message)