-
Notifications
You must be signed in to change notification settings - Fork 388
Coverage is inconsistent following Xunit upgrade. #700
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
Comments
Some question, |
Hi @MarcoRossignoli thanks for getting back so swiftly. I'm using it via the following command. dotnet test -c Release -f netcoreapp3.1 /p:codecov=true This calls our target file configured in the following manner. <!--Code coverage specific settings-->
<!--https://github.com/tonerdo/coverlet-->
<PropertyGroup Condition="'$(codecov)' == 'true' AND '$(IsTestProject)' == 'true'">
<CollectCoverage>true</CollectCoverage>
<UseSourceLink>true</UseSourceLink>
<Include>[SixLabors.*]*</Include>
<CoverletOutputFormat>lcov</CoverletOutputFormat>
<CoverletOutputPath>$(MSBuildThisFileDirectory)..\</CoverletOutputPath>
<CoverletOutput>$(CoverletOutputPath)$(AssemblyName).$(TargetFramework).lcov</CoverletOutput>
<!--Used by coverlet due to reference issues-->
<!--https://github.com/tonerdo/coverlet/blob/master/Documentation/KnowIssues.md#4-failed-to-resolve-assembly-during-instrumentation-->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup> The post upgrade runs an additional two unit tests, non of which are related to the missing coverage results. Running the same tests in Debug leads to a result of 48.25% which again, I know to be inaccurate. (I run in Release as it means 10min shorter build times.) I just rand the same command locally targeting coverlet.msbuild 2.7.0 and got an even smaller number. +----------------------+--------+--------+--------+
| Module | Line | Branch | Method |
+----------------------+--------+--------+--------+
| SixLabors.ImageSharp | 39.41% | 27.07% | 40.48% |
+----------------------+--------+--------+--------+
+---------+--------+--------+--------+
| | Line | Branch | Method |
+---------+--------+--------+--------+
| Total | 39.41% | 27.07% | 40.48% |
+---------+--------+--------+--------+
| Average | 39.4% | 27.07% | 40.47% |
+---------+--------+--------+--------+ I cannot run the coverage tests in Running the tests in Debug with 2.7.0 yields the following, again different result: +----------------------+--------+--------+--------+
| Module | Line | Branch | Method |
+----------------------+--------+--------+--------+
| SixLabors.ImageSharp | 30.49% | 23.98% | 33.63% |
+----------------------+--------+--------+--------+
+---------+--------+--------+--------+
| | Line | Branch | Method |
+---------+--------+--------+--------+
| Total | 30.49% | 23.98% | 33.63% |
+---------+--------+--------+--------+
| Average | 30.49% | 23.98% | 33.63% |
+---------+--------+--------+--------+ |
With |
Yeah OK with both of those versions. I'll have a look at migrating across. I saw you're planning to drop MSBuild support. |
"Drop" is heavy we've a lot of users on it, but the idea is to move(at our pace) to maintain only integration with vstest collector to avoid know issue(behaviour of vstest engine) and have a less drift between drivers feature(we need to keep a set of feats, threshold check and merge on all), but we're in the discussion stage. |
Thanks, I had a play around locally with the collector. It generated a report (how do you set the output file and location btw? The options are different) but not an output to the console. Having a quick look at the relevant sections in the report though with my limited experience it looked like the results were the same as MSBuild and incorrect. |
Ok thank's for the test, I noticed that the two ci above uses different file format, the correct one xml(opencover)
and the second one(where you see strange percentage) lcov,
is this ok?If you run using opencover with new xunit version does the percentage drops again?(to exclude a report generator bug) NB you see
Collectors are pretty new and we're porting msbuild/.net tool feat to it(with some trouble due to vstest plat restriction/extension point) today you cannot specify file name but only result directory with default Check our sample https://github.com/tonerdo/coverlet/tree/master/Documentation/Examples/VSTest/HelloWorld
Yep this feat is not supported yet here the tracking issues https://github.com/tonerdo/coverlet/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Adriver-collectors+label%3Afeature-request We're aware that collectors are today not so user friendly(like msbuild/dotnet tool), but unfortunately are the only usage that prevents strange issue so we're trying to move on it without losing any prev feat at best we can with what we have today, my "dream" is to help also vstest team and reach a point where we can use collectors and pass parameter without a custom xml files. In short the idea is to try to move sto stable and well supported plat(vstest) without losing nothing, so we won't drop msbuild or .net tool but we'd like to invest in the future(also related to .NET 5 story). |
I just ran the test locally using the opencover output with the following results. dotnet test -c Release -f netcoreapp3.1 /p:codecov=true +----------------------+--------+--------+--------+
| Module | Line | Branch | Method |
+----------------------+--------+--------+--------+
| SixLabors.ImageSharp | 36.96% | 26.03% | 37.5% |
+----------------------+--------+--------+--------+
+---------+--------+--------+--------+
| | Line | Branch | Method |
+---------+--------+--------+--------+
| Total | 36.96% | 26.03% | 37.5% |
+---------+--------+--------+--------+
| Average | 36.96% | 26.03% | 37.5% |
+---------+--------+--------+--------+ So it looks like this is even worse. I'm not precious about the output format at all as long as Coveralls supports it. The switch was made because it was a 10mb difference in output file size. |
Ok tomorrow I'll go on with the investigation... thanks for the support! |
I don't know if this helps but I just ran coverage analysis via Visual Studio on the code which returned the result 83.79% which is what I would expect. james_MJÖLNIR 2020-01-25 18_19_36.coverage.txt Running Coverlet gives me +----------------------+--------+--------+--------+
| Module | Line | Branch | Method |
+----------------------+--------+--------+--------+
| SixLabors.ImageSharp | 35.58% | 25.97% | 33.69% |
+----------------------+--------+--------+--------+
+---------+--------+--------+--------+
| | Line | Branch | Method |
+---------+--------+--------+--------+
| Total | 35.58% | 25.97% | 33.69% |
+---------+--------+--------+--------+
| Average | 35.58% | 25.97% | 33.69% |
+---------+--------+--------+--------+ SixLabors.ImageSharp.Tests.netcoreapp3.1.netcoreapp3.1.lcov.txt |
Thank's I don't know how at the moment how coverage in vs works(how it instruments). Btw this/next days I'll work on this and hope is also related to the other similar one 🤞 |
Much appreciated. Best of luck! |
@JimBobSquarePants I get some exception if I move to 2.4.1 I think is related to Can I use this branch to repro https://github.com/SixLabors/ImageSharp/compare/af/improve-tests? |
You can use the master branch now. We've just merged the PR containing that branch. |
Mmm I need also the previous version your new packages config does not allow come back to old xunit to compare because remote executor wants 2.4.1 asserts lib, BTW to be close to CI I've cloned two time with and without PR for now |
No problem. Here's a branch to use. https://github.com/SixLabors/ImageSharp/tree/js/coverlet-comparison-do-not-delete |
Great thank's! |
Issue
Following upgrade to xunit 2.4.1 from 2.3.1 in the ImageSharp repo certain tests do not run and no coverage is calculated.
For example.
Baseline coverage 83.79%
https://github.com/SixLabors/ImageSharp/runs/398717930#step:11:424
Following upgrade 63.28%
https://github.com/SixLabors/ImageSharp/runs/402256993#step:11:399
As you can see from the hosted report an entire section of code has now been excluded as a result of non-running test.
https://codecov.io/gh/SixLabors/ImageSharp/tree/6f832aa77343e8d112d6ddd08765aa2e4d05519c/src/ImageSharp/ColorSpaces
This gets more odd though. I added some filtering to ensure the xunit references were added to the
test project only I got another change. (No tests have changed)
Now 64.8%
https://github.com/SixLabors/ImageSharp/runs/403076336#step:11:396
I'm stumped. A whole suite of tests are getting ignored suddenly and I cannot figure out why.
Example test.
https://github.com/SixLabors/ImageSharp/blob/4973f5f160e4768af344075fe4e3fef39be26d69/tests/ImageSharp.Tests/Colorspaces/Conversion/RgbAndHslConversionTest.cs#L34
Coverlet Versions
The text was updated successfully, but these errors were encountered: