-
Notifications
You must be signed in to change notification settings - Fork 249
Converted solution to VS2017 format and dotnet test, and now missing coverage #756
Comments
You'll probably need to try that latest beta build to get coverage from anything built using https://ci.appveyor.com/project/sawilde/opencover/build/4.6.780/artifacts |
@sawilde Funny how the UnitTest-classes gets coverage, but not the actually Library-classes. Possible for you to publish a release-candidate nuget-package, that I can grap from the NuGet-feed (easier to use on appveyor.yml) ? |
@snakefoot not yet as it isn't ready - publishing a release candidate creates an expectation |
There is a myget feed - https://www.myget.org/feed/Packages/opencover |
@sawilde Is this a public feed ? I cannot seem to access it. |
@snakefoot I believe so but you may need a myget account perhaps. try this:
|
@sawilde Tried the BETA-build, but it is also only picking up some of the coverage: https://codecov.io/gh/NLog/NLog/commit/615e6d61353a230968c87d5c4dc3641a7f8ca29c/build This is the normal test-complete output:
This is the output with the new solution:
|
Discovered that xUnit 2.0 xunit.console.x86.exe is still able to execute the tests, and now it the result is this:
|
Have the same problem here (NLog/NLog.MailKit#5), and that's a lot smaller repo (so easier to test) |
I've noticed @snakefoot was effectively using My story is - I work on Win10-Home x64, VS2017 Comunity, OpenCover 4.6.519, xunit mixed 2.2.0 and 2.3.1, and I have a (netcoreapp2.0) In covered project csproj:
(netcoreapp2.0) In test project:
(netcoreapp2.0) OpenCover runner (single command line, multiline for readability):
I've spent few days (really, not exagerrating) on researching different options, and that's the only combination that worked. I excluded unimportant things like Now the fun part. I had to switch my net-core-app to net461 due to 3rd party libraries. Application works fine, tests run fine, opencover (
I similar messages when I battled with (net461) In covered project csproj:
(net461) In test project:
(net461) OpenCover runner (single command line, multiline for readability, I've left only the important parts):
I can only guess that either opencover does not look in \bin$config$platform for them, or dotnet test/vstest does not copy them properly, or xunit-runner does not copy/shadow them properly.. By the way, I noticed it still works when I remove, Anyways I'm absolutely hyped. For the 3rd time in a row (core 1.1, core 2.0, net461), I was dead-tired trying to get it working and almost gave up, and yet again it works out of the box with OpenCover 4.6.519 provided you somehow happen to guess the switches. Unfortunatelly, I cannot share the full project/script/msbuild setup, and can't prepare a new self-contained project demos (time/effort/nda/license/etc), I'll try to do that a bit later this or next week. |
@quetzalcoatl thanks - I really must get to updating the documentation around this |
My Framework
My Environment
I have already...
My issue is related to (check only those which apply):
Expected Behavior
Should include coverage of entire library-code.
Actual Behavior
When using filter, then it only include a single class (BaseMutexFileAppender.cs)
Without filter then it shows the correct coverage of the unit-test-library, but still only a single class of the library being tested.
Steps to reproduce the problem:
OpenCover.Console.exe -register:user -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test tests\NLog.UnitTests --configuration Debug --framework net461" -returntargetcode -filter:"+[NLog]* +[NLog.Extended]* -[NLog]JetBrains.Annotations.*" -excludebyattribute:*.ExcludeFromCodeCoverage* -hideskipped:All -output:coverage.xml
The text was updated successfully, but these errors were encountered: