-
Notifications
You must be signed in to change notification settings - Fork 389
C# 9 record types show as a miss #992
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
Looks like we should be looking for patterns that suggest a record declaration and ignoring that automatically. Haven't had a chance to test Coverlet with .NET 5, but a small repro project will be appreciated |
This is as minimal as I could think to make it. The unit test creates an instance of the record and accesses its property. This is the console output $ dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=\"opencover,lcov\"
Determining projects to restore...
Restored /Users/rubberduck/src/coverlet-records-repro/src/repro.csproj (in 77 ms).
Restored /Users/rubberduck/src/coverlet-records-repro/tests/tests.csproj (in 352 ms).
repro -> /Users/rubberduck/src/coverlet-records-repro/src/bin/Debug/net5.0/repro.dll
tests -> /Users/rubberduck/src/coverlet-records-repro/tests/bin/Debug/net5.0/tests.dll
Test run for /Users/rubberduck/src/coverlet-records-repro/tests/bin/Debug/net5.0/tests.dll (.NETCoreApp,Version=v5.0)
Microsoft (R) Test Execution Command Line Tool Version 16.8.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Passed! - Failed: 0, Passed: 1, Skipped: 0, Total: 1, Duration: 3 ms - /Users/rubberduck/src/coverlet-records-repro/tests/bin/Debug/net5.0/tests.dll (net5.0)
Calculating coverage result...
Generating report '/Users/rubberduck/src/coverlet-records-repro/tests/coverage.opencover.xml'
Generating report '/Users/rubberduck/src/coverlet-records-repro/tests/coverage.info'
+--------+------+--------+--------+
| Module | Line | Branch | Method |
+--------+------+--------+--------+
| repro | 0% | 100% | 0% |
+--------+------+--------+--------+
+---------+------+--------+--------+
| | Line | Branch | Method |
+---------+------+--------+--------+
| Total | 0% | 100% | 0% |
+---------+------+--------+--------+
| Average | 0% | 100% | 0% |
+---------+------+--------+--------+ |
@rubberduck203 seem that the bug is solved in master(next 3.0.0 version), I did some test with our updated nightly Can you try by yourself with nightly and confirm? https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/ConsumeNightlyBuild.md#consume-nightly-build version |
@MarcoRossignoli I think I’ll have some time tomorrow to test it out. I’ll get back to you. |
Works like a charm @MarcoRossignoli. Thanks. |
Great feel free to close this if solved! |
Done! |
As you can see on line 32, my tests are running the
PathCount
constructor (and are elsewhere calling both getters), but is being registered as a miss.https://codecov.io/gh/rubberduck203/GitNStats/src/116f2b93ef887097a8c0aac8b2ef7978b2905bb1/src/gitnstats.core/Analysis.cs
Version Info
.net5.0
If I have some time tomorrow, I'll try to create an MVCE.
The text was updated successfully, but these errors were encountered: