Skip to content
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

Navigation test refactoring - improving structure for scenarios that don't support collections #35709

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maumar
Copy link
Contributor

@maumar maumar commented Mar 2, 2025

Plus minor cleanup

Fixes #35707

@maumar maumar requested a review from a team March 2, 2025 03:36
@maumar maumar enabled auto-merge (squash) March 2, 2025 03:38
@@ -40,6 +40,7 @@ public class InMemoryComplianceTest : ComplianceTestBase
typeof(RelationshipsInProjectionQueryTestBase<>),
typeof(EntityRelationshipsIncludeQueryTestBase<>),
typeof(RelationshipsIncludeQueryTestBase<>),
typeof(RelationshipsNoCollectionsInProjectionQueryTestBase<>),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a better name here, ReferenceRelationships? (also below)

public abstract class RelationshipsNoCollectionsInProjectionQueryTestBase<TFixture>(TFixture fixture) : RelationshipsInProjectionQueryTestBase<TFixture>(fixture)
where TFixture : RelationshipsQueryFixtureBase, new()
{
public sealed override Task Project_trunk_collection(bool async)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO this is IMHO the kind of pattern we should be avoiding - it would mean that every time we add a test that exercises collection relationships, we'd have to add an ignore here. Ideally, we'd have a test base class with only reference relationships (which can be extended multiple times - for JSON, for table splitting) and a another one which has tests for collection relationships.

In other words, organize our tests based on what's supported and what isn't; just like we want to separate tests that require navigations, since those can't work on Cosmos and other document databases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my initial approach, but I didn't like the outcome because of test class explosion (essentially doubling the number of classes) - will see if I can make it better.

@maumar maumar disabled auto-merge March 2, 2025 08:54
@maumar maumar marked this pull request as draft March 2, 2025 12:54
@maumar
Copy link
Contributor Author

maumar commented Mar 2, 2025

converting to draft, see #35711 instead

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.

Query/Test: add relationship test model which only contains references (no collections)
2 participants