-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Establish Code Coverage for WinForms testing (#514)
* include coverlet.msbuild 2.5.1 * add targets and coverage group * mock dotnet/machinelearning#2843 * Hook coverlet up to the 'RunTests' target * Upload data to codecov.io * Add code coverage badge to the README * Add clarifying comments for code coverage configuration * Move coverage upload after pick/sign/publish
- Loading branch information
Showing
13 changed files
with
168 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# https://docs.codecov.io/docs/codecov-yaml | ||
# https://github.com/codecov/support/wiki/Codecov-Yaml | ||
|
||
coverage: | ||
status: | ||
project: | ||
default: false | ||
patch: | ||
default: false | ||
fixes: | ||
- "eng/::/" | ||
|
||
comment: | ||
layout: "diff, flags" | ||
|
||
flags: | ||
production: | ||
paths: | ||
- src/Common/src/ | ||
- src/System.Design/src/ | ||
- src/System.Drawing/src/ | ||
- src/System.Drawing.Design/src/ | ||
- src/System.Windows.Forms/src/ | ||
- src/System.Windows.Forms.Design/src/ | ||
- src/System.Windows.Forms.Design.Editors/src/ | ||
test: | ||
paths: | ||
- src/Common/tests/ | ||
- src/System.Design/tests/ | ||
- src/System.Drawing/tests/ | ||
- src/System.Drawing.Design/tests/ | ||
- src/System.Windows.Forms/tests/ | ||
- src/System.Windows.Forms.Design/tests/ | ||
- src/System.Windows.Forms.Design.Editors/tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Codecov"> | ||
|
||
<PropertyGroup> | ||
<!-- We need to specify a framework in order for the Restore target to work --> | ||
<TargetFramework>netcoreapp3.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Codecov" Version="$(CodecovVersion)" /> | ||
<PackageReference Include="ReportGenerator" Version="$(ReportGeneratorVersion)" /> | ||
</ItemGroup> | ||
<Target Name="Codecov" DependsOnTargets="Restore"> | ||
<PropertyGroup> | ||
<_CodecovPath>$(NuGetPackageRoot)codecov\$(CodecovVersion)\tools\Codecov.exe</_CodecovPath> | ||
<_ReportGeneratorPath>$(NuGetPackageRoot)reportgenerator\$(ReportGeneratorVersion)\tools\net47\ReportGenerator.exe</_ReportGeneratorPath> | ||
|
||
<!-- The name of the source branch of the pull request. Ideally this would include the fork name, such as | ||
'sharwell:coverage-cleanup', but only the branch name itself is available, such as 'coverage-cleanup'. --> | ||
<_BranchName Condition="'$(_BranchName)' == ''">$(SYSTEM_PULLREQUEST_SOURCEBRANCH)</_BranchName> | ||
<_BranchName Condition="'$(_BranchName)' == ''">$(BUILD_SOURCEBRANCHNAME)</_BranchName> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<!-- [...\artifacts\bin\][project]\[configuration]\[framework]\coverage\[project].coverage--> | ||
<_CoverageReports Include="$(ArtifactsBinDir)*\$(Configuration)\*\coverage\*.coverage" /> | ||
</ItemGroup> | ||
|
||
<!-- Merge multiple coverlet reports into a single Cobertura report before uploading to codecov.io, in order to | ||
reduce upload size and load on the codecov.io processing servers. --> | ||
<Message Importance="high" Text=""$(_ReportGeneratorPath)" "-reports:@(_CoverageReports)" -targetdir:$(BaseOutputPath)coverage -reporttypes:Cobertura" /> | ||
<Exec Command=""$(_ReportGeneratorPath)" "-reports:@(_CoverageReports)" -targetdir:$(BaseOutputPath)coverage -reporttypes:Cobertura" /> | ||
|
||
<ItemGroup> | ||
<!-- These are the best known interpretation of options defined in | ||
https://github.com/codecov/codecov-exe/blob/master/Source/Codecov/Program/CommandLineOptions.cs --> | ||
<_CodecovArgs Include="-f;$(BaseOutputPath)coverage\Cobertura.xml" /> | ||
<_CodecovArgs Include="-r;$(BUILD_REPOSITORY_NAME)" Condition="'$(BUILD_REPOSITORY_NAME)' != ''" /> | ||
<_CodecovArgs Include="--pr;$(SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)" Condition="'$(SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)' != ''" /> | ||
<_CodecovArgs Include="-b;$(BUILD_BUILDNUMBER)" Condition="'$(BUILD_BUILDNUMBER)' != ''" /> | ||
<_CodecovArgs Include="--branch;$(_BranchName)" Condition="'$(_BranchName)' != ''" /> | ||
<_CodecovArgs Include="-c;$(BUILD_SOURCEVERSION)" Condition="'$(BUILD_SOURCEVERSION)' != ''" /> | ||
<_CodecovArgs Include="-n;$(BUILD_DEFINITIONNAME)" Condition="'$(BUILD_DEFINITIONNAME)' != ''" /> | ||
<_CodecovArgs Include="-t;$(CodeCovToken)" Condition="'$(CodeCovToken)' != ''" /> | ||
|
||
<_CodecovFlags Include="$(Configuration)" Condition="'$(Configuration)' != ''" /> | ||
<_CodecovProductionFlags Include="@(_CodecovFlags)" /> | ||
<_CodecovProductionFlags Include="production" /> | ||
<_CodecovTestFlags Include="@(_CodecovFlags)" /> | ||
<_CodecovTestFlags Include="test" /> | ||
</ItemGroup> | ||
|
||
<!-- Upload the coverage file with a 'production' flag, which will be filtered by codecov.io to production code --> | ||
<Message Importance="high" Text=""$(_CodecovPath)" @(_CodecovArgs, ' ') --flag @(_CodecovProductionFlags, ',')" /> | ||
<Exec Command=""$(_CodecovPath)" @(_CodecovArgs, ' ') --flag @(_CodecovProductionFlags, ',')" /> | ||
|
||
<!-- Upload the coverage file with a 'test' flag, which will be filtered by codecov.io to test code --> | ||
<Message Importance="high" Text=""$(_CodecovPath)" @(_CodecovArgs, ' ') --flag @(_CodecovTestFlags, ',')" /> | ||
<Exec Command=""$(_CodecovPath)" @(_CodecovArgs, ' ') --flag @(_CodecovTestFlags, ',')" /> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters