-
Notifications
You must be signed in to change notification settings - Fork 21
Add new Codecov.MSBuild package providing a Codecov
MSBuild task
#135
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #135 +/- ##
===========================================
+ Coverage 65.15% 70.74% +5.58%
===========================================
Files 39 37 -2
Lines 1013 916 -97
Branches 130 118 -12
===========================================
- Hits 660 648 -12
+ Misses 353 268 -85 Continue to review full report at Codecov.
|
096ce02
to
fc38e3b
Compare
So that it can be re-used outside of the CLI tool. For example, in an MSBuild task. Also, split the Uploader() function into two functions: LogContinuousIntegrationAndVersionControlSystem() + UploadReports().
I just rebased and fixed the continuous integration build in 3f937c1. |
I would love to see this merged. Currently I'm using the codecov dotnet tool and it's not as elegant as the proposed MSBuild task. With the dotnet tool: <Target Name="UploadCoverageToCodecov" AfterTargets="GenerateCoverageResultAfterTest" Condition="$(ContinuousIntegrationBuild) == 'true'">
<!-- For reference: the file `.config/dotnet-tools.json` was created by running `dotnet new tool-manifest && dotnet tool install Codecov.Tool` -->
<Exec Command="dotnet tool restore" />
<Exec Command="dotnet codecov --file "@(CoverletReport, '" "')"" />
</Target> With the proposed MSBuild task: <Target Name="UploadCoverageToCodecov" AfterTargets="GenerateCoverageResultAfterTest" Condition="$(ContinuousIntegrationBuild) == 'true'">
<Codecov ReportFiles="@(CoverletReport)" />
</Target> Also, logging is top notch with the MSBuild task. |
The dictionary assertions provide better error messages if a key does not exist in a dictionary. This should help to diagnose why the following test [failed on continuous integration](https://github.com/codecov/codecov-exe/runs/1140518035?check_suite_focus=true#step:7:391). ``` Codecov.Tests.Coverage.EnviornmentVariables.EnviornmentVariablesTests.Should_Include_EnviornmentVariables_From_Options [6ms] Error Message: System.Collections.Generic.KeyNotFoundException : The given key 'foo' was not present in the dictionary. ```
It is causing this error: ``` Run SET DOTNET_31_ROOT=%DOTNET_ROOT:3.1.300=2.1.806% SET DOTNET_31_ROOT=%DOTNET_ROOT:3.1.300=2.1.806% xcopy /s /y /d %DOTNET_31_ROOT% %DOTNET_ROOT% shell: C:\windows\system32\cmd.EXE /D /E:ON /V:OFF /S /C "CALL "{0}"" env: DOTNET_ROOT: C:\Users\runneradmin\AppData\Local\Microsoft\dotnet Cannot perform a cyclic copy 0 File(s) copied Error: Process completed with exit code 4. ``` Moreover, this workaround should no longer be required, see actions/setup-dotnet#25
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, sorry about the delay to merge this PR
@0xced your changes have been merged, thanks for your contribution 👍 I have decided that this change will be included with the next version of codecov-exe, just need to find time to be able to create a new release and check out all of the pr's to update the dependencies first. |
Excellent, thanks for merging! 🥳 No need to apologise for the delay, better work at a your own pace than experience open source burnout. |
🎉 This issue has been resolved in version 1.13.0 🎉 The release is available on: Your friendly GitReleaseManager bot 📦🚀 |
UploadFacade
class to depend on interfaces instead of CommandLineOptions so that it's usable from the MSBuild taskCodecov.MSBuild
packageCodecov.MSBuild
package