-
-
Notifications
You must be signed in to change notification settings - Fork 733
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] Refit 6 causes code coverage with coverlet to stop working #1073
Comments
Please file this on the coverlet repo, it's a bug on their end and there's nothing we can do. |
Opened coverlet-coverage/coverlet#1084. Please add any relevant context regarding source generators (if there's anything useful that can be added regarding what Refit does with them of course!). |
Closing as external in favor of the bug on the Coverlet side. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Describe the bug
In a project using Refit 6.0.8 and coverlet.msbuild 3.0.2, upon updating from Refit 5.2.4, code coverage is no longer being collected for the assembly containing Refit interfaces.
In the first instance I'm raising the issue here as the delta in the project where I'm having this issue is the Refit version, with coverlet.msbuild being the same version as before and working as expected with Refit 5.2.4.
If it's a latent issue with coverlet.msbuild that's just being uncovered by the latest version of Refit, then I can open an issue on the coverlet repo.
Using coverlet's troubleshooting guide here, I narrowed my investigation down to this line of interest:
As there's no file on disk here, that sort of makes sense, but causes an issue as it breaks all code coverage for the project for the sake of the one interface.
I'm guessing this is something to do with the usage of source generators. It might be that there's an MSBuild variable I need to set somewhere to either skip this (I tried skipping the individual file with an
ExcludeByFile
filter of**/*.g.cs
but it didn't seem to work).It looks like this initially skipped detection in my CI jobs (where there is a coverage threshold) because if there are no modules coverlet is reporting 100%/NAN% coverage, which is greater than the threshold so the build passes despite there being no actual coverage data at all.
I'll open a separate issue with coverlet for this one, if there isn't already.coverlet-coverage/coverlet#1083Steps To Reproduce
Clone https://github.com/martincostello/alexa-london-travel and run
./build.ps1
.The build script will eventually output something like this:
Example build: https://github.com/martincostello/alexa-london-travel/runs/1869767942?check_suite_focus=true#step:4:78
This seems to be affecting multiple repos I have using Refit, not just this one.
Here's another example: https://github.com/martincostello/alexa-london-travel-site/runs/1870035564?check_suite_focus=true#step:4:160
Expected behavior
Assemblies containing Refit interfaces are instrumented correctly.
For the referenced repository, it should output something like this from
build.ps1
:Example build: https://github.com/martincostello/alexa-london-travel/runs/1869465349?check_suite_focus=true#step:4:80
Screenshots
N/A
The text was updated successfully, but these errors were encountered: