-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
More fine-grained coverage output control #50215
Comments
Reading through the code after your post on the discourse thread (here). It looks like the coverage data is stored in: Line 46 in da6892f
And this gets written to disk here: Line 205 in da6892f
which gets called only when Julia is exiting, here: Line 289 in da6892f
So the first order mechanism for live monitoring would be to have some hook so this coverage variable is accessible to the Julia runtime? |
Very cool! Two other thoughts:
|
Related #50834 One difficulty with just adding a coverage flip is that you'll invalidate everything in your session, as far as I'm aware. This is the reason why every vendored stdlib/sysimage is compiled twice, once with coverage hooks and once without. This can greatly influence performance, effects etc - see #49978 for one such example. |
For now it looks like #54358 solved this for the VS Code extension, thanks @MilesCranmer :) |
The VS Code test framework is going to get coverage support at some point, and I'd love to use that in the test item framework. For that to work, I would need a much more fine-grained control over coverage output in Julia base, though :)
In particular, Julia processes are re-used across multiple test runs in the test item framework, and I would need to get individual coverage results per test-run. So the model of having just one global coverage output per Julia instance doesn't really work.
I could think of various different ways to solve this.
One could be an API that deletes all accumulated coverage data in the current process and starts writing new coverage data into a new file (a bit like
Profile.clear()
):restart_coverage_collection(new_output_filename)
Or maybe even more elegant would be a scoped coverage collection a la:
Or maybe it would even be possible to not write coverage data to disk at all but rather collect in-memory?
Not sure how big coverage data gets and whether that is a good idea or not.
I think for my purposes any of these would work well, so maybe the first one would be the simplest?
The text was updated successfully, but these errors were encountered: