Skip to content

Rename test methods hidden by same-name overloads so they can be run - #38766

Open
AndriySvyryd with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-some-tests-not-running
Open

Rename test methods hidden by same-name overloads so they can be run#38766
AndriySvyryd with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-some-tests-not-running

Conversation

Copilot AI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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:

  • Generic helper overloads. ModelBuilderTest.NonRelationship and ModelBuilderTest.ComplexType each declare a [ConditionalFact] method plus a protected generic overload of the same name. ModelBuilderTest.ComplexCollections already avoids this with an _implementation suffix; these two files now follow suit.
  • object.Equals. StringTranslationsTestBase.Equals() collides with the inherited Equals overloads.

Changes

  • ModelBuilderTest.NonRelationship.cs, ModelBuilderTest.ComplexType.cs: generic overloads of Properties_can_have_provider_type_set, Properties_can_have_non_generic_value_converter_set, Properties_can_have_custom_type_value_converter_type_set renamed with an _implementation suffix; Cosmos overrides updated.
  • StringTranslationsTestBase.EqualsInstance_Equals, mirroring the existing Static_Equals; SQL Server, SQLite and Cosmos overrides updated.
[ConditionalFact]
public virtual void Properties_can_have_provider_type_set()
    => Properties_can_have_provider_type_set_implementation<byte[]>();

protected virtual void Properties_can_have_provider_type_set_implementation<TBytes>()

The rest of the test tree was scanned for test methods sharing a name with a generic overload or an object member; 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.

Copilot AI linked an issue Aug 7, 2026 that may be closed by this pull request
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
Copilot AI requested a review from AndriySvyryd August 7, 2026 20:59
@AndriySvyryd
AndriySvyryd requested a lite review from Copilot August 7, 2026 21:31
@AndriySvyryd
AndriySvyryd marked this pull request as ready for review August 7, 2026 21:31
@AndriySvyryd
AndriySvyryd requested a review from a team as a code owner August 7, 2026 21:31

Copilot AI left a comment

Copy link
Copy Markdown

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 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.NonRelationship and ModelBuilderTest.ComplexType to use an _implementation suffix, aligning with the existing ComplexCollections pattern and ensuring the actual [Fact] methods can be invoked by the runner.
  • Renamed StringTranslationsTestBase.Equals to Instance_Equals to avoid collisions with inherited Equals overloads; updated SQL Server, SQLite, and Cosmos overrides accordingly.
  • Updated Cosmos model-building overrides to call the renamed _implementation helpers.

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
AndriySvyryd requested a review from cincuranet August 7, 2026 22:00
@AndriySvyryd
AndriySvyryd enabled auto-merge (squash) August 7, 2026 22:00
@ChrisJollyAU

Copy link
Copy Markdown
Contributor

LGTM

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.

Some tests dont even get run

4 participants