Add sqlclient-ci-managed-instance CI pipeline - #4482
Conversation
Add a package-triggered CI pipeline that runs the SqlClient Unit, Functional, and Manual test suites against an Azure SQL Managed Instance in Package reference mode, based on the exported Classic Test-SqlClient-Managed-Instance pipeline. - New pipeline trio under eng/pipelines/ci/managed-instance/ (pipeline, stage, job). Triggered by successful sqlclient-ci-package runs (like sqlclient-ci-stress) and registered in the ADO.Net project only, since it depends on the Managed-Instance-pool and the "ADO Test Configuration Properties" variable group. Runs on Windows (native + managed SNI) and Linux, letting build.proj default to all host-OS TFMs and all manual test sets. - Extract the driver-package download + version resolution into a shared eng/pipelines/common/steps/download-driver-packages-step.yml and refactor the stress job to use it. - Add an IsManagedInstance parameter to update-config-file-step.yml.
The Linux job in the stage does not pass useManagedSNI (it is only relevant to UseManagedSNIOnWindows), so the job parameter needs a default to satisfy pipeline validation.
There was a problem hiding this comment.
Pull request overview
Adds a new Azure DevOps CI pipeline to run SqlClient Unit/Functional/Manual tests against an Azure SQL Managed Instance in Package reference mode, triggered by sqlclient-ci-package, and refactors package-download/version-resolution logic into a shared template to reduce duplication.
Changes:
- Introduces a new managed-instance pipeline trio under
eng/pipelines/ci/managed-instance/(pipeline + stage + job templates). - Adds a shared
download-driver-packages-step.ymltemplate and updates the existing stress CI job to reuse it. - Extends
update-config-file-step.ymlwith anIsManagedInstanceswitch to enable MI-specific test behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| eng/pipelines/common/templates/steps/update-config-file-step.yml | Adds IsManagedInstance parameter and writes it into generated test config. |
| eng/pipelines/common/steps/download-driver-packages-step.yml | New reusable step to download driver package artifacts and resolve package versions into pipeline variables. |
| eng/pipelines/ci/stress/sqlclient-ci-stress-job.yml | Refactors to use the new shared download/resolve template and consumes the new version variable name. |
| eng/pipelines/ci/managed-instance/sqlclient-ci-managed-instance-stage.yml | New stage that fans out MI test jobs across Windows (native/managed SNI) and Linux. |
| eng/pipelines/ci/managed-instance/sqlclient-ci-managed-instance-pipeline.yml | New pipeline definition triggered by sqlclient-ci-package runs. |
| eng/pipelines/ci/managed-instance/sqlclient-ci-managed-instance-job.yml | New job template that sets up MI test config and runs the test suites across the requested TFMs. |
| operatingSystem: Linux | ||
| # No .NET Framework runtimes on Linux. | ||
| netFrameworkTestRuntimes: [] | ||
| netTestRuntimes: ${{ parameters.netTestRuntimes }} | ||
| vmImage: ADO-UB22-SQL22 |
| parameters: | ||
| debug: ${{ parameters.debug }} | ||
| # The Managed Instance connection strings carry their own credentials, so no local SA | ||
| # password is used here; pass an empty string for the required saPassword parameter. | ||
| saPassword: '' |
| # Pipeline parameters, visible in the Azure DevOps UI. | ||
| parameters: | ||
|
|
||
| # The build configuration to use when building the; defaults to Release. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (3)
eng/pipelines/common/steps/download-driver-packages-step.yml:109
- After updating Resolve-PackageVersion to operate on the artifact directory, this call site should pass
$artifactDir(the downloaded artifact contents) instead of$feedto avoid being affected by any pre-existing packages in the local feed.
foreach ($p in $packages) {
$version = Resolve-PackageVersion $feed $p.Pattern $p.Name
Write-Host "Resolved $($p.Name) version: $version"
Write-Host "##vso[task.setvariable variable=$($p.Variable)]$version"
eng/pipelines/ci/managed-instance/sqlclient-ci-managed-instance-pipeline.yml:45
- Minor grammar issue in the parameter comment ("building the;") makes the pipeline description harder to read in the UI.
# The build configuration to use when building the; defaults to Release.
eng/pipelines/common/steps/download-driver-packages-step.yml:74
- Resolve-PackageVersion searches in the destination feed directory, which may already contain older .nupkg files on self-hosted agents. That can cause non-deterministic version selection via
Select-Object -First 1and pass the wrong versions to downstream steps. Resolve versions from the just-downloaded artifact directory and fail if there isn’t exactly one match.
This issue also appears on line 106 of the same file.
# Resolve the version of a single package from its .nupkg filename in the feed.
function Resolve-PackageVersion($feed, $pattern, $name) {
$pkg = Get-ChildItem "$feed/*.nupkg" | Where-Object { $_.Name -match $pattern } | Select-Object -First 1
if (-not $pkg) { throw "$name package not found in $feed" }
return [regex]::Match($pkg.Name, $pattern).Groups[1].Value
}
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4482 +/- ##
==========================================
- Coverage 64.65% 62.67% -1.98%
==========================================
Files 288 283 -5
Lines 44011 66930 +22919
==========================================
+ Hits 28455 41948 +13493
- Misses 15556 24982 +9426
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Adds a new CI pipeline that runs the SqlClient Unit, Functional, and Manual test suites against an Azure SQL Managed Instance, in Package reference mode, based on the exported Classic
Test-SqlClient-Managed-Instancepipeline.Engineering process / CI changes:
eng/pipelines/ci/managed-instance/(-pipeline,-stage,-job):sqlclient-ci-packagepipeline (same pattern assqlclient-ci-stress); no PR/commit/schedule triggers.Managed-Instance-pooland theADO Test Configuration Propertiesvariable group (MI connection strings), neither of which exist in the Public project.ReferenceType=Packageagainst the exact package versions downloaded fromsqlclient-ci-package.build.projuse its defaults for TFM selection (all host-OS TFMs) and test set (all manual tests, matching the Classic pipeline), so Always Encrypted (Set=AE) coverage is preserved.eng/pipelines/common/steps/download-driver-packages-step.ymlthat downloads theSqlClient-Driver-Packagesartifact, stages it into the local NuGet feed, and resolves the driver package versions. Thesqlclient-ci-stressjob is refactored to reuse it (removing duplicated inline logic).update-config-file-step.yml: adds anIsManagedInstanceparameter so the test config can opt into Managed-Instance-specific behavior.No product code or public API changes — this is CI/pipeline-only.
Testing