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

Query: Re-enable few more test classes #16606

Merged
merged 1 commit into from
Jul 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,6 @@ public virtual void Can_change_principal_and_dependent_instance_non_derived()
protected void AssertSql(params string[] expected)
=> TestSqlLoggerFactory.AssertBaseline(expected);

protected void AssertContainsSql(params string[] expected)
=> TestSqlLoggerFactory.AssertBaseline(expected, assertOrder: false);

protected virtual void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Vehicle>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public TestSqlLoggerFactory(Func<string, bool> shouldLogCategory)
public IReadOnlyList<string> Parameters => ((TestSqlLogger)Logger).Parameters;
public string Sql => string.Join(_eol + _eol, SqlStatements);

public void AssertBaseline(string[] expected, bool assertOrder = true)
public void AssertBaseline(string[] expected)
{
if (_proceduralQueryGeneration)
{
Expand All @@ -44,22 +44,9 @@ public void AssertBaseline(string[] expected, bool assertOrder = true)

try
{
if (assertOrder)
for (var i = 0; i < expected.Length; i++)
{
for (var i = 0; i < expected.Length; i++)
{
Assert.Equal(expected[i], SqlStatements[i], ignoreLineEndingDifferences: true);
}
}
else
{
foreach (var expectedFragment in expected)
{
var normalizedExpectedFragment = expectedFragment.Replace("\r", string.Empty).Replace("\n", _eol);
Assert.Contains(
normalizedExpectedFragment,
SqlStatements);
}
Assert.Equal(expected[i], SqlStatements[i], ignoreLineEndingDifferences: true);
}
}
catch
Expand Down
24 changes: 12 additions & 12 deletions test/EFCore.Specification.Tests/Query/QueryNavigationsTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public virtual Task Select_Where_Navigation_Deep(bool isAsync)
entryCount: 1);
}

[ConditionalTheory]
[ConditionalTheory(Skip = "Issue#10001")]
[MemberData(nameof(IsAsyncData))]
public virtual Task Take_Select_Navigation(bool isAsync)
{
Expand Down Expand Up @@ -259,7 +259,7 @@ public virtual Task Select_collection_FirstOrDefault_project_single_column2(bool
.Select(c => c.Orders.OrderBy(o => o.OrderID).Select(o => o.CustomerID).FirstOrDefault()));
}

[ConditionalTheory]
[ConditionalTheory(Skip = "Issue#10001")]
[MemberData(nameof(IsAsyncData))]
public virtual Task Select_collection_FirstOrDefault_project_anonymous_type(bool isAsync)
{
Expand All @@ -275,7 +275,7 @@ public virtual Task Select_collection_FirstOrDefault_project_anonymous_type(bool
assertOrder: true);
}

[ConditionalTheory]
[ConditionalTheory(Skip = "Issue#10001")]
[MemberData(nameof(IsAsyncData))]
public virtual Task Select_collection_FirstOrDefault_project_entity(bool isAsync)
{
Expand All @@ -284,7 +284,7 @@ public virtual Task Select_collection_FirstOrDefault_project_entity(bool isAsync
cs => cs.OrderBy(c => c.CustomerID).Take(2).Select(c => c.Orders.OrderBy(o => o.OrderID).FirstOrDefault()));
}

[ConditionalTheory]
[ConditionalTheory(Skip = "Issue#10001")]
[MemberData(nameof(IsAsyncData))]
public virtual Task Skip_Select_Navigation(bool isAsync)
{
Expand Down Expand Up @@ -937,7 +937,7 @@ where c.Orders.Sum(o => o.OrderID) > 1000
}
}

[ConditionalTheory]
[ConditionalTheory(Skip = "Issue#10001")]
[MemberData(nameof(IsAsyncData))]
public virtual Task Collection_select_nav_prop_first_or_default(bool isAsync)
{
Expand All @@ -958,7 +958,7 @@ orderby c.CustomerID
assertOrder: true);
}

[ConditionalTheory]
[ConditionalTheory(Skip = "Issue#10001")]
[MemberData(nameof(IsAsyncData))]
public virtual Task Collection_select_nav_prop_first_or_default_then_nav_prop(bool isAsync)
{
Expand Down Expand Up @@ -1283,7 +1283,7 @@ public virtual Task Project_single_scalar_value_subquery_is_properly_inlined(boo
elementSorter: e => e.CustomerID);
}

[ConditionalTheory]
[ConditionalTheory(Skip = "Issue#10001")]
[MemberData(nameof(IsAsyncData))]
public virtual Task Project_single_entity_value_subquery_works(bool isAsync)
{
Expand Down Expand Up @@ -1383,7 +1383,7 @@ orderby c.CustomerID descending
select grouping.Count());
}

[ConditionalTheory]
[ConditionalTheory(Skip = "Issue#15711")]
[InlineData(false)]
//[InlineData(true)] issue #12449
public virtual Task Navigation_projection_on_groupjoin_qsre(bool isAsync)
Expand Down Expand Up @@ -1413,7 +1413,7 @@ join o in os on c.CustomerID equals o.CustomerID into grouping
entryCount: 1);
}

[ConditionalTheory]
[ConditionalTheory(Skip = "Issue#15711")]
[InlineData(false)]
//[InlineData(true)] issue #12449
public virtual Task Navigation_projection_on_groupjoin_qsre_no_outer_in_final_result(bool isAsync)
Expand All @@ -1435,7 +1435,7 @@ select grouping.Select(o => o.OrderDetails).ToList(),
});
}

[ConditionalTheory]
[ConditionalTheory(Skip = "Issue#15711")]
[InlineData(false)]
//[InlineData(true)] issue #12449
public virtual Task Navigation_projection_on_groupjoin_qsre_with_empty_grouping(bool isAsync)
Expand Down Expand Up @@ -1466,7 +1466,7 @@ where c.CustomerID.StartsWith("A")
entryCount: 4);
}

[ConditionalFact]
[ConditionalFact(Skip = "Issue#15711")]
public virtual void Include_on_inner_projecting_groupjoin()
{
using (var ctx = CreateContext())
Expand All @@ -1485,7 +1485,7 @@ join o in ctx.Orders.Include(oo => oo.OrderDetails) on c.CustomerID equals o.Cus
}
}

[ConditionalFact]
[ConditionalFact(Skip = "Issue#15711")]
public virtual void Include_on_inner_projecting_groupjoin_complex()
{
using (var ctx = CreateContext())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,5 @@ WHERE [e.StorageLocation].[StorageLocation_Longitude] IS NOT NULL AND [e.Storage
WHERE [Id] = @p1 AND [EngineSupplierId] = @p2 AND [Name] = @p3 AND [StorageLocation_Latitude] = @p4 AND [StorageLocation_Longitude] = @p5;
SELECT @@ROWCOUNT;");*/
}

private void AssertContainsSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected, assertOrder: false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public override void Included_one_to_many_query_with_client_eval()
{
base.Included_one_to_many_query_with_client_eval();

AssertContainsSql(
AssertSql(
@"SELECT [p].[ProductID], [p].[Discontinued], [p].[ProductName], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock]
FROM [Products] AS [p]
ORDER BY [p].[ProductID]",
Expand Down Expand Up @@ -266,8 +266,5 @@ FROM [Customers] AS [c]

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

private void AssertContainsSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected, assertOrder: false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Microsoft.EntityFrameworkCore.Query
{
internal class GearsOfWarFromSqlQuerySqlServerTest : GearsOfWarFromSqlQueryTestBase<GearsOfWarQuerySqlServerFixture>
public class GearsOfWarFromSqlQuerySqlServerTest : GearsOfWarFromSqlQueryTestBase<GearsOfWarQuerySqlServerFixture>
{
public GearsOfWarFromSqlQuerySqlServerTest(GearsOfWarQuerySqlServerFixture fixture, ITestOutputHelper testOutputHelper)
: base(fixture)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2938,7 +2938,7 @@ public override async Task Select_correlated_filtered_collection_works_with_cach
{
await base.Select_correlated_filtered_collection_works_with_caching(isAsync);

AssertContainsSql(
AssertSql(
@"SELECT [t].[GearNickName]
FROM [Tags] AS [t]
ORDER BY [t].[Note]",
Expand Down Expand Up @@ -3741,7 +3741,7 @@ public override async Task Client_method_on_collection_navigation_in_outer_join_
{
await base.Client_method_on_collection_navigation_in_outer_join_key(isAsync);

AssertContainsSql(
AssertSql(
@"SELECT [g].[FullName], [g].[Nickname]
FROM [Gears] AS [g]
WHERE [g].[Discriminator] IN (N'Officer', N'Gear')",
Expand Down Expand Up @@ -6302,7 +6302,7 @@ public override async Task Join_on_entity_qsre_keys_inner_key_is_navigation_comp
{
await base.Join_on_entity_qsre_keys_inner_key_is_navigation_composite_key(isAsync);

AssertContainsSql(
AssertSql(
@"SELECT [t].[GearNickName], [t].[GearSquadId], [t].[Note]
FROM (
SELECT [tt].*
Expand Down Expand Up @@ -6368,7 +6368,7 @@ public override async Task Join_with_complex_key_selector(bool isAsync)
{
await base.Join_with_complex_key_selector(isAsync);

AssertContainsSql(
AssertSql(
@"SELECT [ii].[Nickname], [ii].[SquadId], [ii].[AssignedCityName], [ii].[CityOrBirthName], [ii].[Discriminator], [ii].[FullName], [ii].[HasSoulPatch], [ii].[LeaderNickname], [ii].[LeaderSquadId], [ii].[Rank]
FROM [Gears] AS [ii]
WHERE [ii].[Discriminator] IN (N'Officer', N'Gear')",
Expand Down Expand Up @@ -7893,9 +7893,6 @@ FROM [Missions] AS [m]
private void AssertSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected);

private void AssertContainsSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected, assertOrder: false);

protected override void ClearLog()
=> Fixture.TestSqlLoggerFactory.Clear();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ public override async Task GroupBy_Aggregate_Join(bool isAsync)
{
await base.GroupBy_Aggregate_Join(isAsync);

AssertContainsSql(
AssertSql(
@"SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate]
FROM [Orders] AS [o0]",
//
Expand All @@ -1321,7 +1321,7 @@ public override async Task Join_GroupBy_Aggregate_multijoins(bool isAsync)
await base.Join_GroupBy_Aggregate_multijoins(isAsync);

// This could be lifted. Blocked by bug #10812
AssertContainsSql(
AssertSql(
@"SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate]
FROM [Orders] AS [o0]",
//
Expand Down Expand Up @@ -1370,7 +1370,7 @@ public override async Task Join_GroupBy_Aggregate_in_subquery(bool isAsync)
{
await base.Join_GroupBy_Aggregate_in_subquery(isAsync);

AssertContainsSql(
AssertSql(
@"SELECT [c0].[CustomerID], [c0].[Address], [c0].[City], [c0].[CompanyName], [c0].[ContactName], [c0].[ContactTitle], [c0].[Country], [c0].[Fax], [c0].[Phone], [c0].[PostalCode], [c0].[Region], [t0].[CustomerID], [t0].[LastOrderID]
FROM [Customers] AS [c0]
INNER JOIN (
Expand Down Expand Up @@ -2027,9 +2027,6 @@ ELSE CAST(0 AS bit)
private void AssertSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected);

private void AssertContainsSql(params string[] expected)
=> Fixture.TestSqlLoggerFactory.AssertBaseline(expected, assertOrder: false);

protected override void ClearLog()
=> Fixture.TestSqlLoggerFactory.Clear();
}
Expand Down
Loading