Skip to content
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

Coverlet in process collector load #2158

Closed
MarcoRossignoli opened this issue Sep 9, 2019 · 2 comments
Closed

Coverlet in process collector load #2158

MarcoRossignoli opened this issue Sep 9, 2019 · 2 comments

Comments

@MarcoRossignoli
Copy link
Contributor

MarcoRossignoli commented Sep 9, 2019

Hi guys I'm Marco from Coverlet, I've got a pair of questions
Can you confirm that in-process collector is loaded from 2.2.401(runtime 2.2.6) or greather?
I did some test but I cannot attach to inproc(I'm able to attach and debug to outofproc one) https://github.com/tonerdo/coverlet/blob/master/Documentation/Troubleshooting.md#use-local-collectors-build and I want to be sure that is my fault.

Second, I'd like to view all logs from DataCollectionLogger and TestPlatformEqtTrace can you point me to some resources on "how to"(switch/config) to avoid to waste too much time on docs?

cc: @tonerdo @vagisha-nidhi

@vagisha-nidhi
Copy link
Contributor

@MarcoRossignoli I ran a quick test to find out if there is an issue with inproc collector loading.
Just build the inproc collector with some added logs just like

public void Initialize(IDataCollectionSink dataCollectionSink)
{
    EqtTrace.Info("Coverlet collector inproc initialize");
}

Run the following command to enable diagnosticts on your test project: dotnet test --collect:"Xplat code coverage" --diag:"diag.txt"
This will generate files diag.txt, diag.host.txt and diag.datacollector.txt. Since the inproc datacollector is loaded inside the test host, you should be able to find the added inproc logs inside diag.host.txt.
I am able to load the datacollector.

If you want to attach to the inproc datacollector, the debugger should attach to the testhost.exe process (the inproc datacollector is loaded inside this process). To debug the test host, you need to set this environment variable VSTEST_HOST_DEBUG=1 and attach to testhost.exe.

@MarcoRossignoli
Copy link
Contributor Author

It works! Thank's @vagisha-nidhi!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants