Repository navigation
Add dedicated trimming and AOT tests - #4817
paulmedynski wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
Cross-platform pipeline and NativeAOT changes are substantial, while Windows CLR and remote CI execution remain unverified.
0 open findings
What changed in this PR
Adds a dedicated authentication validation harness covering configuration, package/reference modes, runtime mismatches, and trimmed/NativeAOT publishing.
Changes:
- Expands fresh-process authentication scenarios and package-source validation.
- Adds trim/AOT publishing checks and build orchestration.
- Introduces Linux and Windows CI coverage for Project and Package modes.
No actionable defects were identified by inspection. Existing review threads were not provided.
| File | Description |
|---|---|
RunAuthenticationTests.ps1 |
Orchestrates scenarios, package checks, and publishing. |
AuthenticationTests/README.md |
Documents harness usage and prerequisites. |
PublishTest/PublishTest.csproj |
Configures trim/AOT fixture references. |
PublishTest/Program.cs |
Validates trimmed authentication registration. |
ConfigurationTest/Program.cs |
Expands configuration and failure scenarios. |
ConfigurationTest/ConfigurationTest.csproj |
Adds Azure references. |
bad-unsupported.config |
Adds unsupported-provider scenario. |
bad-provider.config |
Adds missing-provider scenario. |
bad-initializer.config |
Adds missing-initializer scenario. |
Microsoft.Data.SqlClient.slnx |
Includes the publishing fixture. |
Pipeline-Arguments.Tests.ps1 |
Checks the authentication CI matrix. |
Build-Orchestration.Tests.ps1 |
Verifies harness orchestration and references. |
authentication-validation-stage.yml |
Adds cross-platform authentication jobs. |
dotnet-sqlclient-ci-core.yml |
Integrates the new CI stage. |
BUILDGUIDE.md |
Documents targets and publishing commands. |
build.proj |
Adds complete and build-only authentication targets. |
testing.instructions.md |
Records authentication fixture conventions. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
7c3e459 to
02d0134
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Describe runtime validation in authentication bootstrap documentation - Decouple authentication guidance from consumer version enforcement - Defer the executable runtime-version fixture to #4817
b8c7e0c to
f6637e5
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The net462 configuration replacement discards generated assembly-binding redirects, causing provider activation to fail when a dependency needs a redirect rather than testing authentication behavior.
3 open issues
Review effort: Balanced
There was a problem hiding this comment.
Please convert this to a unit test instead. I’d expose the six scenarios through an xUnit [Theory], retaining a fresh child process per scenario and asserting its exit code with captured diagnostics. That gives normal test discovery/reporting while preserving coverage—technically integration tests. Provider precedence and registration rules could separately become true unit tests against an isolated registry instance.
| using System.Collections.Concurrent; | ||
| using System.Diagnostics.Tracing; | ||
|
|
||
| string scenario = args.Single(); |
There was a problem hiding this comment.
You can use this program locally to confirm these changes are backwards compatible with MDS 7.1 - because that's a hard requirement.
There was a problem hiding this comment.
Could we discuss where these executable test fixtures should live?
I started sqlclient-samples with reusable, version-selectable validation in mind. We could put standalone compatibility scenarios there and run a pinned revision from this repository, while keeping implementation-specific regression and publishing checks here.
cheenamalhotra
left a comment
There was a problem hiding this comment.
Noting that this is not a blocker on 8.0.0-preview1, can be done later as well.
Preserve the final scenario harness, publishing checks, CI wiring and orchestration tests from the original #4817 layer while dropping obsolete intermediate fixture deferrals during restacking. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Relocate runtime-version fixtures and orchestration to the final PR #4820. Align configuration scenarios and framework expectations with the rebased registry. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…fixture Keep the independently buildable #4817 fixture compatible with .NET Framework after rebasing the stack. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the inherited deferral note now that this stack layer supplies the executable scenarios. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Build both authentication frameworks by default, normalize cross-platform path assertions, and preserve generated runtime configuration across scenarios. Add regression coverage and update authentication harness documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move the standalone registry publish checks out of the #4821 worktree into AuthenticationTests. Preserve the synthetic configuration and discovery contracts and document direct publish commands. Trimmed explicit registration and Native AOT publish/execution pass. Enabled-reflection trimmed execution reproduces configuration activation failure until the pending #4821 capability-guard fix is reconciled. Leave default runner and CI integration for parent-PR reconciliation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
An incorrect assertion aborts all three bad-* authentication scenarios before recovery checks, while enabled reflective bootstrap paths cause warnings-as-errors trim/AOT publishes to fail.
2 open issues
Review effort: Balanced
Expect failed configured methods to remain unavailable while checking that Azure discovery was attempted and explicit registration recovers them. Disable reflective bootstrap at publish time in the trim/AOT fixture and document the intended contracts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
All four Project/Package authentication CI jobs remain in progress, leaving Windows net462 runtime behavior and Linux trim/NativeAOT execution unverified for the reviewed head.
No open issues 🎉
2 resolved since last review
Review effort: Balanced
Add a version-selectable public-API consumer and fresh-process comparison runner. Validate shared success contracts and report invalid-configuration and initializer-registration differences without version-specific expectations. Document the manual .NET 10 comparison workflow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Windows net462 and Linux trimmed/NativeAOT execution remain pending in both reference modes, while compatibility results and open fixture-placement and test-reporting requests still need maintainer assessment.
No open issues 🎉
Review effort: Balanced


Description
Integrate authentication compatibility scenarios and trimmed/NativeAOT publishing checks into build orchestration and Linux/Windows CI.
Why?
Authentication behavior must remain consistent across project and package references, supported runtimes, and publishing modes. Executable, isolated consumers verify configuration activation, provider precedence, recovery, and published applications rather than compilation alone.
How
Stack order
AOT 6, after replacement localization PR #4942 and before #4820. This layer is independently valid without runtime family-version enforcement.
The commits and PR bases follow this order in native stack #4943.
Issues
Completes the NativeAOT authentication fix for #4193. Optional runtime-family enforcement follows separately in #4820.
Testing
dotnet build build.proj -t:TestAuthentication -p:ReferenceType=Project -p:Configuration=Release -p:TestFramework=net10.0 -p:AuthenticationPublish=true -v:minimal- passed: six configuration scenarios, trimmed execution, and NativeAOT execution.NUGET_PACKAGES=<isolated-cache> dotnet build build.proj -t:TestAuthentication -p:ReferenceType=Package -p:Configuration=Release -p:TestFramework=net10.0 -p:AuthenticationPublish=true -p:PackageVersionSqlClient=8.0.0-stack.6pkg -v:minimal- passed: six configuration scenarios, trimmed execution, and NativeAOT execution using locally built packages.dotnet build build.proj -t:BuildAuthenticationTests -p:ReferenceType=Project -p:Configuration=Debug -p:TestFramework=net462 -v:minimal- passed: .NET Framework fixture compilation; this is not Windows runtime execution.pwsh -NoProfile -NonInteractive -Command '$r = Invoke-Pester -Path ./eng/pipelines/scripts/tests/Build-Orchestration.Tests.ps1,./eng/pipelines/scripts/tests/Pipeline-Arguments.Tests.ps1 -PassThru; if ($r.FailedCount -gt 0 -or $r.PassedCount -eq 0) { exit 1 }'- passed: 123 tests.Guidelines
Please review the contribution guidelines before submitting a pull request: