-
Notifications
You must be signed in to change notification settings - Fork 385
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
[Experiment]Expose coverlet.core.dll as nuget package #628
[Experiment]Expose coverlet.core.dll as nuget package #628
Conversation
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.
Looks good, just one thought about controlling the lifetime of instrumented files.
IInProcessCoverageEngine CreateInProcessEngine(Stream instrumentationResultStream); | ||
} | ||
|
||
public interface ICoverageEngine |
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.
Could this be IDisposable instead and clean up the instrumented files on dispose? It would let the calling code control when it happens instead of it being done on process exit.
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.
clean up the instrumented files
You mean "restore non instrumented ones"?
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.
Yes :)
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.
Could be possible...I need to check how much code update...but I think that we could inject a slighly different instrumenterhelper that doesn't fire restore on process exits, I'll take a look, thank's.
This could be good also for "fire and forget" instrumentation, where we don't mind about dirty asm on target dir, and instrumentor process can die after instrument.
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.
The latter is also a good tool to look at instrumented files themselves. Could be an enum on InstrumenterOptions
when calling ICoverageEngineFactory.CreateEngine
:
enum RestoreInstrumentedModules
{
OnProcessExit,
OnEngineDispose,
Never
}
It would mean that ICoverageEngine
still need to be IDisposable
, even if it is only cleans up resources in some cases.
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.
I'll try to add this feat.
Closing for now, we'll take some inspiration in future when we'll decide to expose instrumentation engine. |
Tackle #212
At the moment we can use coverlet in two main scenario:
You can checkout this branch and I did a complete working sample under
Documentation/Examples/StandaloneUsage
you can followReadme.md
in same folder to test by yourself.Let me know if you're in trouble and if the api would be better.
cc possible interested guys @ppumkin @shargon @singhsarab @jnovick @vagisha-nidhi @acesiddhu @karanjitsingh @sharwell
cc: @tonerdo @petli
Video sample https://twitter.com/MarcoRossignoli/status/1201546945589841922