-
Notifications
You must be signed in to change notification settings - Fork 388
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
Merging should not fail if file doesn't exist #220
Conversation
…nly if the file exists.
Codecov Report
@@ Coverage Diff @@
## master #220 +/- ##
=======================================
Coverage 94.91% 94.91%
=======================================
Files 15 15
Lines 1633 1633
=======================================
Hits 1550 1550
Misses 83 83
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Please update your commit to link to your GitHub profile. I prefer all my contributors' commits to be properly attributed
As discussed on #203 This tiny change should enable the use of a single "dotnet test" command to generate coverage for multiple test projects, aggregate all the results in one file, available in other formats (if requested). Using VSTS/Azure Devops, this would be the way to have it work properly: dotnet test **/*[Tt]ests/*.csproj Caveats:
Correct me if I'm wrong in my analysis. I'll check to see if I can figure out how to test this, but I probably won't have enough time. If I'm right, this should be a way to really enhance coverlet's usage from a user's standpoint. |
I tested it and although it does create a new file if not exists, it creates a new file in each run without merging... What i run:
For my example in #203 Update:
So this works great. But if I add |
It should work, if you request both json and your other formats (those you actually want), separated by a coma. /p:CoverletOutputFormat=json,opencover,cobertura It's gonna merge with the json file, and also generate/overwrite the other formats in the same folder as the json. You really have to target a folder as the ouput though, can't pick a specific file or it's not gonna work either. Edit: I had to use quotes and backslashes in my build when requesting multiple formats, maybe this can save you a headache:
Thanks a lot for testing it! |
@vlef ah good point! Haven't thought about adding both output types as param. |
@vlef couldn't resist and I just tested it. Works! :D
And I got the file nicely merged in both formats :D @tonerdo hope after this merge comes some testing on your side followed by a release! Cheers! |
…creates-file Merging should not fail if file doesn't exist
Changed merging behavior: merges the result of the current test coverage with the specified file only if the file exists.