-
Notifications
You must be signed in to change notification settings - Fork 322
Test | Split TvpTest part1 #3956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 the large TvpTest “golden file” manual test by splitting individual test groups into separate top-level test classes with their own baseline files, improving diagnosability and maintainability of the ManualTests suite.
Changes:
- Removes the monolithic
TvpTest.TestMain()runner and exposes specific helper methods/classes for reuse. - Adds new focused ManualTests (
*Tests.cs) for QueryHints, ColumnBoundaries, StreamInputParameter, SqlVariantParameter, DateTimeVariant, and OutputParameter. - Splits the original baseline output into multiple per-test
.bslfiles and updates the ManualTests csproj content includes accordingly.
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 20 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/TvpTest.cs | Removes monolithic entrypoint and makes helpers accessible to new focused tests. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/TvpQueryHintsTests.cs | New top-level test for TVP query hints with dedicated baseline comparison. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/TvpColumnBoundariesTests.cs | New top-level test for TVP column boundary permutations with dedicated baseline comparison. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/StreamInputParameterTests.cs | New top-level test for stream input parameter scenarios with dedicated baseline comparison. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/SqlVariantParameterTests.cs | New top-level test for SQL variant parameter scenarios with dedicated baseline comparison. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/DateTimeVariantTests.cs | New top-level test for DateTime variant scenarios with dedicated baseline comparison. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/OutputParameterTests.cs | New top-level test for output parameter scenarios with dedicated baseline comparison. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/TvpQueryHints_DebugMode.bsl | New split baseline for TVP query hints (Debug). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/TvpQueryHints_DebugMode_Azure.bsl | New split baseline for TVP query hints (Debug/Azure). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/TvpQueryHints_ReleaseMode.bsl | New split baseline for TVP query hints (Release). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/TvpQueryHints_ReleaseMode_Azure.bsl | New split baseline for TVP query hints (Release/Azure). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/TvpColumnBoundaries_DebugMode.bsl | New split baseline for TVP column boundaries (Debug). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/TvpColumnBoundaries_DebugMode_Azure.bsl | New split baseline for TVP column boundaries (Debug/Azure). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/TvpColumnBoundaries_ReleaseMode.bsl | New split baseline for TVP column boundaries (Release). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/TvpColumnBoundaries_ReleaseMode_Azure.bsl | New split baseline for TVP column boundaries (Release/Azure). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/StreamInputParameter_ReleaseMode.bsl | New split baseline for stream input parameter test (Release). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/StreamInputParameter_ReleaseMode_Azure.bsl | New split baseline for stream input parameter test (Release/Azure). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/SqlVariantParameter_DebugMode.bsl | New split baseline for SQL variant parameter test (Debug). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/SqlVariantParameter_DebugMode_Azure.bsl | New split baseline for SQL variant parameter test (Debug/Azure). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/SqlVariantParameter_ReleaseMode.bsl | New split baseline for SQL variant parameter test (Release). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/SqlVariantParameter_ReleaseMode_Azure.bsl | New split baseline for SQL variant parameter test (Release/Azure). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/OutputParameter_DebugMode.bsl | New split baseline for output parameter test (Debug). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/OutputParameter_DebugMode_Azure.bsl | New split baseline for output parameter test (Debug/Azure). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/OutputParameter_ReleaseMode.bsl | New split baseline for output parameter test (Release). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/OutputParameter_ReleaseMode_Azure.bsl | New split baseline for output parameter test (Release/Azure). |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/DateTimeVariant_DebugMode.bsl | Baseline updated to remove content moved into other split baselines. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/DateTimeVariant_DebugMode_Azure.bsl | Baseline updated to remove content moved into other split baselines. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj | Adds new test files and new baseline content items; removes old monolithic baselines. |
| [Trait("Category", "flaky")] | ||
| [ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureSynapse))] | ||
| public void OutputParameterTest() | ||
| { | ||
| Assert.True(RunTestAndCompareWithBaseline()); | ||
| } |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original monolithic TvpTest.TestMain forced Thread.CurrentThread.CurrentCulture to en-US to keep date/time string output stable for baseline comparisons. After splitting, this test no longer sets culture, so baselines can become machine-locale dependent. Set the culture (and ideally restore the previous culture in a try/finally) before running the test logic.
| <Compile Include="SQL\UdtTest\UdtTest.cs" /> | ||
| <Compile Include="SQL\UdtTest\UdtTest2.cs" /> | ||
| <Compile Include="SQL\UdtTest\UdtTestHelpers.cs" /> | ||
| <Compile Include="SQL\Utf8SupportTest\Utf8SupportTest.cs" /> | ||
| <Compile Include="SQL\VectorTest\NativeVectorFloat32Tests.cs" /> | ||
| <Compile Include="SQL\VectorTest\VectorAPIValidationTest.cs" /> | ||
| <Compile Include="SQL\VectorTest\VectorTypeBackwardCompatibilityTests.cs" /> | ||
| <Compile Include="SQL\WeakRefTest\WeakRefTest.cs" /> | ||
| <Compile Include="SQL\WeakRefTestYukonSpecific\WeakRefTestYukonSpecific.cs" /> | ||
| <Compile Include="TracingTests\DiagnosticTest.cs" /> | ||
| <Compile Include="TracingTests\EventSourceTest.cs" /> | ||
| <Compile Include="TracingTests\FakeDiagnosticListenerObserver.cs" /> | ||
| <Compile Include="TracingTests\MetricsTest.cs" /> | ||
| <Compile Include="TracingTests\XEventsTracingTest.cs" /> | ||
|
|
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change removes the TracingTests\*.cs files from the ManualTests project. Since EnableDefaultCompileItems is set to false in this csproj, those files will no longer be compiled or executed unless they are explicitly re-included. If this wasn't intentional (and it's not mentioned in the PR description), please add the Compile Include entries back (or re-enable default compile items).
| using System; | ||
| using System.Collections.Generic; | ||
| using System.IO; | ||
| using System.Text; |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System.Collections.Generic is not used in this file. Since the repo builds with TreatWarningsAsErrors=true, this unnecessary using can fail the build (CS8019). Remove the unused using directive.
| using System.Text; |
| [Trait("Category", "flaky")] | ||
| [ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureSynapse))] | ||
| public void StreamInputParameterTest() | ||
| { | ||
| Assert.True(RunTestAndCompareWithBaseline()); | ||
| } |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original monolithic TvpTest.TestMain forced Thread.CurrentThread.CurrentCulture to en-US to keep date/time string output stable for baseline comparisons. After splitting, this test no longer sets culture, so baselines can become machine-locale dependent. Set the culture (and ideally restore the previous culture in a try/finally) before running the test logic.
| [Trait("Category", "flaky")] | ||
| [ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureSynapse))] | ||
| public void TvpColumnBoundariesTest() | ||
| { | ||
| Assert.True(RunTestAndCompareWithBaseline()); | ||
| } |
Copilot
AI
Feb 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original monolithic TvpTest.TestMain forced Thread.CurrentThread.CurrentCulture to en-US to keep date/time string output stable for baseline comparisons. After splitting, this test no longer sets culture, so baselines can become machine-locale dependent. Set the culture (and ideally restore the previous culture in a try/finally) before running the test logic.
Description
TvpTest is large an unmaintainable due to its "golden file" testing approach. We frequently see builds hang on these tests but have no way to diagnose because so much work happens under a single test case header (hundreds of individuals connections, queries, type comparisons, console logs, etc.). This PR kicks off the process of improving this test class.
The first order of business is breaking the test down into more manageable chunks. TvpTest.TestMain calls several helper test methods that can be split into their own classes and called directly as top-level tests. This requires splitting out the giant baseline files by test and updating the new tests to look only at their new targeted baseline file.
While splitting the baseline file, I ran TvpTest.TestMain on the concatenation of the split files to ensure that nothing was lost in the transition.
Testing
All test cases are preserved; this is just a refactor.