-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Establish Code Coverage for WinForms testing #514
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b40c798
include coverlet.msbuild 2.5.1
4de3fd2
add targets and coverage group
562722b
mock dotnet/machinelearning#2843
2b214bc
Hook coverlet up to the 'RunTests' target
sharwell 55f105b
Merge remote-tracking branch 'dotnet/master' into dev/zadanz/coverage
sharwell c84a592
Upload data to codecov.io
sharwell 97b0364
Add code coverage badge to the README
sharwell 7d1c155
Merge remote-tracking branch 'dotnet/master' into dev/zadanz/coverage
sharwell 3133d13
Add clarifying comments for code coverage configuration
sharwell 2248865
Move coverage upload after pick/sign/publish
sharwell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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/ | ||
zsd4yr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - 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 hidden or 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> | ||
zsd4yr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <_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" /> | ||
zsd4yr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <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)' != ''" /> | ||
zsd4yr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <_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)' != ''" /> | ||
zsd4yr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <_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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.