Skip to content

Common MDS | Cleanup Manual Tests#3932

Merged
benrr101 merged 10 commits intomainfrom
dev/russellben/common/manual-tests-part1
Feb 6, 2026
Merged

Common MDS | Cleanup Manual Tests#3932
benrr101 merged 10 commits intomainfrom
dev/russellben/common/manual-tests-part1

Conversation

@benrr101
Copy link
Contributor

@benrr101 benrr101 commented Feb 3, 2026

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:

  • Rename ManualTesting.Tests project to ManualTests
  • Sort and organize included files
    • Make sure tests are only included in test set groups, not the "common" group
  • Conditional files based on OS or target framework are now done via #if directives like every other project
  • Follow grouping conventions for package/project references as per functional/unit tests projects
  • Move test data files to root of project to remove need for "link" tags that mess up file locations in solution explorer
  • Clean up the SqlCommandCancelTest and SqlServerTypesTest files
    • Main reason was to fix xUnit method name conflicts
    • Kinda went cowboy coder on this one 🤠

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....

@benrr101 benrr101 requested a review from a team as a code owner February 3, 2026 20:19
@benrr101 benrr101 added the Common Project 🚮 Things that relate to the common project project label Feb 3, 2026
Copilot AI review requested due to automatic review settings February 3, 2026 21:56
Rewrite VerifyGetCommand in adapter test to no longer use reflection/dynamic invocation
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .csproj to 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).

Copy link
Contributor

@edwardneal edwardneal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No major comments - just a couple of thoughts on SqlCommandCancelTest, and some ideas to simplify the testing in the future.

@priyankatiwari08 priyankatiwari08 self-assigned this Feb 4, 2026
Copilot AI review requested due to automatic review settings February 4, 2026 20:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 real using System; already follows.
    src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj:35
  • ValidateOs compares $(TargetOS) to $(OS), but this project only defines TargetOs. 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.json into 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.

@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.23%. Comparing base (a0357b2) to head (82772af).
⚠️ Report is 4 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (a0357b2) and HEAD (82772af). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (a0357b2) HEAD (82772af)
addons 2 0
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     
Flag Coverage Δ
addons ?
netcore 67.53% <ø> (-7.40%) ⬇️
netfx 66.25% <ø> (-7.89%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@mdaigle mdaigle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@benrr101 benrr101 merged commit cac3b1a into main Feb 6, 2026
293 checks passed
@benrr101 benrr101 deleted the dev/russellben/common/manual-tests-part1 branch February 6, 2026 17:40
@paulmedynski paulmedynski added this to the 7.0.0-preview4 milestone Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Common Project 🚮 Things that relate to the common project project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants