the-dext / RunCoverletReport

A Visual Studio 2019 Extension to run Coverlet and Report Generator
MIT License
40 stars 15 forks source link

Temp path can not be found #1

Open b-straub opened 4 years ago

b-straub commented 4 years ago

After runnig the tool the following error will be displayed:

Could not find file TempPath-GUID-\coverage.cubertura.xml

The given location exist, but contains an empty folder name "coverageReport".

b-straub commented 4 years ago

After digging a bit more, I found the issue related to the MSBuild integration. Unfortunately my project only generates coverage with "coverlet.collector" but not with "coverlet.msbuild". With the MSBuild version I get 0% coverage always.

May be you can make your extension also working with the collector. The project I'm using can be found here ObservableTests.

the-dext commented 4 years ago

I’ll look into it as soon as I can. Once I figure out how to build a settings page for the extension I should be able to do some things to improve usability. I use coverlet collector in all of my projects.

robertlarkins commented 4 years ago

I'm also having the same issue.

danielpalme commented 4 years ago

Same here. Temp directory exists, but no file in directory is generated.

image

the-dext commented 4 years ago

Hi All, I've been looking at this today and it's been a bit of a pain to figure out, but I've got something that is working for me. Unfortunately I couldn't get the repo provided by @b-straub to compile for me even after installing the preview .net 5 SDKs so I've created my own test solutions, one with coverlet.collector only and one with coverlet.msbuild only.

Would a few of you be kind enough to try a version of the extension out for me and see if it fixes your problem ?

I've created a fix branch and uploaded a preview version of the vsix extension installer. This adds a new option to visual studio that I need you to make sure is set right for your project where you can specify if you're using coverlet.msbuild or not (if not then it assumes you're using coverlet.collector).

Coverlet.collector doesn't offer the same functionality as Coverlet.msbuild does so the Exclude Assemblies File Pattern setting won't apply and I also couldn't use coverlet to merge the results file into one, which I need to be able to show code highlighting.

Thankfully @danielpalme supports this in Report Generator, so I've switched to using the merged results instead. One thing I've noticed in my test solution is that any project which is not reference by any test project at all seems to be completely excluded from the report and cobertura file. I'm not sure why that is and it's possible that my test solution isn't realistic enough (for example that missing project isn't referenced by any other in the solution)

If someone could run the vsix from this branch and give me some feedback that'd be great. https://github.com/the-dext/RunCoverletReport/blob/fix/coverlet-collector-without-msbuild/RunCoverletReport.vsix

danielpalme commented 4 years ago

I tried to install the VSIX. But the installation failed:

28.06.2020 19:00:54 - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
   bei VSIXInstaller.App.InitializeInstall(Boolean isRepairSupported)
   bei VSIXInstaller.App.InitializeInstall()
   bei System.Threading.Tasks.Task.InnerInvoke()
   bei System.Threading.Tasks.Task.Execute()

Same issue with current release in MarketPlace. Installation only works when triggered in VS.

the-dext commented 4 years ago

That’s strange. I don’t get that behavior from my two machines and they have different editions of visual studio. I’ll upload it to the market place when I get a chance.


From: Daniel Palme notifications@github.com Sent: Sunday, June 28, 2020 6:04:36 PM To: the-dext/RunCoverletReport RunCoverletReport@noreply.github.com Cc: Chris Dexter chris.dexter@live.co.uk; Comment comment@noreply.github.com Subject: Re: [the-dext/RunCoverletReport] Temp path can not be found (#1)

I tried to install the VSIX. But the installation failed:

28.06.2020 19:00:54 - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products. bei VSIXInstaller.App.InitializeInstall(Boolean isRepairSupported) bei VSIXInstaller.App.InitializeInstall() bei System.Threading.Tasks.Task.InnerInvoke() bei System.Threading.Tasks.Task.Execute()

Same issue with current release in MarketPlace. Installation only works when triggered in VS.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/the-dext/RunCoverletReport/issues/1#issuecomment-650794387, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB6Q3RW55BBEMKVFQT3DZN3RY5Z2JANCNFSM4N2JR4FQ.

danielpalme commented 4 years ago

Ok, got it working with a private feed (see https://devblogs.microsoft.com/visualstudio/create-a-private-gallery-for-self-hosted-visual-studio-extensions/).

But problem does still exist. No coverage file is available after test execution. My dependencies:

the-dext commented 4 years ago

I have the exact same packages. Have you checked the options tab in tools | options to make sure the extension isn’t set to use msbuild? You’ll definitely get that error if it’s set to expect one way of working but it actually the other.


From: Daniel Palme notifications@github.com Sent: Sunday, June 28, 2020 6:15:31 PM To: the-dext/RunCoverletReport RunCoverletReport@noreply.github.com Cc: Chris Dexter chris.dexter@live.co.uk; Comment comment@noreply.github.com Subject: Re: [the-dext/RunCoverletReport] Temp path can not be found (#1)

Ok, got it working with a private feed (see https://devblogs.microsoft.com/visualstudio/create-a-private-gallery-for-self-hosted-visual-studio-extensions/).

But problem does still exist. No coverage file is available after test execution. My dependencies:

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/the-dext/RunCoverletReport/issues/1#issuecomment-650795673, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB6Q3RWHAAIVR4T2OY3PAFTRY53DHANCNFSM4N2JR4FQ.

danielpalme commented 4 years ago

Disabling MSBuild in the settings did the trick. Now it's working. Is it possible to add some auto detection? And maybe output a warning if neither collector or MSBuild package is referenced.

the-dext commented 4 years ago

That’s a good idea. I need to learn a bit more about the extensibility sdk, and hopefully it’ll make adding new features easier.


From: Daniel Palme notifications@github.com Sent: Sunday, June 28, 2020 6:41:52 PM To: the-dext/RunCoverletReport RunCoverletReport@noreply.github.com Cc: Chris Dexter chris.dexter@live.co.uk; Comment comment@noreply.github.com Subject: Re: [the-dext/RunCoverletReport] Temp path can not be found (#1)

Disabling MSBuild in the settings did the trick. Now it's working. Is it possible to add some auto detection? And maybe output a warning if neither collector or MSBuild package is referenced.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/the-dext/RunCoverletReport/issues/1#issuecomment-650798778, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB6Q3RXVXOG3ACN5BC6MMOTRY56GBANCNFSM4N2JR4FQ.

Jsparham777 commented 3 years ago

I had the same error. The installation/fix was as follows: