Skip to content

eliminate test data serialization warnings#12983

Merged
JanProvaznik merged 4 commits intodotnet:mainfrom
JanProvaznik:interning-test-data-serializability
Jan 7, 2026
Merged

eliminate test data serialization warnings#12983
JanProvaznik merged 4 commits intodotnet:mainfrom
JanProvaznik:interning-test-data-serializability

Conversation

@JanProvaznik
Copy link
Member

this pollutes context for agents running tests on cli

Copilot AI review requested due to automatic review settings January 7, 2026 11:01
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

This PR eliminates xUnit test data serialization warnings that pollute context for agents running tests on the CLI. The fix addresses warnings in two ways: by implementing proper xUnit serialization for test data classes, and by disabling discovery enumeration for complex test data collections.

Key Changes

  • Implemented IXunitSerializable interface for the TestDatum class to support proper xUnit test data serialization
  • Added DisableDiscoveryEnumeration = true parameter to MemberData attributes across multiple test files to prevent xUnit from enumerating test data during test discovery

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/StringTools.UnitTests/InterningTestData.cs Implements IXunitSerializable with Serialize/Deserialize methods and adds parameterless constructor for TestDatum class
src/Shared/UnitTests/FileMatcher_Tests.cs Adds DisableDiscoveryEnumeration to MemberData attribute for GetFilesComplexGlobbingMatchingInfo test
src/Build.UnitTests/Graph/ResultCacheBasedBuilds_Tests.cs Adds DisableDiscoveryEnumeration to MemberData attribute for BuildGraphData test
src/Build.UnitTests/Graph/ProjectGraph_Tests.cs Adds DisableDiscoveryEnumeration to 4 MemberData attributes for various graph-related tests
src/Build.UnitTests/Graph/IsolateProjects_Tests.cs Adds DisableDiscoveryEnumeration to MemberData attribute for UndeclaredReferenceEnforcementShouldNormalizeFilePathsTestData test
src/Build.UnitTests/Graph/GraphLoadedFromSolution_tests.cs Adds DisableDiscoveryEnumeration to MemberData attribute for SolutionOnlyDependenciesData test
src/Build.OM.UnitTests/Definition/Project_Tests.cs Adds DisableDiscoveryEnumeration to 2 MemberData attributes for item provenance tests
src/Build.OM.UnitTests/Definition/ProjectItem_Tests.cs Adds DisableDiscoveryEnumeration to MemberData attribute for UpdateAndRemoveShouldWorkWithEscapedCharactersTestData test
src/Build.OM.UnitTests/Definition/DefinitionEditing_Tests.cs Adds DisableDiscoveryEnumeration to 10 MemberData attributes across multiple test methods
src/Build.OM.UnitTests/Construction/ConstructionEditing_Tests.cs Adds DisableDiscoveryEnumeration to 2 MemberData attributes for metadata element insertion tests

@JanProvaznik JanProvaznik merged commit a8434cb into dotnet:main Jan 7, 2026
16 checks passed
@JanProvaznik JanProvaznik deleted the interning-test-data-serializability branch January 7, 2026 15:46
This was referenced Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants