Skip to content

Fix test warnings#7369

Merged
stephentoub merged 1 commit intodotnet:mainfrom
jozkee:fix_test_warnings
Mar 7, 2026
Merged

Fix test warnings#7369
stephentoub merged 1 commit intodotnet:mainfrom
jozkee:fix_test_warnings

Conversation

@jozkee
Copy link
Member

@jozkee jozkee commented Mar 7, 2026

  • Fix duplicate test case IDs caused by unused gapBeginningEnd loop variable (test bug)
  • Suppress non-serializable data warnings with DisableDiscoveryEnumeration

These flood the test log.

Microsoft Reviewers: Open in CodeFlow

- Fix duplicate test case IDs caused by unused gapBeginningEnd loop variable
- Suppress non-serializable data warnings with DisableDiscoveryEnumeration

Co-authored-by: Copilot <[email protected]>
@jozkee jozkee requested a review from a team as a code owner March 7, 2026 02:34
Copilot AI review requested due to automatic review settings March 7, 2026 02:34
@github-actions github-actions bot added the area-ai Microsoft.Extensions.AI libraries label Mar 7, 2026
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

Reduces noisy xUnit test-log warnings in the AI Abstractions test suite by ensuring theory data is unique and by preventing xUnit from enumerating non-serializable MemberData during test discovery.

Changes:

  • Fixes duplicate theory-case IDs by correctly passing the gapBeginningEnd loop variable into generated MemberData.
  • Adds DisableDiscoveryEnumeration = true to MemberData attributes that use non-serializable theory data, suppressing discovery-time warnings.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Utilities/AIJsonUtilitiesTests.cs Disables discovery enumeration for MemberData based schema stress tests to avoid non-serializable data warnings.
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/SpeechToText/SpeechToTextResponseUpdateExtensionsTests.cs Fixes theory data generation to include gapBeginningEnd, preventing duplicate test case IDs.
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/ToolApprovalResponseContentTests.cs Disables discovery enumeration for ToolCallContent MemberData to suppress non-serializable discovery warnings.
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/Contents/ToolApprovalRequestContentTests.cs Disables discovery enumeration for ToolCallContent MemberData to suppress non-serializable discovery warnings.
test/Libraries/Microsoft.Extensions.AI.Abstractions.Tests/ChatCompletion/ChatResponseUpdateExtensionsTests.cs Fixes theory data generation to include gapBeginningEnd, preventing duplicate test case IDs.

@stephentoub stephentoub merged commit 1664044 into dotnet:main Mar 7, 2026
12 checks passed
jeffhandley pushed a commit to jeffhandley/extensions that referenced this pull request Mar 17, 2026
- Fix duplicate test case IDs caused by unused gapBeginningEnd loop variable
- Suppress non-serializable data warnings with DisableDiscoveryEnumeration

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-ai Microsoft.Extensions.AI libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants