Skip to content
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

No lines with coverage information in this diff. #401

Open
charismats2 opened this issue Apr 30, 2024 · 1 comment
Open

No lines with coverage information in this diff. #401

charismats2 opened this issue Apr 30, 2024 · 1 comment

Comments

@charismats2
Copy link

I removed some unit tests from the main branch locally and then I generate a coverage report with
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=./maincov.xml
after that I ran this command on windows cmd
diff-cover maincov.xml --html-report diff-coverage.html
but this message appeared
No lines with coverage information in this diff.

I checked the XML file generated by dotnet test and it detects not covered classes properly.
what is wrong in my process?

@Bachmann1234
Copy link
Owner

So I'm not 100% sure but it sounds like you were still on main. Diff cover will compare your current branch with main by default. So when it ran the diff it likely found no diff.

If you take your main branch with the tests then checkout a new branch and remove the tests from that branch.

Then try running diff cover from that new branch and see if they works better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants