Skip to content

[6.1] Suppress xUnit warnings for vector tests #3480

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

Merged
merged 1 commit into from
Jul 16, 2025

Conversation

apoorvdeshmukh
Copy link
Contributor

Description

Add attribute for suppressing warnings for vector tests of following nature.
They appear while running tests on console.

   /usr/share/dotnet/sdk/9.0.301/Microsoft.TestPlatform.targets(48,5): warning : [xUnit.net 00:00:00.59] ManualTests: Non-serializable data ('System.Object[]') found for 'Microsoft.Data.SqlClient.ManualTesting.Tests.SQL.VectorTest.NativeVectorFloat32Tests.TestSqlVectorFloat32ParameterInsertionAndReads'; falling back to single test case.
    /usr/share/dotnet/sdk/9.0.301/Microsoft.TestPlatform.targets(48,5): warning : [xUnit.net 00:00:00.59] ManualTests: Non-serializable data ('System.Object[]') found for 'Microsoft.Data.SqlClient.ManualTesting.Tests.SQL.VectorTest.NativeVectorFloat32Tests.TestSqlVectorFloat32ParameterInsertionAndReadsAsync'; falling back to single test case.
    /usr/share/dotnet/sdk/9.0.301/Microsoft.TestPlatform.targets(48,5): warning : [xUnit.net 00:00:00.59] ManualTests: Non-serializable data ('System.Object[]') found for 'Microsoft.Data.SqlClient.ManualTesting.Tests.SQL.VectorTest.NativeVectorFloat32Tests.TestStoredProcParamsForVectorFloat32'; falling back to single test case.
    /usr/share/dotnet/sdk/9.0.301/Microsoft.TestPlatform.targets(48,5): warning : [xUnit.net 00:00:00.59] ManualTests: Non-serializable data ('System.Object[]') found for 'Microsoft.Data.SqlClient.ManualTesting.Tests.SQL.VectorTest.NativeVectorFloat32Tests.TestStoredProcParamsForVectorFloat32Async'; falling back to single test case.

Testing

git\SqlClient>dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" -p:Platform="AnyCPU" -p:Configuration="Debug" -p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "FullyQualifiedName=Microsoft.Data.SqlClient.ManualTesting.Tests.SQL.VectorTest.NativeVectorFloat32Tests.TestBulkCopyFromSqlTable"
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 9.0.7)
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 8.0.18)
[xUnit.net 00:00:00.07]   Discovering: ManualTests (method display = ClassAndMethod, method display options = None)
[xUnit.net 00:00:00.07]   Discovering: ManualTests (method display = ClassAndMethod, method display options = None)
[xUnit.net 00:00:00.57]   Discovered:  ManualTests (found 1059 test cases)
[xUnit.net 00:00:00.57]   Starting:    ManualTests (parallel test collections = on [20 threads], stop on fail = off)
[xUnit.net 00:00:00.54]   Discovered:  ManualTests (found 1059 test cases)
[xUnit.net 00:00:00.54]   Starting:    ManualTests (parallel test collections = on [20 threads], stop on fail = off)
[xUnit.net 00:00:00.75]   Finished:    ManualTests
[xUnit.net 00:00:00.71]   Finished:    ManualTests
  Microsoft.Data.SqlClient.ManualTesting.Tests test net9.0 succeeded (1.2s)
  Microsoft.Data.SqlClient.ManualTesting.Tests test net8.0 succeeded (1.2s)

Test summary: total: 4, failed: 0, succeeded: 4, skipped: 0, duration: 1.3s
Build succeeded in 1.6s

Guidelines

Please review the contribution guidelines before submitting a pull request:

@Copilot Copilot AI review requested due to automatic review settings July 15, 2025 16:20
@apoorvdeshmukh apoorvdeshmukh requested a review from a team as a code owner July 15, 2025 16:20
Copy link
Contributor

@Copilot 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

Suppress xUnit discovery warnings for parameterized vector tests by disabling test-case enumeration on MemberData attributes.

  • Added DisableDiscoveryEnumeration = true to the four existing MemberData attributes in NativeVectorFloat32Tests.
  • Aims to prevent “Non-serializable data” warnings during discovery.
Comments suppressed due to low confidence (1)

src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/VectorTest/NativeVectorFloat32Tests.cs:151

  • Ensure the test project references an xUnit version that supports DisableDiscoveryEnumeration, as older xUnit 2.x versions may not recognize this property and could cause build or discovery failures.
        [MemberData(nameof(VectorFloat32TestData.GetVectorFloat32TestData), MemberType = typeof(VectorFloat32TestData), DisableDiscoveryEnumeration = true)]

@benrr101 benrr101 added this to the 7.0-preview1 milestone Jul 15, 2025
@benrr101 benrr101 added the Area\Tests Issues that are targeted to tests or test projects label Jul 15, 2025
@apoorvdeshmukh apoorvdeshmukh modified the milestones: 7.0-preview1, 6.1.0 Jul 15, 2025
Copy link

codecov bot commented Jul 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.58%. Comparing base (6773a65) to head (80a822e).
Report is 6 commits behind head on release/6.1.

Additional details and impacted files
@@               Coverage Diff                @@
##           release/6.1    #3480       +/-   ##
================================================
+ Coverage        68.87%   92.58%   +23.70%     
================================================
  Files              280        6      -274     
  Lines            62322      310    -62012     
================================================
- Hits             42927      287    -42640     
+ Misses           19395       23    -19372     
Flag Coverage Δ
addons 92.58% <ø> (ø)
netcore ?
netfx ?

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.

@paulmedynski paulmedynski changed the title Suppress xUnit warnings for vector tests [6.1] Suppress xUnit warnings for vector tests Jul 16, 2025
@paulmedynski paulmedynski merged commit 3b59b94 into release/6.1 Jul 16, 2025
129 checks passed
@paulmedynski paulmedynski deleted the dev/ad/vectorTestWarnings branch July 16, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area\Tests Issues that are targeted to tests or test projects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants