Conversation
…why this is just now a problem, but ok, I'll fix it.
Rewrite VerifyGetCommand in adapter test to no longer use reflection/dynamic invocation
There was a problem hiding this comment.
Pull request overview
Refactors and reorganizes the Manual Tests project as a first step toward wiring it to the common Microsoft.Data.SqlClient (MDS) project, including project renaming, file grouping, OS/TFM-conditional compilation via #if, and some targeted test cleanups.
Changes:
- Renames the Manual Tests project (project/assembly/solution/build entry points) and restructures the
.csprojto use explicit test-set groupings. - Moves/normalizes content/test data files (e.g., baseline
.bsl, XML test data) to simplify inclusion and avoid linked-file path issues. - Cleans up several manual tests (UDT tests, cancel tests) and applies OS/TFM guards via preprocessor directives.
Reviewed changes
Copilot reviewed 16 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.Data.SqlClient/tests/ManualTests/SqlParameterTest_ReleaseMode.bsl | Adds/moves baseline output used by TVP/parameter manual tests. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/SqlServerTypesTest.cs | Refactors UDT reader tests into theories and centralizes query/expected values. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/TransactionTest/DistributedTransactionTest.windows.cs | Wraps Windows-only distributed transaction tests in _WINDOWS preprocessor guard. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/SqlDSEnumeratorTest/SqlDataSourceEnumeratorTest.windows.cs | Wraps enumerator tests in _WINDOWS guard and removes per-TFM platform attributes. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/SqlCommand/SqlCommandCancelTest.cs | Renames tests to avoid xUnit name conflicts and modernizes some patterns (incl. async Task tests). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectionPoolTest/TransactionPoolTest.netfx.cs | Ensures netfx-only compilation via #if NETFRAMEWORK. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectionPoolTest/ConnectionPoolTest.Debug.cs | Adds license header and wraps debug-only test code in #if DEBUG. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/Batch/BatchTests.netcore.cs | Ensures net-only compilation via #if NET and adjusts conditional compilation blocks. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj | Major project cleanup: test-set grouping, OS constants, content moves, and updated references. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/DDDataTypesTest_Data.xml | Adds XML test data at project root for easier copying/consumption. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/DDBasics/DDDataTypesTest/DDDataTypesTest.cs | Updates XML reader to use the new root-level XML data file name. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/SqlSetupStrategyCspProvider.windows.cs | Wraps Windows-only CSP setup strategy in _WINDOWS guard. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/Setup/CspProviderColumnMasterKey.windows.cs | Wraps Windows-only CMK setup in _WINDOWS guard. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/DateOnlyReadTests.netcore.cs | Wraps .NET-only tests in #if NET. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/CspProviderExt.windows.cs | Moves “Windows-only” gating to _WINDOWS preprocessor guard. |
| src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj | Updates commentary and adjusts xunit runner json item type. |
| src/Microsoft.Data.SqlClient.sln | Renames the Manual Tests project entry and updates path/name. |
| build.proj | Updates manual test project path to the renamed .csproj. |
Comments suppressed due to low confidence (1)
src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj:406
- The netcore references section includes the same TestCommon project twice (once via
$(RepoRoot)/src/... and once via $ (TestsPath)...). This can lead to duplicate project references / duplicate outputs during build. Remove one reference and keep a single canonical path (preferably the $(TestsPath) one for consistency with other references in this file).
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/SqlServerTypesTest.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/DDBasics/DDDataTypesTest/DDDataTypesTest.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/SqlServerTypesTest.cs
Show resolved
Hide resolved
edwardneal
left a comment
There was a problem hiding this comment.
No major comments - just a couple of thoughts on SqlCommandCancelTest, and some ideas to simplify the testing in the future.
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/SqlCommand/SqlCommandCancelTest.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/SqlCommand/SqlCommandCancelTest.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj
Show resolved
Hide resolved
...Client/tests/ManualTests/AlwaysEncrypted/TestFixtures/SqlSetupStrategyCspProvider.windows.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 24 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (3)
src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/SqlSetupStrategyCspProvider.windows.cs:7
- Header comment line appears to have an accidental
using System;appended (...more information.using System;). This is likely a copy/paste artifact and makes the license header look malformed; it can just end at the period since a realusing System;already follows.
src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj:35 ValidateOscompares$(TargetOS)to$(OS), but this project only definesTargetOs. If$(TargetOS)is unset (likely), this condition will always be true and the build will error on every OS. Use$(TargetOs)(or$(NormalizedTargetOs)with a normalized comparison) in the condition so the target only fails when the dev override is left on.
src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj:84- ManualTests no longer includes/copies
xunit.runner.jsoninto the test output. Other test projects in this repo include it (e.g.,tests/Common/Common.csproj:43-46,tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj:22-25) to control runner behavior (shadow copy, diagnostics, parallelization). Consider adding it back here to keep ManualTests consistent and avoid behavior changes on netfx.
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/SqlServerTypesTest.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/SqlServerTypesTest.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/DDBasics/DDDataTypesTest/DDDataTypesTest.cs
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #3932 +/- ##
==========================================
- Coverage 74.89% 67.23% -7.67%
==========================================
Files 269 263 -6
Lines 43274 66205 +22931
==========================================
+ Hits 32410 44512 +12102
- Misses 10864 21693 +10829
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.
Everything looks good. Not blocking, but want to discuss conditional compilation vs. conditional fact/theory and document a decision.
Only thing blocking is that the test counts look different (lower) with this change and I want to look closer to make sure that's expected.
Description
Changing the manual tests project to point to the common MDS project is a bit more complex than the other test projects. Specifically, manual tests include tests for the AKV provider - which means there's an entire dependency chain that needs updating. Since AKV provider is tied into several pipelines, build.proj, etc, detangling it just for manual tests is gnarly and I'm getting lost. When I get lost, I know everyone else will get lost, and the best way to fix that is to break it up into a couple PRs of related work. So here it is, part 1.
This PR primarily focuses on cleaning up the Manual Tests project:
Testing
Testing via #3916 shows these changes should work correctly. Local runs of modified tests show the tests work correctly. CI for this PR should verify
...
Now onto wiring up the entire chain....