-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Establish Code Coverage for WPF testing #10346
Open
singhashish-wpf
wants to merge
2
commits into
dotnet:main
Choose a base branch
from
singhashish-wpf:codecov
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+148
−1
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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,35 @@ | ||
# https://docs.codecov.io/docs/codecov-yaml | ||
# https://github.com/codecov/support/wiki/Codecov-Yaml | ||
|
||
coverage: | ||
range: 20..80 # 20 is red, 80 is green | ||
round: down # always round down | ||
precision: 5 # highest level of decimal precision | ||
status: | ||
project: | ||
default: false | ||
patch: | ||
default: false | ||
fixes: | ||
- "eng/::/" | ||
|
||
comment: | ||
layout: "diff, flags" # coverage difference, flags below | ||
|
||
flags: # which files to include in the reporting | ||
production: | ||
paths: | ||
- src\Microsoft.DotNet.Wpf\src | ||
- src\Microsoft.DotNet.Wpf\src\PresentationFramework | ||
- src\Microsoft.DotNet.Wpf\src\PresentationCore | ||
- src\Microsoft.DotNet.Wpf\src\PresentationUI | ||
- src\Microsoft.DotNet.Wpf\src\ReachFramework | ||
- src\Microsoft.DotNet.Wpf\src\System.Xaml | ||
test: | ||
paths: | ||
- tests/ | ||
- src\Microsoft.DotNet.Wpf\tests\UnitTests\WindowsBase.Tests | ||
- src\Microsoft.DotNet.Wpf\tests\UnitTests\PresentationCore.Tests | ||
- src\Microsoft.DotNet.Wpf\tests\UnitTests\PresentationFramework.Fluent.Tests | ||
- src\Microsoft.DotNet.Wpf\tests\UnitTests\System.Printing.Tests | ||
- src\Microsoft.DotNet.Wpf\tests\UnitTests\System.Xaml.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
Oops, something went wrong.
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.
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.
These aren't necessary since they are just subsets of the line before it.