Skip to content
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

Testing all WinForms controls have unit tests coverage #10476

Merged
merged 27 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ba52ce9
Enabel code coverage on internal builds
Dec 28, 2023
056ea8c
Try to remove upload coverage to codevoc.io task, to see the results.
Dec 28, 2023
136e6ef
Remove upload coverage to codevoc.io task, and update filter type
Dec 28, 2023
e9eba65
Add upload data to codecov.io task back to pipeline
Jan 2, 2024
7827a92
Try to remove PublishCodeCoverageResults task from task
Jan 2, 2024
688de18
Add upload data to codecov.io task back to pipeline
Jan 2, 2024
3f7e0c8
fix conflicts
Jan 3, 2024
66761cf
Remove useless variable
Jan 4, 2024
153ac08
Test the path of reportTool
Jan 4, 2024
0a85dfc
Test the path of reportTool
Jan 4, 2024
6922ceb
Test the path of reportTool
Jan 4, 2024
02983f6
Test the path of reportTool
Jan 4, 2024
4258a4a
Test the path of reportTool
Jan 4, 2024
886ff59
Try to merge scripts
Jan 4, 2024
3268796
Try to merge scripts
Jan 4, 2024
bc37095
Merge the scripts, remove the redundant scripts
Jan 4, 2024
19f321d
Add code coverage to all automation test projects
Jan 5, 2024
a9a437f
Add VB automation test to code coverage repo
Jan 5, 2024
79e71d1
Merge branch 'main' into dev/v-weidzh/UnitTestCoverage
Jan 9, 2024
944123e
Revert useless changes
Jan 9, 2024
147d8c1
Revert useless changes
Jan 9, 2024
86af83f
Revert useless changes
Jan 9, 2024
70b13d8
Add the projects to Codecov
Jan 9, 2024
f6b8649
Adjust the includ projects to code coverage
Jan 10, 2024
1863f4a
Adjust the includ projects to code coverage
Jan 10, 2024
935334f
Adjust the includ projects to code coverage
Jan 10, 2024
5e38f6a
Adjust the includ projects to code coverage
Jan 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<SingleHit>true</SingleHit>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<CoverletOutputFormat>opencover</CoverletOutputFormat>
<Include>[System.Windows.*]*</Include>
<Include>[System.Windows.*]*,[Microsoft.VisualBasic.*]*</Include>
Tanya-Solyanik marked this conversation as resolved.
Show resolved Hide resolved
<!-- Exclude dependencies that embed their symbol information -->
<Exclude>[Microsoft.DotNet.XUnitExtensions]*,[InternalUtilitiesForTests*]*,[xunit*]*</Exclude>
<!-- Exclude anything tagged with Obsolete or with ExcludeFromCodeCoverage !!Avoid using this!! -->
Expand Down
17 changes: 15 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,29 @@ flags: # which files to include in the reporting
production:
paths:
- src/Common/src/
- src/Microsoft.VisualBasic/src/
- src/Microsoft.VisualBasic.Forms/src/
- src/System.Design/src/
- src/System.Drawing/src/
Copy link
Member

@Tanya-Solyanik Tanya-Solyanik Jan 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have to include System.Design and Drawing into reporting, do we still need it here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes here are mainly for Codecov.io, if, however, they are not needed, I will remove them in the PR adapted to Codecov.io.

- src/System.Drawing.Common/src/
- src/System.Drawing.Design/src/
- src/System.Private.Windows.Core/src/
- src/System.Windows.Forms/src/
- src/System.Windows.Forms.Analyzers/src/
- src/System.Windows.Forms.Analyzers.CSharp/src/
- src/System.Windows.Forms.Design/src/
- src/System.Windows.Forms.Design.Editors/src/
- src/System.Windows.Forms.Primitives/src/
- src/System.Windows.Forms.PrivateSourceGenerators/src/
Tanya-Solyanik marked this conversation as resolved.
Show resolved Hide resolved
test:
paths:
- src/Common/tests/
- src/System.Drawing.Design/tests/
- src/Microsoft.VisualBasic/tests/
- src/Microsoft.VisualBasic.Forms/tests/
- src/System.Drawing.Common/tests/
- src/System.Windows.Forms/tests/
- src/System.Windows.Forms.Analyzers/tests/
- src/System.Windows.Forms.Analyzers.CSharp/tests/
- src/System.Windows.Forms.Design/tests/
- src/System.Windows.Forms.Design.Editors/tests/
- src/System.Windows.Forms.Primitives/tests/
- src/System.Windows.Forms.PrivateSourceGenerators/tests/
4 changes: 2 additions & 2 deletions eng/CodeCoverage.proj
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

<!-- 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="&quot;$(_ReportGeneratorPath)&quot; &quot;-reports:@(_CoverageReports)&quot; -targetdir:$(BaseOutputPath)coverage -reporttypes:Cobertura" />
<Exec Command="&quot;$(_ReportGeneratorPath)&quot; &quot;-reports:@(_CoverageReports)&quot; -targetdir:$(BaseOutputPath)coverage -reporttypes:Cobertura" />
<Message Importance="high" Text="&quot;$(_ReportGeneratorPath)&quot; &quot;-reports:@(_CoverageReports)&quot; -targetdir:$(BaseOutputPath)coverage -reporttypes:Cobertura -filefilters:-*.g.cs" />
<Exec Command="&quot;$(_ReportGeneratorPath)&quot; &quot;-reports:@(_CoverageReports)&quot; -targetdir:$(BaseOutputPath)coverage -reporttypes:Cobertura -filefilters:-*.g.cs" />

<ItemGroup>
<_CodecovArgs Include="-f;$(BaseOutputPath)coverage\Cobertura.xml" />
Expand Down
14 changes: 12 additions & 2 deletions eng/pipelines/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
_SignType: test
# Code coverage uploads fail on internal PRs
${{ if eq(variables['System.TeamProject'], 'public') }}:
_Coverage: false
_Coverage: true
Release:
_BuildConfig: Release
_Coverage: false
Expand Down Expand Up @@ -141,7 +141,17 @@ jobs:
$(_InternalRuntimeDownloadArgs)
/bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\CodeCoverage-${{ parameters.targetArchitecture }}.binlog
displayName: Upload coverage to codecov.io
condition: and(succeeded(), eq(variables._Coverage, 'true'))
condition: and(succeeded(), eq(variables._Coverage, 'true'), eq('${{ parameters.targetArchitecture }}', 'x64'))

#Publish code coverage results
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: '$(Build.SourcesDirectory)\artifacts\bin\CodeCoverage\coverage\Cobertura.xml'
pathToSources: '$(Build.SourcesDirectory)'
reportDirectory: '$(Build.SourcesDirectory)\artifacts\bin\CodeCoverage\coverage'
displayName: PublishCodeCoverageResults
condition: and(eq(variables['_BuildConfig'], 'Debug'), eq('${{ parameters.targetArchitecture }}', 'x64'))

# Generate SBOM for the internal leg only
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
Expand Down
Loading