Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
348b96b
Setting runsettings file for code coverage,
May 28, 2025
aff2ce1
try using dotnet test,
fhnaseer May 28, 2025
004a771
fixing env var,
fhnaseer May 28, 2025
5ddd772
generating trx report,
fhnaseer May 28, 2025
53388ea
trying UseVSTestRunner,
fhnaseer May 29, 2025
d4414a5
passing correct arguments,
fhnaseer May 29, 2025
200a51b
passing correct args,
fhnaseer May 29, 2025
8299f54
another try,
fhnaseer May 29, 2025
1ba1822
enable coverage,
fhnaseer May 29, 2025
baa73be
adding direct reference of codecoverage,
fhnaseer May 29, 2025
e1dfc77
fixing testrunner,
fhnaseer May 29, 2025
2926912
passing coverage path,
fhnaseer May 29, 2025
4f245e3
hardcoding path,
fhnaseer May 29, 2025
3ccc131
disable coverage,
fhnaseer May 29, 2025
5a75149
Enabling coverage,
fhnaseer May 29, 2025
16a0f13
publish coverage reports,
fhnaseer May 29, 2025
1f20fd6
remove duplicate,
fhnaseer May 29, 2025
ec3d5d3
fixing trait,
fhnaseer May 29, 2025
c4d754b
fixing coverage path,
fhnaseer May 29, 2025
3eb786e
creating cobertura report,
fhnaseer May 29, 2025
8fbd007
fix filename,
fhnaseer May 29, 2025
c5f64c8
merging coverage reports,
fhnaseer May 29, 2025
9998a35
fixing script path,
fhnaseer May 29, 2025
14da1ad
adding more scripts,
fhnaseer May 29, 2025
5471896
updating runsettings,
fhnaseer May 29, 2025
cde5233
cleaning,
fhnaseer May 30, 2025
0aca8b7
more cleaning,
fhnaseer May 30, 2025
4714c15
fix casing,
fhnaseer May 30, 2025
07894c3
creating separate directory for merged coverage,
fhnaseer May 30, 2025
dfd7f1f
refactor,
fhnaseer May 30, 2025
527fd08
fix,
fhnaseer May 30, 2025
4453ca9
fixing script,
fhnaseer May 30, 2025
a12da48
fix name,
fhnaseer May 30, 2025
bf980e1
fixing filters,
fhnaseer May 30, 2025
27abc47
fixing filter,
fhnaseer May 30, 2025
5be770a
fixing filter,
fhnaseer May 30, 2025
9528937
trying quotes,
fhnaseer May 30, 2025
3e1e99b
install coverage dependencies,
fhnaseer May 30, 2025
483fdc3
fix,
fhnaseer May 30, 2025
272dfce
temporary workaround,
fhnaseer May 30, 2025
33470c8
disable coverage,
fhnaseer May 30, 2025
c1c0873
enable coverage,
fhnaseer Jun 2, 2025
beaa5a4
fixing parameters,
fhnaseer Jun 2, 2025
9d872b3
fix publish,
fhnaseer Jun 2, 2025
8f139ff
fix string,
fhnaseer Jun 2, 2025
34861ad
fix path for non windows,
fhnaseer Jun 2, 2025
a1e4f6b
Merge branch 'main' into main
fhnaseer Jun 4, 2025
5c0ee81
Merge branch 'main' into main
YuliiaKovalova Jul 7, 2025
1cff909
Rename file name to avoid the conflict
GangWang01 Aug 7, 2025
98f2dea
Reset build environment with running tests enabled
GangWang01 Aug 11, 2025
422dff1
For FileMatcher tests disable failing on drive enumerating wildcard d…
GangWang01 Aug 12, 2025
b4acb8e
Change code coverage setting that affects the test execution.
GangWang01 Aug 13, 2025
4cf9393
Get coverage settings back to check
GangWang01 Aug 13, 2025
b671cf6
Merge branch 'main' into main
GangWang01 Aug 14, 2025
05362e2
Ensure ending build in case assertion failure happens
GangWang01 Aug 18, 2025
99f56cd
Disable EnableDynamicManagedInstrumentation
GangWang01 Aug 19, 2025
d015206
Enable StaticManagedInstrumentation
GangWang01 Aug 19, 2025
8d7948f
Reset static member CommandLineSwitches.SwitchesFromResponseFiles to …
GangWang01 Aug 27, 2025
a05ef3d
Reset OpenTelemetryManager state to not affect other tests
GangWang01 Sep 3, 2025
d2aeac3
Fix the test failure of DebugUtils_Tests
GangWang01 Sep 3, 2025
0557fd3
Merge branch 'main' into main
GangWang01 Sep 4, 2025
add2fbf
Enable DynamicManagedInstrumentation but disable StaticManagedInstrum…
GangWang01 Sep 4, 2025
a4f5791
Exclude the modules to make the affected tests pass
GangWang01 Sep 11, 2025
114489e
Increase timeout for buildcheck end to end tests
GangWang01 Sep 11, 2025
4b6493c
Merge branch 'main' into main
fhnaseer Sep 29, 2025
cf79ed7
removing publish code coverage,
Sep 29, 2025
350f700
Merge branch 'main' of https://github.com/fhnaseer/msbuild
Sep 29, 2025
e3bc4d3
adding separate settings for windows,
Sep 29, 2025
bc0cb51
more disable,
Sep 29, 2025
a509f9c
coverage for only core projects,
Sep 29, 2025
94fd402
adding test-tools feed,
Sep 29, 2025
3c4d338
fixing feed,
Sep 29, 2025
7635aa7
running only specific tests for windows,
Sep 29, 2025
9bafcfc
removing include,
Sep 30, 2025
ed68cf4
fix,
Sep 30, 2025
63e8921
fix,
Sep 30, 2025
1f5a980
more,
Sep 30, 2025
157c034
fix,
Sep 30, 2025
9ce76d3
adding include,
Sep 30, 2025
fe63e7d
more,
Sep 30, 2025
9e02a82
coverage for netcore only,
Sep 30, 2025
e2839a7
publish coverage report,
Sep 30, 2025
148086b
fixing coverage publish,
Sep 30, 2025
e29ecf6
revert,
Sep 30, 2025
578db20
Merge branch 'main' into main
fhnaseer Oct 1, 2025
d50f20c
dont publish coverage report if failure,
Oct 1, 2025
9a3ad5b
Merge branch 'main' of https://github.com/fhnaseer/msbuild
Oct 1, 2025
530333b
more,
Oct 1, 2025
4542d00
disable coverage for windows,
Oct 1, 2025
674ab94
Merge branch 'main' into main
YuliiaKovalova Oct 6, 2025
44214b7
Disable unstable code coverage task on Windows and add explanation
YuliiaKovalova Oct 6, 2025
470d10c
Add exclusions for additional DLLs in coverage settings
YuliiaKovalova Oct 6, 2025
94ce93b
Merge branch 'main' into main
YuliiaKovalova Oct 6, 2025
25ae48b
Add exclusions for additional DLLs in coverage settings
YuliiaKovalova Oct 6, 2025
cd493e7
Skip test case for floating failure investigation
YuliiaKovalova Oct 7, 2025
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
198 changes: 175 additions & 23 deletions .vsts-dotnet-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,17 @@ jobs:
Write-Host "##vso[task.setvariable variable=onlyDocChanged;isoutput=true]$onlyDocChanged"
name: SetIfOnlyDocumentionChangedVaribale
displayName: Check whether only documentation has been updated

- job: BootstrapMSBuildOnFullFrameworkWindows
dependsOn: IfOnlyDocumentionChanged
variables:
onlyDocChanged: $[ dependencies.IfOnlyDocumentionChanged.outputs['SetIfOnlyDocumentionChangedVaribale.onlyDocChanged'] ]
coverageArtifactsDir: $(Build.SourcesDirectory)/CoverageStaging
coverageReportName: WindowsFullFrameworkCoverage
displayName: "Windows Full"
pool:
vmImage: 'windows-2022'
timeoutInMinutes: 120
steps:
- ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
- task: PowerShell@2
Expand All @@ -91,12 +95,29 @@ jobs:
arguments: -onlyDocChanged $(onlyDocChanged)
env:
ForceUseXCopyMSBuild: 1
# Task to collect code coverage on Windows. Disabled by default due to being unstable and sometimes it stucks forever
# - task: PowerShell@2
# displayName: Process coverage reports
# continueOnError: false
# condition: eq(variables.onlyDocChanged, 0)
# inputs:
# filePath: $(Build.SourcesDirectory)\eng\process-coverage.ps1
# arguments: -repoRoot $(Build.SourcesDirectory) -coverageArtifactsDir $(coverageArtifactsDir) -coverageReportName $(coverageReportName)
# pwsh: true
# - task: PublishPipelineArtifact@1
# displayName: Publish Code Coverage Results
# continueOnError: false
# condition: eq(variables.onlyDocChanged, 0)
# inputs:
# targetPath: $(coverageArtifactsDir)/$(coverageReportName).coverage
# artifact: $(coverageReportName)
# publishLocation: 'pipeline'
- task: PublishTestResults@2
displayName: Publish .NET Framework Test Results
inputs:
testRunTitle: 'Windows-on-full Full Framework'
testRunner: XUnit
testResultsFiles: 'artifacts/TestResults/Debug/*UnitTests_net472*.xml'
testRunner: VSTest
testResultsFiles: 'artifacts/TestResults/Debug/*UnitTests_net472*.trx'
publishRunAttachments: true
mergeTestResults: true
continueOnError: true
Expand All @@ -105,10 +126,10 @@ jobs:
displayName: Publish .NET Test Results
inputs:
testRunTitle: 'Windows-on-full .NET'
testRunner: XUnit
testRunner: VSTest
testResultsFiles: |
artifacts/TestResults/**/*.xml
!**/*UnitTests_net472*.xml
artifacts/TestResults/**/*.trx
!**/*UnitTests_net472*.trx
publishRunAttachments: true
mergeTestResults: true
continueOnError: true
Expand Down Expand Up @@ -156,14 +177,16 @@ jobs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)\Verify'
ArtifactName: 'Windows-on-full Verify $(System.JobAttempt)'


- job: BootstrapMSBuildOnCoreWindows
displayName: "Windows Core"
dependsOn: IfOnlyDocumentionChanged
variables:
onlyDocChanged: $[ dependencies.IfOnlyDocumentionChanged.outputs['SetIfOnlyDocumentionChangedVaribale.onlyDocChanged'] ]
coverageArtifactsDir: $(Build.SourcesDirectory)/CoverageStaging
coverageReportName: WindowsCoreCoverage
pool:
vmImage: 'windows-2022'
timeoutInMinutes: 120
steps:
- ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
- task: PowerShell@2
Expand All @@ -180,12 +203,29 @@ jobs:
arguments: '-msbuildEngine dotnet -onlyDocChanged $(onlyDocChanged)'
env:
MSBUILDUSESERVER: "1"
# Task to collect code coverage on Windows. Disabled by default due to being unstable and sometimes it stucks forever
# - task: PowerShell@2
# displayName: Process coverage reports
# continueOnError: false
# condition: eq(variables.onlyDocChanged, 0)
# inputs:
# filePath: $(Build.SourcesDirectory)\eng\process-coverage.ps1
# arguments: -repoRoot $(Build.SourcesDirectory) -coverageArtifactsDir $(coverageArtifactsDir) -coverageReportName $(coverageReportName)
# pwsh: true
# - task: PublishPipelineArtifact@1
# displayName: Publish Code Coverage Results
# continueOnError: false
# condition: eq(variables.onlyDocChanged, 0)
# inputs:
# targetPath: $(coverageArtifactsDir)/$(coverageReportName).coverage
# artifact: $(coverageReportName)
# publishLocation: 'pipeline'
- task: PublishTestResults@2
displayName: Publish .NET Framework Test Results
inputs:
testRunTitle: 'Windows-on-Core Full Framework'
testRunner: XUnit
testResultsFiles: 'artifacts/TestResults/Debug/*UnitTests_net472*.xml'
testRunner: VSTest
testResultsFiles: 'artifacts/TestResults/Debug/*UnitTests_net472*.trx'
publishRunAttachments: true
mergeTestResults: true
continueOnError: true
Expand All @@ -194,10 +234,10 @@ jobs:
displayName: Publish .NET Test Results
inputs:
testRunTitle: 'Windows-on-Core .NET'
testRunner: XUnit
testRunner: VSTest
testResultsFiles: |
artifacts/TestResults/**/*.xml
!**/*UnitTests_net472*.xml
artifacts/TestResults/**/*.trx
!**/*UnitTests_net472*.trx
publishRunAttachments: true
mergeTestResults: true
continueOnError: true
Expand All @@ -222,13 +262,16 @@ jobs:
dependsOn: IfOnlyDocumentionChanged
variables:
onlyDocChanged: $[ dependencies.IfOnlyDocumentionChanged.outputs['SetIfOnlyDocumentionChangedVaribale.onlyDocChanged'] ]
coverageArtifactsDir: $(Build.SourcesDirectory)/CoverageStaging
coverageReportName: WindowsFullReleaseCoverage
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: NetCore-Public
demands: ImageOverride -equals windows.vs2022preview.scout.amd64.open
${{ if ne(variables['System.TeamProject'], 'public') }}:
name: VSEngSS-MicroBuild2022-1ES
demands: agent.os -equals Windows_NT
timeoutInMinutes: 120
steps:
- ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
- task: PowerShell@2
Expand All @@ -250,12 +293,29 @@ jobs:
filename: 'eng/cibuild.cmd'
arguments: '-configuration Release'
condition: eq(variables.onlyDocChanged, 1)
# Task to collect code coverage on Windows. Disabled by default due to being unstable and sometimes it stucks forever
# - task: PowerShell@2
# displayName: Process coverage reports
# continueOnError: false
# condition: eq(variables.onlyDocChanged, 0)
# inputs:
# filePath: $(Build.SourcesDirectory)\eng\process-coverage.ps1
# arguments: -repoRoot $(Build.SourcesDirectory) -coverageArtifactsDir $(coverageArtifactsDir) -coverageReportName $(coverageReportName)
# pwsh: true
# - task: PublishPipelineArtifact@1
# displayName: Publish Code Coverage Results
# continueOnError: false
# condition: eq(variables.onlyDocChanged, 0)
# inputs:
# targetPath: $(coverageArtifactsDir)/$(coverageReportName).coverage
# artifact: $(coverageReportName)
# publishLocation: 'pipeline'
- task: PublishTestResults@2
displayName: Publish .NET Framework Test Results
inputs:
testRunTitle: 'Windows-on-full Release Full Framework'
testRunner: XUnit
testResultsFiles: 'artifacts/TestResults/Release/*UnitTests_net472*.xml'
testRunner: VSTest
testResultsFiles: 'artifacts/TestResults/Release/*UnitTests_net472*.trx'
publishRunAttachments: true
mergeTestResults: true
continueOnError: true
Expand All @@ -264,10 +324,10 @@ jobs:
displayName: Publish .NET Test Results
inputs:
testRunTitle: 'Windows-on-full Release .NET'
testRunner: XUnit
testRunner: VSTest
testResultsFiles: |
artifacts/TestResults/**/*.xml
!**/*UnitTests_net472*.xml
artifacts/TestResults/**/*.trx
!**/*UnitTests_net472*.trx
publishRunAttachments: true
mergeTestResults: true
continueOnError: true
Expand Down Expand Up @@ -303,18 +363,35 @@ jobs:
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- bash: sudo apt-get update
- bash: sudo apt-get install -y libxml2
- bash: . 'eng/cibuild_bootstrapped_msbuild.sh' --onlyDocChanged $(onlyDocChanged)
displayName: CI Build
env:
MSBUILDUSESERVER: "1"
- task: Bash@3
displayName: Process coverage reports
continueOnError: false
condition: eq(variables.onlyDocChanged, 0)
inputs:
filePath: $(Build.SourcesDirectory)/eng/process-coverage.sh
arguments: --repoRoot $(Build.SourcesDirectory)
- task: PublishPipelineArtifact@1
displayName: Publish Code Coverage Results
continueOnError: false
condition: eq(variables.onlyDocChanged, 0)
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/CoverageResults/merged.coverage'
artifact: 'LinuxCoreCoverage'
publishLocation: 'pipeline'
- task: PublishTestResults@2
displayName: Publish .NET Test Results
inputs:
testRunTitle: 'Linux .NET'
testRunner: XUnit
testRunner: VSTest
testResultsFiles: |
artifacts/TestResults/**/*.xml
!**/*UnitTests_net472*.xml
artifacts/TestResults/**/*.trx
!**/*UnitTests_net472*.trx
publishRunAttachments: true
mergeTestResults: true
continueOnError: true
Expand Down Expand Up @@ -382,14 +459,29 @@ jobs:
displayName: CI Build
env:
MSBUILDUSESERVER: "1"
- task: Bash@3
displayName: Process coverage reports
continueOnError: false
condition: eq(variables.onlyDocChanged, 0)
inputs:
filePath: $(Build.SourcesDirectory)/eng/process-coverage.sh
arguments: --repoRoot $(Build.SourcesDirectory)
- task: PublishPipelineArtifact@1
displayName: Publish Code Coverage Results
continueOnError: false
condition: eq(variables.onlyDocChanged, 0)
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/CoverageResults/merged.coverage'
artifact: 'MacCoreCoverage'
publishLocation: 'pipeline'
- task: PublishTestResults@2
displayName: Publish .NET Test Results
inputs:
testRunTitle: 'macOS .NET'
testRunner: XUnit
testRunner: VSTest
testResultsFiles: |
artifacts/TestResults/**/*.xml
!**/*UnitTests_net472*.xml
artifacts/TestResults/**/*.trx
!**/*UnitTests_net472*.trx
publishRunAttachments: true
mergeTestResults: true
continueOnError: true
Expand Down Expand Up @@ -437,4 +529,64 @@ jobs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/Verify'
ArtifactName: 'macOS Verify $(System.JobAttempt)'

- template: /eng/common/templates/jobs/source-build.yml
- job: CodeCoverage
displayName: "Code Coverage"
dependsOn:
- BootstrapMSBuildOnFullFrameworkWindows
- BootstrapMSBuildOnCoreWindows
- FullReleaseOnWindows
- CoreBootstrappedOnLinux
- CoreOnMac
pool:
vmImage: 'windows-2022'
steps:
# Task to collect code coverage on Windows. Disabled by default due to being unstable and sometimes it stucks forever
# - task: DownloadPipelineArtifact@2
# inputs:
# buildType: 'current'
# artifactName: 'WindowsFullFrameworkCoverage'
# targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults/CoverageResults/WindowsFullFramework'
# - task: DownloadPipelineArtifact@2
# inputs:
# buildType: 'current'
# artifactName: 'WindowsCoreCoverage'
# targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults/CoverageResults/WindowsCore'
# - task: DownloadPipelineArtifact@2
# inputs:
# buildType: 'current'
# artifactName: 'WindowsFullReleaseCoverage'
# targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults/CoverageResults/WindowsFullRelease'
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'LinuxCoreCoverage'
targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults/CoverageResults/LinuxCore'
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'MacCoreCoverage'
targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults/CoverageResults/MacCore'

- task: PowerShell@2
displayName: Process coverage reports
inputs:
filePath: $(Build.SourcesDirectory)\eng\process-coverage.ps1
arguments: -repoRoot $(Build.SourcesDirectory) -coverageArtifactsDir $(Build.SourcesDirectory)/artifacts/CoverageResults
pwsh: true
- task: PublishBuildArtifacts@1
displayName: Publish Artifact $(Build.BuildNumber) Coverage
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/CoverageResults/merged.coverage'
ArtifactName: '$(Build.BuildNumber) Coverage'
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: Publish Artifact $(Build.BuildNumber) Cobertura
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/CoverageResults/merged.cobertura.xml'
ArtifactName: '$(Build.BuildNumber) Cobertura'
condition: succeededOrFailed()
- task: PublishCodeCoverageResults@2
inputs:
summaryFileLocation: '$(Build.SourcesDirectory)/artifacts/CoverageResults/merged.coverage'
pathToSources: $(Build.SourcesDirectory)
- template: /eng/common/templates/jobs/source-build.yml
43 changes: 43 additions & 0 deletions Coverage.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="Code Coverage"
uri="datacollector://Microsoft/CodeCoverage/2.0"
assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Configuration>
<DeterministicReport>True</DeterministicReport>
<IncludeTestAssembly>true</IncludeTestAssembly>
<ExcludeAssembliesWithoutSources>MissingAll</ExcludeAssembliesWithoutSources>
<CodeCoverage>
<ModulePaths>
<Exclude>
<ModulePath>.*doc\.dll$</ModulePath>
<ModulePath>.*customlogger\.dll$</ModulePath>
<ModulePath>.*invalidcustomcheck\.dll$</ModulePath>
<ModulePath>.*portabletask\.dll$</ModulePath>
<ModulePath>.*faultylogger\.dll$</ModulePath>
<ModulePath>.*customcheck\.dll$</ModulePath>
<ModulePath>.*customcheck2\.dll$</ModulePath>
<ModulePath>.*errorcustomcheck\.dll$</ModulePath>
</Exclude>
</ModulePaths>
<Sources>
<Exclude>
<Source>.*\.g\.cs$</Source>
<Source>.*\.sr\.cs$</Source>
</Exclude>
</Sources>
<CommunicationTimeout>120000</CommunicationTimeout>
<PipeClientsCount>1270</PipeClientsCount>
<UseVerifiableInstrumentation>False</UseVerifiableInstrumentation>
<EnableStaticNativeInstrumentation>True</EnableStaticNativeInstrumentation>
<EnableDynamicNativeInstrumentation>False</EnableDynamicNativeInstrumentation>
<EnableStaticManagedInstrumentation>False</EnableStaticManagedInstrumentation>
<EnableDynamicManagedInstrumentation>True</EnableDynamicManagedInstrumentation>
</CodeCoverage>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>
Loading