Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the stress-test Azure DevOps pipeline resource configuration and adjusts Managed SNI SPN generation so named-instance connections without a protocol prefix use the SSRP-resolved port (with added unit test coverage).
Changes:
- Update Managed SNI SPN postfix selection to use SSRP-resolved port for non-NP protocols when connecting to named instances (incl.
Protocol.None/admin:). - Add unit tests covering SPN generation for
Protocol.None,tcp:,np:,admin:, and customServerSPN. - Fix the stress pipeline resource
sourcepath for the ADO.Net “MDS Main CI” pipeline.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/ManagedSni/SniProxyGetSqlServerSPNsTest.cs |
Adds regression/unit tests for SPN construction across protocols and custom SPN override. |
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniProxy.netcore.cs |
Adjusts SPN postfix logic to prefer SSRP-resolved port for non-NP named-instance connections; exposes helpers for unit testing. |
eng/pipelines/stress/stress-tests-pipeline.yml |
Updates the referenced ADO.Net pipeline folder/name for the stress pipeline resource trigger. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4198 +/- ##
==========================================
- Coverage 66.63% 65.64% -1.00%
==========================================
Files 279 271 -8
Lines 42999 65716 +22717
==========================================
+ Hits 28651 43137 +14486
- Misses 14348 22579 +8231
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
eng/pipelines/stress/stress-tests-job.yml:100
dotnetArtifactsDiris still defined but is no longer used after removing--artifacts-path $(dotnetArtifactsDir)fromdotnetArguments. Either remove this variable or reintroduce its usage so the job definition stays minimal and avoids confusion about where build outputs are expected.
# The directory where dotnet artifacts will be staged. Not to be
# confused with pipeline artifacts.
- name: dotnetArtifactsDir
value: $(Build.StagingDirectory)/dotnetArtifacts
- Import 'ADO Test Configuration Properties' variable group so the configure-sql-server-win-step template gets x64AliasRegistryPath and other SQL alias variables it expects. - Align stress test TargetFrameworks with SqlClient's shipped TFMs (net8.0;net9.0) to avoid assembly version mismatches when running net8.0 tests built with the .NET 10 SDK. - Add NuGetAuthenticate@1 step before the build so hosted pool agents (macOS) can fetch upstream packages through the ADO Artifacts feed.
- Move 'ADO Test Configuration Properties' variable group from stage to job template so it is not shadowed by the job's own variables block. - Remove --artifacts-path from dotnet CLI arguments to avoid MSB3277 warnings caused by SqlClient's custom OutputPath colliding across TFMs.
- Add 'ADO Build properties' group which provides x64AliasRegistryPath, x86AliasRegistryPath, SQLAliasName, and SQLAliasPort needed by the Windows SQL Server configuration step template. - Fix 'ADO Test Configuration Properties' -> 'ADO Test Configuration properties' (lowercase 'p') to match the actual group name in ADO.
Remove PrivateAssets=All and IncludeAssets from the Microsoft.Data.SqlClient.SNI PackageReference in the main SqlClient csproj so the native SNI DLL flows transitively through ProjectReference. This eliminates the need for every test project to carry its own explicit SNI PackageReference. Remove the now-unnecessary SNI PackageReferences from UnitTests, ManualTests, and FunctionalTests csproj files.
4df9022 to
7bf66ef
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
eng/pipelines/stress/stress-tests-job.yml:103
dotnetArtifactsDiris now unused because--artifacts-path $(dotnetArtifactsDir)was removed fromdotnetArguments. Either removedotnetArtifactsDir(and related comment) to avoid confusion, or reintroduce the argument if artifacts staging is still required by downstream steps.
# The directory where dotnet artifacts will be staged. Not to be
# confused with pipeline artifacts.
- name: dotnetArtifactsDir
value: $(Build.StagingDirectory)/dotnetArtifacts
Add name to the build step and condition test steps with succeededOrFailed() gated on the build step's success. This ensures: - All test runtimes run even if a prior runtime fails - Test steps are skipped if the build or setup fails - Any test failure still fails the overall job
9d5a7b1 to
c02833c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
eng/pipelines/stress/stress-tests-job.yml:103
dotnetArtifactsDiris still defined, but--artifacts-path $(dotnetArtifactsDir)was removed fromdotnetArguments, so this variable is now unused. Consider either removingdotnetArtifactsDir(and the related comment) or reintroducing the argument if staging build outputs is still required for troubleshooting/artifact collection.
# The directory where dotnet artifacts will be staged. Not to be
# confused with pipeline artifacts.
- name: dotnetArtifactsDir
value: $(Build.StagingDirectory)/dotnetArtifacts
- Replace verbose IncludeAssets with ExcludeAssets="compile" on all PackageReferences that only needed to exclude compile-time assets. - Remove PrivateAssets="all" from SNI refs (ref/, notsupported/, src/) so the native DLL flows transitively via ProjectReference. The nuspec remains the authority for NuGet package consumers. - Remove PrivateAssets="all" from xunit runner refs in test projects since no project references the test projects. - Remove unused dotnetArtifactsDir variable from stress-tests-job.yml. - Fix variable group casing (ADO Build/Test Configuration Properties).
Add a top-level failOnTestFailure parameter (default: false) threaded through pipeline, stage, and job templates. When false, test failures produce warnings (SucceededWithIssues) instead of failing the pipeline. When true, test failures fail the job. Document the interaction between condition, buildSucceeded flag, and continueOnError in the job template.
|
|
||
| <PackageReference Include="Microsoft.Bcl.Cryptography" /> | ||
| <PackageReference Include="Microsoft.Data.SqlClient.SNI" | ||
| PrivateAssets="all" |
There was a problem hiding this comment.
The PrivateAssets=all is the root cause of our test projects failing to find the SNI DLLs when building in Project ref mode. Eureka!
So I removed them all to avoid wondering why some projects have them and others don't.
| <PackageReference Include="Microsoft.Data.SqlClient.SNI" | ||
| PrivateAssets="all" | ||
| IncludeAssets="runtime;build;native;contentfiles;analyzers;buildtransitive" /> | ||
| <PackageReference Include="Microsoft.Data.SqlClient.SNI" ExcludeAssets="compile" /> |
There was a problem hiding this comment.
It's much clearer to Exclude compile than to Include everything else.
|
|
||
| <PackageReference Include="Azure.Identity" /> | ||
| <PackageReference Include="Microsoft.Bcl.Cryptography" /> | ||
| <PackageReference Include="Microsoft.Data.SqlClient.SNI" |
There was a problem hiding this comment.
We don't need these in any of our downstream (i.e. test) projects now.
| <PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" /> | ||
| <PackageReference Include="System.Security.Cryptography.Pkcs" /> | ||
| <PackageReference Include="xunit" /> | ||
| <PackageReference Include="xunit.runner.console" |
There was a problem hiding this comment.
I cleaned up the xUnit references as well, for consistency.
Description
Now that the sqlclient-stress pipeline has been defined in the Public project, we can actually see it running based on the new YAML files. This PR works through issues until the stress tests run properly.
Changes
Pipeline fixes
stress-tests-pipeline.ymlafter it was moved.--artifacts-pathfrom dotnet arguments, addedADO Build Propertiesvariable group, fixed variable group casing.condition: succeededOrFailed()gated on abuildSucceededflag so all runtimes are tested even if one fails, but tests are skipped if the build/setup fails. The overall job still reports failure.dotnetArtifactsDirvariable from stress-tests-job.yml.SNI native DLL transitive flow
PrivateAssets=AllfromMicrosoft.Data.SqlClient.SNIin the main SqlClient csproj so the native SNI DLL flows transitively viaProjectReference. This eliminates the need for every test project to carry its own explicit SNIPackageReference(the stress tests were missing them, causingDllNotFoundExceptionon net462).PackageReferenceentries from UnitTests, ManualTests, and FunctionalTests.PackageReference cleanup
IncludeAssetswithExcludeAssets="compile"on all SNI and xunit runner PackageReferences across the codebase. Functionally equivalent but more concise.PrivateAssets="all"from SNI refs in ref/ and notsupported/ projects, and from xunit runner refs in all test projects (no project references the test projects, so it had no effect).Checklist