Skip to content

Commit 2c36b24

Browse files
committed
Fail the UploadCoverageToCodecov target if the codecov tool fails
By default, the codecov exe exits with 0. You need to explicitly pass the --required option for codecov to exit with 1 on error. This is required for the MSBuild Exec task to properly report an error.
1 parent 7164471 commit 2c36b24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/Serilog.Formatting.Log4Net.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<Target Name="UploadCoverageToCodecov" AfterTargets="GenerateCoverageResultAfterTest" Condition="$(ContinuousIntegrationBuild) == 'true'">
4545
<!-- For reference: the file `.config/dotnet-tools.json` was created by running `dotnet new tool-manifest && dotnet tool install Codecov.Tool` -->
4646
<Exec Command="dotnet tool restore" />
47-
<Exec Command="dotnet codecov --file &quot;@(CoverletReport, '&quot; &quot;')&quot;" />
47+
<Exec Command="dotnet codecov --required --file &quot;@(CoverletReport, '&quot; &quot;')&quot;" />
4848
</Target>
4949

5050
<ItemGroup>

0 commit comments

Comments
 (0)