-
-
Notifications
You must be signed in to change notification settings - Fork 473
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
Report code coverage that includes P tests #2478
Conversation
[Pester.Tracing.Tracer]::Register($tracer) | ||
} | ||
else { | ||
$patched = $true |
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.
so I just needed to check in patch and unpatch not just for profiler tracer, but also for pester tracer.
@fflaten this is what I meant by that. I should hide this under a Env variable probably, so we don't get into broken state after cancellation, as you pointed out.
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.
See few lines of the unchanged code above, it then makes more sense imho.
Fyi. The task |
I tried that and I still don't see the uncovered lines in the breakdown. @fhnaseer is there a way to make the new code coverage view (two posts above) more detailed than just summary per file? we are producing jacoco output. |
See example here where you can see it show hits and misses per line (if you click on a file): https://dev.azure.com/dsccommunity/SqlServerDsc/_build/results?buildId=8834&view=codecoverage-tab It only works with v1 though as I mentioned. See you updated it to v1 so maybe it doesn't find the sources, a parameter of the task that should point to the files that was tested. 🤔 In the SqlServerDsc case we use ModuleBuilder to build the module. So there are some extra work in our pipeline to convert the line numbers in JaCoCo back to the source files and their line numbers even if we tested the built module (psm1). That is why all commands etc is in separate files. That should not be needed in this case though. |
Testing how we could measure CodeCoverage of Pester and P tests. The code above runs, except for one test in mock, which is strange since we can Profile pester tests. Maybe it was some fluke.
The coverage shows 28% which seems too low, most of our tests run in process, so we maybe are resetting something somewhere. Or not pointing the code at the right files.
This also needs to be made compatible with inlining the module.
And Frode pointed out that tracer might not be both the same type.
we also need finally to tear down
and print summary
We are probably not setting that one extra BP that we should be seetting, if all breakpoints are removed Set-Trace will turn off, check profiler what it does, so we can re-enable the test in Mock that removes just it's breakpoints. Add detection of broken trace nohwnd/Profiler#67
Coverage tests fail but it is imho okay to skipthese were mock tests, solvedcoverage.ts tests break the coverage because they turn off tracing
this also higlights that when we profile Pester using PRofiler we are most likely not getting trace of all tests, so there are probably some other Perf wins hiding
Fix #2475