Rename test methods hidden by same-name overloads so they can be run - #38766
Open
AndriySvyryd with Copilot wants to merge 2 commits into
Open
Rename test methods hidden by same-name overloads so they can be run#38766AndriySvyryd with Copilot wants to merge 2 commits into
AndriySvyryd with Copilot wants to merge 2 commits into
Conversation
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix tests that are discovered but not running
Rename test methods hidden by same-name overloads so they can be run
Aug 7, 2026
AndriySvyryd
marked this pull request as ready for review
August 7, 2026 21:31
There was a problem hiding this comment.
Pull request overview
This PR fixes a test-discovery/runtime issue where certain tests were discovered but never executed due to name collisions with same-name overloads (generic helper overloads in model-building tests, and object.Equals in string translation tests).
Changes:
- Renamed the generic helper overloads in
ModelBuilderTest.NonRelationshipandModelBuilderTest.ComplexTypeto use an_implementationsuffix, aligning with the existingComplexCollectionspattern and ensuring the actual[Fact]methods can be invoked by the runner. - Renamed
StringTranslationsTestBase.EqualstoInstance_Equalsto avoid collisions with inheritedEqualsoverloads; updated SQL Server, SQLite, and Cosmos overrides accordingly. - Updated Cosmos model-building overrides to call the renamed
_implementationhelpers.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/EFCore.Specification.Tests/ModelBuilding/ModelBuilderTest.NonRelationship.cs | Renames generic helper overloads to _implementation to avoid test-method name collisions. |
| test/EFCore.Specification.Tests/ModelBuilding/ModelBuilderTest.ComplexType.cs | Same _implementation renames for complex-type model-building tests (including skipped cases). |
| test/EFCore.Cosmos.FunctionalTests/ModelBuilding/CosmosModelBuilderGenericTest.cs | Updates Cosmos overrides to call the renamed _implementation helpers. |
| test/EFCore.Specification.Tests/Query/Translations/StringTranslationsTestBase.cs | Renames Equals test to Instance_Equals to avoid object.Equals overload collision. |
| test/EFCore.SqlServer.FunctionalTests/Query/Translations/StringTranslationsSqlServerTest.cs | Updates override to Instance_Equals and calls the renamed base method. |
| test/EFCore.Sqlite.FunctionalTests/Query/Translations/StringTranslationsSqliteTest.cs | Updates override to Instance_Equals and calls the renamed base method. |
| test/EFCore.Cosmos.FunctionalTests/Query/Translations/StringTranslationsCosmosTest.cs | Updates override to Instance_Equals and calls the renamed base method. |
AndriySvyryd
enabled auto-merge (squash)
August 7, 2026 22:00
Contributor
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A handful of tests are discovered by the runner but never execute — the runner cannot resolve the test method when another method of the same name exists on the type.
Two distinct collisions:
ModelBuilderTest.NonRelationshipandModelBuilderTest.ComplexTypeeach declare a[ConditionalFact]method plus a protected generic overload of the same name.ModelBuilderTest.ComplexCollectionsalready avoids this with an_implementationsuffix; these two files now follow suit.object.Equals.StringTranslationsTestBase.Equals()collides with the inheritedEqualsoverloads.Changes
ModelBuilderTest.NonRelationship.cs,ModelBuilderTest.ComplexType.cs: generic overloads ofProperties_can_have_provider_type_set,Properties_can_have_non_generic_value_converter_set,Properties_can_have_custom_type_value_converter_type_setrenamed with an_implementationsuffix; Cosmos overrides updated.StringTranslationsTestBase.Equals→Instance_Equals, mirroring the existingStatic_Equals; SQL Server, SQLite and Cosmos overrides updated.The rest of the test tree was scanned for test methods sharing a name with a generic overload or an
objectmember; no other test methods are affected.After the rename the previously-invisible tests report normally — the three
Properties_can_have_*tests now run or surface as skipped (Issue #35613) rather than silently doing nothing.