You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Coverlet.Core.Instrumentation.Tracker. runtime Type created in production assemblyΒ #1191
Coverlet injects a static class inside assembly during instrumentation. This class contains method to record the hint. We refer to this method inside user instrumented types. After the instrumentation we "rollback" to the original dlls(original ones are saved in a tmp dir).
Hits are collected in a in memory array and persisted to a file system on process exits.
Why is coverlet creating a tracker inside a production assembly that does not references coverlet at the first place ?
We cannot add dependency to user assembly or we risk to break the real code(our dependencies could influence behavior loading external and not expected assemblies). We simply inject "some helper" class but we don't "inject" any dependency.
On runtime we rely on BCL(base class library) primitive types(array, mutex, files).
Thanks for the explanation, so after the instrumentation the original dlls will not have these trackers. Can we have CompilerGeneratedAttribute on them so that other type inspection algorithms can ignore these trackers ?
Activity
MarcoRossignoli commentedon Jul 17, 2021
Coverlet injects a static class inside assembly during instrumentation. This class contains method to record the hint. We refer to this method inside user instrumented types. After the instrumentation we "rollback" to the original dlls(original ones are saved in a tmp dir).
Hits are collected in a in memory array and persisted to a file system on process exits.
We cannot add dependency to user assembly or we risk to break the real code(our dependencies could influence behavior loading external and not expected assemblies). We simply inject "some helper" class but we don't "inject" any dependency.
On runtime we rely on BCL(base class library) primitive types(array, mutex, files).
MarcoRossignoli commentedon Jul 17, 2021
This is the current injected tracker https://github.com/coverlet-coverage/coverlet/blob/master/src/coverlet.core/Instrumentation/ModuleTrackerTemplate.cs
apsthisdev commentedon Jul 27, 2021
Thanks for the explanation, so after the instrumentation the original dlls will not have these trackers. Can we have CompilerGeneratedAttribute on them so that other type inspection algorithms can ignore these trackers ?
MarcoRossignoli commentedon Oct 2, 2021
I think it's possible and should not have impact.
Thanks for the advice.