Skip to content

Commit

Permalink
Scrub tests
Browse files Browse the repository at this point in the history
Covers EFCore.Specs.Tests Query folder

Resolves #8366
Resolves #8582
Resolves #8722
Resolves #9007
Resolves #9254
Resolves #12574
Resolves #12579
Resolves #12598
Resolves #12786
Resolves #12787
Resolves #12794
Resolves #12806
Resolves #12827
Resolves #12873
Resolves #14900
Resolves #15862
Resolves #16157
Resolves #17240


Close #12889
Close #17243
  • Loading branch information
smitpatel committed Sep 11, 2019
1 parent 962a949 commit 87f4367
Show file tree
Hide file tree
Showing 28 changed files with 387 additions and 560 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public override void KeylessEntity_with_nav_defining_query()
@"");
}

[ConditionalTheory(Skip = "Issue #17246")]
public override async Task KeylessEntity_with_mixed_tracking(bool isAsync)
{
await AssertQuery<Customer, OrderQuery>(
Expand All @@ -78,6 +79,7 @@ FROM root c
WHERE ((c[""Discriminator""] = ""Order"") AND (c[""CustomerID""] = ""ALFKI""))");
}

[ConditionalTheory(Skip = "Issue #17246")]
public override async Task KeylessEntity_with_defining_query_and_correlated_collection(bool isAsync)
{
await base.KeylessEntity_with_defining_query_and_correlated_collection(isAsync);
Expand All @@ -88,15 +90,15 @@ FROM root c
WHERE (c[""Discriminator""] = ""Customer"")");
}

[ConditionalTheory(Skip = "issue 312086")] // left join translation
[ConditionalTheory(Skip = "issue 12086")] // left join translation
public override async Task KeylessEntity_select_where_navigation(bool isAsync)
{
await base.KeylessEntity_select_where_navigation(isAsync);

AssertSql(@"");
}

[ConditionalTheory(Skip = "issue 312086")] // left join translation
[ConditionalTheory(Skip = "issue 12086")] // left join translation
public override async Task KeylessEntity_select_where_navigation_multi_level(bool isAsync)
{
await AssertQuery<OrderQuery>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ FROM root c
WHERE (c[""Discriminator""] = ""Customer"")");
}

[ConditionalTheory(Skip = "Issue #17246")]
public override async Task Where_subquery_anon_nested(bool isAsync)
{
await base.Where_subquery_anon_nested(isAsync);
Expand Down Expand Up @@ -1762,6 +1763,7 @@ FROM root c
WHERE (c[""Discriminator""] = ""Employee"")");
}

[ConditionalTheory(Skip = "Issue #17246")]
public override async Task OrderBy_multiple(bool isAsync)
{
await base.OrderBy_multiple(isAsync);
Expand Down Expand Up @@ -3568,6 +3570,7 @@ FROM root c
WHERE (c[""Discriminator""] = ""Customer"")");
}

[ConditionalTheory(Skip = "Issue #17246")]
public override async Task Complex_nested_query_doesnt_try_binding_to_grandparent_when_parent_returns_complex_result(bool isAsync)
{
await base.Complex_nested_query_doesnt_try_binding_to_grandparent_when_parent_returns_complex_result(isAsync);
Expand Down Expand Up @@ -4128,6 +4131,12 @@ public override Task OrderBy_object_type_server_evals(bool isAsync)
return base.OrderBy_object_type_server_evals(isAsync);
}

[ConditionalTheory(Skip = "Issue #17246")]
public override Task SelectMany_correlated_subquery_hard(bool isAsync)
{
return base.SelectMany_correlated_subquery_hard(isAsync);
}

private void AssertSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void AssertBaseline(string[] expected, bool assertOrder = true)
var logFile = currentDirectory.Substring(
0,
currentDirectory.LastIndexOf("\\artifacts\\", StringComparison.Ordinal) + 1)
+ "QueryBaseline.cs";
+ "QueryBaseline.txt";

var testInfo = testName + " : " + lineNumber + FileNewLine;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@ public AsyncSimpleQueryInMemoryTest(NorthwindQueryInMemoryFixture<NoopModelCusto
: base(fixture)
{
}

// InMemory can throw server side exception
public override Task Average_on_nav_subquery_in_projection()
{
return Task.CompletedTask;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ var results
}
}

[ConditionalFact(Skip = "Issue#16318")]
[ConditionalFact]
public virtual async Task Average_on_nav_subquery_in_projection()
{
using (var context = CreateContext())
{
var results
= await context.Customers.Select(
c => new { Ave = c.Orders.Average(o => o.Freight) })
c => new { Ave = c.Orders.Average(o => o.OrderID) })
.ToListAsync();

Assert.Equal(91, results.ToList().Count);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,9 +756,8 @@ join e1 in l1s on e3.Id equals MaybeScalar(
e => e.Id3 + " " + e.Id1);
}

// issue #12787
//[ConditionalTheory]
//[MemberData(nameof(IsAsyncData))]
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Join_navigation_nested2(bool isAsync)
{
return AssertQuery<Level1, Level3>(
Expand Down Expand Up @@ -2133,7 +2132,7 @@ public virtual Task Null_protection_logic_work_for_inner_key_access_of_manually_
(e, a) => Assert.Equal(e.Id, a.Id));
}

[ConditionalTheory(Skip = "Issue#15872")]
[ConditionalTheory(Skip = "Issue#17068")]
[MemberData(nameof(IsAsyncData))]
public virtual Task Null_protection_logic_work_for_inner_key_access_of_manually_created_GroupJoin2(bool isAsync)
{
Expand Down Expand Up @@ -2281,7 +2280,7 @@ public virtual Task Order_by_key_of_anonymous_type_projected_navigation_doesnt_g
assertOrder: true);
}

[ConditionalTheory(Skip = "Issue#15872")]
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Optional_navigation_take_optional_navigation(bool isAsync)
{
Expand Down Expand Up @@ -2383,9 +2382,8 @@ public virtual Task SelectMany_with_Include1(bool isAsync)
elementSorter: e => e.Id);
}

// issue #12794
//[ConditionalTheory]
//[MemberData(nameof(IsAsyncData))]
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Orderby_SelectMany_with_Include1(bool isAsync)
{
return AssertIncludeQuery<Level1>(
Expand Down Expand Up @@ -3313,7 +3311,7 @@ orderby l2i.Id
select new { Navigation = l2i.OneToOne_Required_FK_Inverse2, Constant = 7 }).First().Navigation.Name);
}

[ConditionalTheory(Skip = "Issue #15832")]
[ConditionalTheory(Skip = "Issue #17756")]
[MemberData(nameof(IsAsyncData))]
public virtual Task Required_navigation_on_a_subquery_with_First_in_predicate(bool isAsync)
{
Expand Down Expand Up @@ -3641,7 +3639,7 @@ from l2_outer in grouping_outer.DefaultIfEmpty()
select Maybe(l2_outer, () => l2_outer.Name));
}

[ConditionalTheory(Skip = "Issue #17068")]
[ConditionalTheory(Skip = "Issue #17328")]
[MemberData(nameof(IsAsyncData))]
public virtual Task GroupJoin_on_a_subquery_containing_another_GroupJoin_projecting_outer_with_client_method(bool isAsync)
{
Expand Down Expand Up @@ -3674,7 +3672,7 @@ private static Level1 ClientLevel1(Level1 arg)
return arg;
}

[ConditionalTheory(Skip = "Issue#15872")]
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task GroupJoin_on_a_subquery_containing_another_GroupJoin_projecting_inner(bool isAsync)
{
Expand Down Expand Up @@ -3702,9 +3700,8 @@ from l1_outer in grouping_outer.DefaultIfEmpty()
select Maybe(l1_outer, () => l1_outer.Name));
}

// issue #12806
//[ConditionalTheory]
//[MemberData(nameof(IsAsyncData))]
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task GroupJoin_on_a_subquery_containing_another_GroupJoin_with_orderby_on_inner_sequence_projecting_inner(
bool isAsync)
{
Expand Down Expand Up @@ -3781,7 +3778,7 @@ private static bool ClientMethod(int? id)
return true;
}

[ConditionalTheory(Skip = "AlreadyFixed")]
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task GroupJoin_in_subquery_with_client_result_operator(bool isAsync)
{
Expand All @@ -3797,7 +3794,7 @@ where l1.Id < 3
select l1.Name);
}

[ConditionalTheory(Skip = "Issue #17068")]
[ConditionalTheory(Skip = "Issue #17328")]
[MemberData(nameof(IsAsyncData))]
public virtual Task GroupJoin_in_subquery_with_client_projection(bool isAsync)
{
Expand All @@ -3813,7 +3810,7 @@ where l1.Id < 3
select l1.Name);
}

[ConditionalTheory(Skip = "Issue #17068")]
[ConditionalTheory(Skip = "Issue #17328")]
[MemberData(nameof(IsAsyncData))]
public virtual Task GroupJoin_in_subquery_with_client_projection_nested1(bool isAsync)
{
Expand All @@ -3834,7 +3831,7 @@ where l1_outer.Id < 2
select l1_outer.Name);
}

[ConditionalTheory(Skip = "Issue #17068")]
[ConditionalTheory(Skip = "Issue #17328")]
[MemberData(nameof(IsAsyncData))]
public virtual Task GroupJoin_in_subquery_with_client_projection_nested2(bool isAsync)
{
Expand Down Expand Up @@ -3889,7 +3886,7 @@ from l2 in groupJoin.DefaultIfEmpty()
elementAsserter: (e, a) => Assert.Equal(e.Id + " " + e.client, a.Id + " " + a.client));
}

[ConditionalTheory(Skip = "Issue #17068")]
[ConditionalTheory(Skip = "Issue #17328")]
[MemberData(nameof(IsAsyncData))]
public virtual Task GroupJoin_client_method_in_OrderBy(bool isAsync)
{
Expand Down Expand Up @@ -4169,7 +4166,7 @@ public virtual Task Navigation_filter_navigation_grouping_ordering_by_group_key(
assertOrder: true);
}

[ConditionalTheory(Skip = "Issue#15872")]
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Nested_group_join_with_take(bool isAsync)
{
Expand Down Expand Up @@ -4368,7 +4365,7 @@ public virtual Task Select_subquery_with_client_eval_and_navigation2(bool isAsyn
l2s => l2s.Select(l2 => l2s.OrderBy(l => l.Id).First().OneToOne_Required_FK_Inverse2.Name == "L1 02"));
}

[ConditionalTheory(Skip = "issue #8526")]
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Select_subquery_with_client_eval_and_multi_level_navigation(bool isAsync)
{
Expand Down Expand Up @@ -4651,15 +4648,15 @@ public virtual Task Project_navigation_and_collection(bool isAsync)
});
}

[ConditionalFact(Skip = "issue #8722")]
[ConditionalFact]
public virtual void Include_inside_subquery()
{
using (var ctx = CreateContext())
{
var query = ctx.LevelOne
.Where(l1 => l1.Id < 3)
.Select(
l1 => new { subquery = ctx.LevelTwo.Include(l => l.OneToMany_Optional2).Where(l => l.Id > 0) });
l1 => new { subquery = ctx.LevelTwo.Include(l => l.OneToMany_Optional2).Where(l => l.Id > 0).ToList() });

var result = query.ToList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,6 @@ protected ComplexNavigationsWeakQueryTestBase(TFixture fixture)
{
}

[ConditionalTheory(Skip = "issue #8248")]
public override Task Required_navigation_on_a_subquery_with_First_in_projection(bool isAsync)
{
return base.Required_navigation_on_a_subquery_with_First_in_projection(isAsync);
}

[ConditionalTheory(Skip = "issue #8526")]
public override Task Select_subquery_with_client_eval_and_navigation1(bool isAsync)
{
return base.Select_subquery_with_client_eval_and_navigation1(isAsync);
}

[ConditionalTheory(Skip = "issue #8526")]
public override Task Select_subquery_with_client_eval_and_navigation2(bool isAsync)
{
return base.Select_subquery_with_client_eval_and_navigation2(isAsync);
}

// Naked instances not supported
public override Task Entity_equality_empty(bool isAsync)
{
Expand Down Expand Up @@ -180,5 +162,9 @@ public override void Member_pushdown_chain_3_levels_deep()
public override void Member_pushdown_with_collection_navigation_in_the_middle()
{
}

public override void Include_inside_subquery()
{
}
}
}
2 changes: 1 addition & 1 deletion test/EFCore.Specification.Tests/Query/FiltersTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public virtual void Included_one_to_many_query_with_client_eval()
() => _context.Products.Include(p => p.OrderDetails).ToList()).Message));
}

[ConditionalFact(Skip = "issue #15081")]
[ConditionalFact]
public virtual void Navs_query()
{
var results
Expand Down
Loading

0 comments on commit 87f4367

Please sign in to comment.