-
Notifications
You must be signed in to change notification settings - Fork 325
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
[BUG] vstest.console.exe --collect:"XPlat Code Coverage" throw System.FormatException #2278
Comments
I did a check actually the bug was solved in #2221 the real warning is
Because It works if we provide collector path
|
Adding the test adapter path to the "pathtoCustomTestAdapters" parameter of VSTest v2 did not change the error message on our end. We're using the "old" full .NET Framework tasks (NuGet, MSBuild, VSTest Installer, VSTest). |
I think because plain |
Is there any chance of getting this looked at? If not we can change to another coverage solution instead. |
I did some test and find the issue, the problem is that coverlet collector is build for netcoreapp2.1 but packed for netstandard1.0 and vstest.console.exe try to load collector for .NET Framework and correctly fails to load .net core reference https://github.com/microsoft/vstest/blob/master/src/Microsoft.TestPlatform.Common/ExtensionFramework/TestPluginDiscoverer.cs#L184
Now I've got some question for vstest team on coverlet collector they did:
I think that pack for netstandard1.0 was done to "try to load collector for every possible plat" and let it fail for non compat cases. Working on other related issue found this statement coverlet-coverage/coverlet#466 (comment) btw we've user that work on netfx and we could release netstandard2.0 or should we "announce" that collector will work properly only for core app? cc: @vagisha-nidhi @nohwnd @jakubch1 @AbhitejJohn @singhsarab |
@nohwnd @jakubch1 can someone please take a look at this and tell me if we can compile for netstandard? Feel free to reach me off line also, thanks guys! |
As the netcore and netfx platforms diverge, it is becoming ever more important to be able to test on both and merge coverage results to make sure everything is covered. I really hope this can be fixed. |
I don't know why it is done that way, if coverlet is targetting netcoreapp2.1 it should probably distribute as such. When I look at coverlet nuget package it lists no dependencies. I don't know what the minimal requirements are for coverlet, but Microsoft.NET.Test.SDK targets netcoreapp1.0, netcoreapp2.1 and net45. So if you want coverlet to run everywhere where test.sdk runs you should target that probably. This will also avoid problems with templates because they are already including test.sdk so if coverlet would go to netstandard2.0 (which is not net45 compatible) it would fail to restore when user manually changes the TFM to net45. We actually don't do anything for .net45 in the package, it's imho targetting that just to avoid this multitargetting issue. So you might choose the actual framework you are building against, I don't know which apis you need to be able to provide the coverlet functionality.
Would that help? You still would be "lying" about compatibility. We do a bit as well the test.sdk lists net45 as the minimum, but we build against net451, and ship those bits in SDK, so to run you'd need net451 not net45. |
Minimum for coverlet core features is
I know, I don't know why was done as is, by the way we can go on with that for now, at the moment we have only some issue with .NET Framework version >= net45. So from you answer I think we can compile for our possible minimum to support collectors(in process one) for .NET Framework app >= net461 For the future the idea is to remove in-proc collector at all and use shared memory to gather hits, in that case we'll only use out of process one. |
closed in coverlet-coverage/coverlet#970 Thanks to all for the support! |
ping us when you release it, we should get it into templates in early stage, to detect errors while we can still fix them. |
Got it, we don't have an ETA atm we have one fix on queue and after we can go, I'll let you asap. |
@MarcoRossignoli Any news on a release on this? |
vstest.console.exe --collect:"XPlat Code Coverage"
throw System.FormatExceptionWe had a request on coverlet repo coverlet-coverage/coverlet#652 to use "Visual Studio Test task" https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/vstest?view=azure-devops
cc: @vagisha-nidhi
The text was updated successfully, but these errors were encountered: