Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
523250b
PR pipeline runs will separate which tests they run:
paulmedynski Jan 21, 2026
15c9d8d
Re-wrote the code coverage job to:
paulmedynski Jan 23, 2026
8b7da18
- Moved code coverage job to Linux and streamlined it even further.
paulmedynski Jan 26, 2026
94ea4e2
Replaced PowerShell with native script calls to ensure compatibility …
paulmedynski Jan 26, 2026
fc27fd5
Working around a dotnet CLI bug related to tool installation.
paulmedynski Jan 26, 2026
73883db
Trying a different workaround for the dotnet CLI bug.
paulmedynski Jan 26, 2026
dbe5bbf
Trying to fix artifact download pattern.
paulmedynski Jan 27, 2026
dc05a6a
Removed unnecessary reportgenerator step.
paulmedynski Jan 27, 2026
358ac5a
Added Code Coverage configruation to only include driver code. We do…
paulmedynski Jan 27, 2026
f4ae237
Trying to get code coverage and symbols working for package builds.
paulmedynski Jan 28, 2026
1a06f29
Downloading NuGet and Symbols packages for test runs.
paulmedynski Jan 28, 2026
483cf95
Updated pipelines to generate symbols with nuget.
paulmedynski Jan 28, 2026
2aa3099
Using DotNetCoreCli on Unix instead of MSBuild.
paulmedynski Jan 28, 2026
aa195dd
Fixed incorrect MDS NuGet package version in CI runs.
paulmedynski Jan 28, 2026
66bd89f
Abandoning running unit and integration tests in separate pipelines, …
paulmedynski Jan 29, 2026
6ef1ea2
Reverted changes to blame config.
paulmedynski Jan 29, 2026
d85a1f3
Removed stale comments from PR pipelines.
paulmedynski Feb 10, 2026
327ea6d
Merge branch 'main' into dev/paul/duplicate-runs
paulmedynski Feb 10, 2026
ec25bc9
Merge branch 'main' into dev/paul/duplicate-runs
paulmedynski Feb 10, 2026
2fa8826
Addressed Copilot feedback.
paulmedynski Feb 10, 2026
5d2d5f4
Merge branch 'main' of github.com:dotnet/SqlClient into dev/paul/dupl…
mdaigle Feb 13, 2026
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
55 changes: 37 additions & 18 deletions eng/pipelines/common/templates/jobs/ci-code-coverage-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# pipeline, and uploads them to CodeCov.

parameters:

# True to include debug steps.
- name: debug
type: boolean
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
dotnet tool install --global dotnet-coverage
dotnet tool install --global dotnet-reportgenerator-globaltool
displayName: Install dotnet tools

- pwsh: |
Write-Host "Removing leftover coverage files from previous runs..."
Remove-Item $(netFxDir) -Recurse -Force -ErrorAction SilentlyContinue
Expand All @@ -83,6 +83,7 @@ jobs:
Remove-Item coveragereportNetFx -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item coveragereportNetCore -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item coveragereportAddOns -Recurse -Force -ErrorAction SilentlyContinue
displayName: Clean up from previous runs

- ${{ each targetFramework in parameters.targetFrameworks }}:
- task: DownloadPipelineArtifact@2
Expand Down Expand Up @@ -113,14 +114,20 @@ jobs:

$files = Get-ChildItem $InputDirectoryPath -Recurse -File -Filter *.coverage

# echo $files
if ($files.Count -eq 0) {
Write-Host "No coverage files found in $InputDirectoryPath"
return
}

Write-Host "Merging $($files.Count) coverage files from $InputDirectoryPath..."

mkdir $OutputDirectoryName
$counter=0

$toProcess = @()

foreach ($file in $files) {
$toProcess += @{
$toProcess += @{
File = $file.FullName
OutputFile = "$OutputDirectoryName\$counter.coveragexml"
}
Expand All @@ -130,13 +137,13 @@ jobs:

$jobs = @()
foreach ($file in $toProcess){
$jobs += Start-ThreadJob -ScriptBlock {
$jobs += Start-ThreadJob -ScriptBlock {
$params = $using:file
& dotnet-coverage merge $($params.File) --output $($params.OutputFile) --output-format xml
}
& dotnet-coverage merge $($params.File) --output $($params.OutputFile) --output-format xml
}
}

Write-Host "Merging started..."
Write-Host "Merging started with $($jobs.Count) parallel jobs..."
Wait-Job -Job $jobs

foreach ($job in $jobs) {
Expand All @@ -146,7 +153,7 @@ jobs:

MergeFiles -InputDirectoryPath "$(netFxDir)" -OutputDirectoryName "coverageNetFxXml"
MergeFiles -InputDirectoryPath "$(netCoreDir)" -OutputDirectoryName "coverageNetCoreXml"

Write-Host "Removing original coverage files..."
Remove-Item $(netFxDir) -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item $(netCoreDir) -Recurse -Force -ErrorAction SilentlyContinue
Expand All @@ -163,15 +170,15 @@ jobs:

- pwsh: |
$jobs = @()
$jobs += Start-ThreadJob -ScriptBlock {
$jobs += Start-ThreadJob -ScriptBlock {
& reportgenerator "-reports:coverageNetFxXml\*.coveragexml" "-targetdir:coveragereportNetFx" "-reporttypes:Cobertura;" "-assemblyfilters:+microsoft.data.sqlclient.dll" "-sourcedirs:$(Build.SourcesDirectory)\src\Microsoft.Data.SqlClient\netfx\src;$(Build.SourcesDirectory)\src\Microsoft.Data.SqlClient\src" "-classfilters:+Microsoft.Data.*"
}

$jobs += Start-ThreadJob -ScriptBlock {
$jobs += Start-ThreadJob -ScriptBlock {
& reportgenerator "-reports:coverageNetCoreXml\*.coveragexml" "-targetdir:coveragereportNetCore" "-reporttypes:Cobertura;" "-assemblyfilters:+microsoft.data.sqlclient.dll" "-sourcedirs:$(Build.SourcesDirectory)\src\Microsoft.Data.SqlClient\netcore\src;$(Build.SourcesDirectory)\src\Microsoft.Data.SqlClient\src" "-classfilters:+Microsoft.Data.*"
}

$jobs += Start-ThreadJob -ScriptBlock {
$jobs += Start-ThreadJob -ScriptBlock {
& reportgenerator "-reports:coverageNetCoreXml\*.coveragexml" "-targetdir:coveragereportAddOns" "-reporttypes:Cobertura;" "-assemblyfilters:+microsoft.data.sqlclient.alwaysencrypted.azurekeyvaultprovider.dll" "-sourcedirs:$(Build.SourcesDirectory)\src\Microsoft.Data.SqlClient\add-ons\AzureKeyVaultProvider" "-classfilters:+Microsoft.Data.*"
}

Expand Down Expand Up @@ -199,16 +206,28 @@ jobs:
- ${{if eq(parameters.upload, true)}}:
- pwsh: |
#download Codecov CLI
$ProgressPreference = 'SilentlyContinue'
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri https://cli.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe

./codecov --verbose upload-process --fail-on-error -t $(CODECOV_TOKEN) -f "coveragereportNetFx\Cobertura.xml" -F netfx
./codecov --verbose upload-process --fail-on-error -t $(CODECOV_TOKEN) -f "coveragereportNetCore\Cobertura.xml" -F netcore
./codecov --verbose upload-process --fail-on-error -t $(CODECOV_TOKEN) -f "coveragereportAddOns\Cobertura.xml" -F addons

# The CodeCov CLI fails if the report files aren't found, so confirm
# they exist before uploading.
if (Test-Path "coveragereportNetFx\Cobertura.xml")
{
./codecov --verbose upload-process --fail-on-error -t $(CODECOV_TOKEN) -f "coveragereportNetFx\Cobertura.xml" -F netfx
}
if (Test-Path "coveragereportNetCore\Cobertura.xml")
{
./codecov --verbose upload-process --fail-on-error -t $(CODECOV_TOKEN) -f "coveragereportNetCore\Cobertura.xml" -F netcore
}
if (Test-Path "coveragereportAddOns\Cobertura.xml")
{
./codecov --verbose upload-process --fail-on-error -t $(CODECOV_TOKEN) -f "coveragereportAddOns\Cobertura.xml" -F addons
}
displayName: Upload to CodeCov

- pwsh: |
Write-Host "Removing reports..."
Remove-Item coveragereportNetFx -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item coveragereportNetCore -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item coveragereportAddOns -Recurse -Force -ErrorAction SilentlyContinue
displayName: Clean up reports
15 changes: 15 additions & 0 deletions eng/pipelines/common/templates/jobs/ci-run-tests-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,19 @@ parameters:
type: boolean
default: false

# The type of tests to run:
#
# All - Run all tests.
# Unit - Only run tests that do not require external resources.
# Integration - Only run tests that require external resources.
#
- name: testType
type: string
values:
- All
- Unit
- Integration
Comment thread
paulmedynski marked this conversation as resolved.
Outdated

jobs:
- job: ${{ format('{0}', coalesce(parameters.jobDisplayName, parameters.image, 'unknown_image')) }}

Expand Down Expand Up @@ -269,6 +282,7 @@ jobs:
buildConfiguration: ${{ parameters.buildConfiguration }}
referenceType: ${{ parameters.buildType }}
testSet: ${{ parameters.testSet }}
testType: ${{ parameters.testType }}
operatingSystem: ${{ parameters.operatingSystem }}

- ${{ if and(eq(parameters.enableX86Test, true), eq(parameters.operatingSystem, 'Windows')) }}:
Expand All @@ -293,6 +307,7 @@ jobs:
buildConfiguration: ${{ parameters.buildConfiguration }}
referenceType: ${{ parameters.buildType }}
testSet: ${{ parameters.testSet }}
testType: ${{ parameters.testType }}
msbuildArchitecture: x86
dotnetx86RootPath: $(dotnetx86RootPath)
operatingSystem: ${{ parameters.operatingSystem }}
Expand Down
15 changes: 15 additions & 0 deletions eng/pipelines/common/templates/stages/ci-run-tests-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ parameters:
- name: testJobTimeout
type: number

# The type of tests to run:
#
# All - Run all tests.
# Unit - Only run tests that do not require external resources.
# Integration - Only run tests that require external resources.
#
- name: testType
type: string
values:
- All
- Unit
- Integration
Comment thread
paulmedynski marked this conversation as resolved.
Outdated

stages:
- ${{ each config in parameters.testConfigurations }}:
- ${{ each image in config.value.images }}:
Expand Down Expand Up @@ -67,6 +80,7 @@ stages:
targetFramework: ${{ targetFramework }}
netcoreVersionTestUtils: ${{config.value.netcoreVersionTestUtils }}
testSet: ${{ testSet }}
testType: ${{ parameters.testType }}
${{ each codeCoveTF in config.value.codeCovTargetFrameworks }}:
Comment thread
paulmedynski marked this conversation as resolved.
${{ if eq(codeCoveTF, targetFramework) }}:
publishTestResults: true
Expand Down Expand Up @@ -99,6 +113,7 @@ stages:
targetFramework: ${{ targetFramework }}
netcoreVersionTestUtils: ${{config.value.netcoreVersionTestUtils }}
testSet: ${{ testSet }}
testType: ${{ parameters.testType }}
${{ each codeCoveTF in config.value.codeCovTargetFrameworks }}:
${{ if eq(codeCoveTF, targetFramework) }}:
publishTestResults: true
Expand Down
Loading
Loading