Skip to content

Commit

Permalink
Clean up in SqlServer functional tests config
Browse files Browse the repository at this point in the history
- Remove TeamCity CI condition
- Remove SupportsOffset as our lowest supported SqlServer version supports offset
- Remove env variable for FreeText and detect by connecting to server
  • Loading branch information
smitpatel committed Mar 17, 2020
1 parent b59a246 commit 0573af8
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 147 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public ComplexNavigationsQuerySqlServerTest(
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

private bool SupportsOffset => TestEnvironment.GetFlag(nameof(SqlServerCondition.SupportsOffset)) ?? true;

public override async Task Entity_equality_empty(bool async)
{
await base.Entity_equality_empty(async);
Expand Down Expand Up @@ -1262,10 +1260,8 @@ public override async Task Complex_multi_include_with_order_by_and_paging(bool a
{
await base.Complex_multi_include_with_order_by_and_paging(async);

if (SupportsOffset)
{
AssertSql(
@"@__p_0='0'
AssertSql(
@"@__p_0='0'
@__p_1='10'
SELECT [t].[Id], [t].[Date], [t].[Name], [t].[OneToMany_Optional_Self_Inverse1Id], [t].[OneToMany_Required_Self_Inverse1Id], [t].[OneToOne_Optional_Self1Id], [l0].[Id], [l0].[Date], [l0].[Level1_Optional_Id], [l0].[Level1_Required_Id], [l0].[Name], [l0].[OneToMany_Optional_Inverse2Id], [l0].[OneToMany_Optional_Self_Inverse2Id], [l0].[OneToMany_Required_Inverse2Id], [l0].[OneToMany_Required_Self_Inverse2Id], [l0].[OneToOne_Optional_PK_Inverse2Id], [l0].[OneToOne_Optional_Self2Id], [l1].[Id], [l1].[Level2_Optional_Id], [l1].[Level2_Required_Id], [l1].[Name], [l1].[OneToMany_Optional_Inverse3Id], [l1].[OneToMany_Optional_Self_Inverse3Id], [l1].[OneToMany_Required_Inverse3Id], [l1].[OneToMany_Required_Self_Inverse3Id], [l1].[OneToOne_Optional_PK_Inverse3Id], [l1].[OneToOne_Optional_Self3Id], [l2].[Id], [l2].[Level2_Optional_Id], [l2].[Level2_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse3Id], [l2].[OneToMany_Optional_Self_Inverse3Id], [l2].[OneToMany_Required_Inverse3Id], [l2].[OneToMany_Required_Self_Inverse3Id], [l2].[OneToOne_Optional_PK_Inverse3Id], [l2].[OneToOne_Optional_Self3Id]
Expand All @@ -1279,17 +1275,14 @@ OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY
LEFT JOIN [LevelThree] AS [l1] ON [l0].[Id] = [l1].[OneToMany_Optional_Inverse3Id]
LEFT JOIN [LevelThree] AS [l2] ON [l0].[Id] = [l2].[OneToMany_Required_Inverse3Id]
ORDER BY [t].[Name], [t].[Id], [l1].[Id], [l2].[Id]");
}
}

public override async Task Complex_multi_include_with_order_by_and_paging_joins_on_correct_key(bool async)
{
await base.Complex_multi_include_with_order_by_and_paging_joins_on_correct_key(async);

if (SupportsOffset)
{
AssertSql(
@"@__p_0='0'
AssertSql(
@"@__p_0='0'
@__p_1='10'
SELECT [t].[Id], [t].[Date], [t].[Name], [t].[OneToMany_Optional_Self_Inverse1Id], [t].[OneToMany_Required_Self_Inverse1Id], [t].[OneToOne_Optional_Self1Id], [l0].[Id], [l0].[Date], [l0].[Level1_Optional_Id], [l0].[Level1_Required_Id], [l0].[Name], [l0].[OneToMany_Optional_Inverse2Id], [l0].[OneToMany_Optional_Self_Inverse2Id], [l0].[OneToMany_Required_Inverse2Id], [l0].[OneToMany_Required_Self_Inverse2Id], [l0].[OneToOne_Optional_PK_Inverse2Id], [l0].[OneToOne_Optional_Self2Id], [l1].[Id], [l1].[Date], [l1].[Level1_Optional_Id], [l1].[Level1_Required_Id], [l1].[Name], [l1].[OneToMany_Optional_Inverse2Id], [l1].[OneToMany_Optional_Self_Inverse2Id], [l1].[OneToMany_Required_Inverse2Id], [l1].[OneToMany_Required_Self_Inverse2Id], [l1].[OneToOne_Optional_PK_Inverse2Id], [l1].[OneToOne_Optional_Self2Id], [l2].[Id], [l2].[Level2_Optional_Id], [l2].[Level2_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse3Id], [l2].[OneToMany_Optional_Self_Inverse3Id], [l2].[OneToMany_Required_Inverse3Id], [l2].[OneToMany_Required_Self_Inverse3Id], [l2].[OneToOne_Optional_PK_Inverse3Id], [l2].[OneToOne_Optional_Self3Id], [l3].[Id], [l3].[Level2_Optional_Id], [l3].[Level2_Required_Id], [l3].[Name], [l3].[OneToMany_Optional_Inverse3Id], [l3].[OneToMany_Optional_Self_Inverse3Id], [l3].[OneToMany_Required_Inverse3Id], [l3].[OneToMany_Required_Self_Inverse3Id], [l3].[OneToOne_Optional_PK_Inverse3Id], [l3].[OneToOne_Optional_Self3Id]
Expand All @@ -1304,17 +1297,14 @@ OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY
LEFT JOIN [LevelThree] AS [l2] ON [l0].[Id] = [l2].[OneToMany_Optional_Inverse3Id]
LEFT JOIN [LevelThree] AS [l3] ON [l1].[Id] = [l3].[OneToMany_Required_Inverse3Id]
ORDER BY [t].[Name], [t].[Id], [l2].[Id], [l3].[Id]");
}
}

public override async Task Complex_multi_include_with_order_by_and_paging_joins_on_correct_key2(bool async)
{
await base.Complex_multi_include_with_order_by_and_paging_joins_on_correct_key2(async);

if (SupportsOffset)
{
AssertSql(
@"@__p_0='0'
AssertSql(
@"@__p_0='0'
@__p_1='10'
SELECT [t].[Id], [t].[Date], [t].[Name], [t].[OneToMany_Optional_Self_Inverse1Id], [t].[OneToMany_Required_Self_Inverse1Id], [t].[OneToOne_Optional_Self1Id], [l0].[Id], [l0].[Date], [l0].[Level1_Optional_Id], [l0].[Level1_Required_Id], [l0].[Name], [l0].[OneToMany_Optional_Inverse2Id], [l0].[OneToMany_Optional_Self_Inverse2Id], [l0].[OneToMany_Required_Inverse2Id], [l0].[OneToMany_Required_Self_Inverse2Id], [l0].[OneToOne_Optional_PK_Inverse2Id], [l0].[OneToOne_Optional_Self2Id], [l1].[Id], [l1].[Level2_Optional_Id], [l1].[Level2_Required_Id], [l1].[Name], [l1].[OneToMany_Optional_Inverse3Id], [l1].[OneToMany_Optional_Self_Inverse3Id], [l1].[OneToMany_Required_Inverse3Id], [l1].[OneToMany_Required_Self_Inverse3Id], [l1].[OneToOne_Optional_PK_Inverse3Id], [l1].[OneToOne_Optional_Self3Id], [l2].[Id], [l2].[Level3_Optional_Id], [l2].[Level3_Required_Id], [l2].[Name], [l2].[OneToMany_Optional_Inverse4Id], [l2].[OneToMany_Optional_Self_Inverse4Id], [l2].[OneToMany_Required_Inverse4Id], [l2].[OneToMany_Required_Self_Inverse4Id], [l2].[OneToOne_Optional_PK_Inverse4Id], [l2].[OneToOne_Optional_Self4Id]
Expand All @@ -1328,7 +1318,6 @@ OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY
LEFT JOIN [LevelThree] AS [l1] ON [l0].[Id] = [l1].[Level2_Required_Id]
LEFT JOIN [LevelFour] AS [l2] ON [l1].[Id] = [l2].[OneToMany_Optional_Inverse4Id]
ORDER BY [t].[Name], [t].[Id], [l2].[Id]");
}
}

public override async Task Multiple_include_with_multiple_optional_navigations(bool async)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ namespace Microsoft.EntityFrameworkCore.Query
{
public class NorthwindIncludeQuerySqlServerTest : NorthwindIncludeQueryTestBase<NorthwindQuerySqlServerFixture<NoopModelCustomizer>>
{
private bool SupportsOffset => TestEnvironment.GetFlag(nameof(SqlServerCondition.SupportsOffset)) ?? true;

// ReSharper disable once UnusedParameter.Local
public NorthwindIncludeQuerySqlServerTest(NorthwindQuerySqlServerFixture<NoopModelCustomizer> fixture, ITestOutputHelper testOutputHelper)
: base(fixture)
Expand Down Expand Up @@ -87,10 +85,8 @@ public override void Include_collection_skip_no_order_by(bool useString)
{
base.Include_collection_skip_no_order_by(useString);

if (SupportsOffset)
{
AssertSql(
@"@__p_0='10'
AssertSql(
@"@__p_0='10'
SELECT [t].[CustomerID], [t].[Address], [t].[City], [t].[CompanyName], [t].[ContactName], [t].[ContactTitle], [t].[Country], [t].[Fax], [t].[Phone], [t].[PostalCode], [t].[Region], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate]
FROM (
Expand All @@ -101,17 +97,14 @@ OFFSET @__p_0 ROWS
) AS [t]
LEFT JOIN [Orders] AS [o] ON [t].[CustomerID] = [o].[CustomerID]
ORDER BY [t].[CustomerID], [o].[OrderID]");
}
}

public override void Include_collection_take_no_order_by(bool useString)
{
base.Include_collection_take_no_order_by(useString);

if (SupportsOffset)
{
AssertSql(
@"@__p_0='10'
AssertSql(
@"@__p_0='10'
SELECT [t].[CustomerID], [t].[Address], [t].[City], [t].[CompanyName], [t].[ContactName], [t].[ContactTitle], [t].[Country], [t].[Fax], [t].[Phone], [t].[PostalCode], [t].[Region], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate]
FROM (
Expand All @@ -120,17 +113,14 @@ FROM [Customers] AS [c]
) AS [t]
LEFT JOIN [Orders] AS [o] ON [t].[CustomerID] = [o].[CustomerID]
ORDER BY [t].[CustomerID], [o].[OrderID]");
}
}

public override void Include_collection_skip_take_no_order_by(bool useString)
{
base.Include_collection_skip_take_no_order_by(useString);

if (SupportsOffset)
{
AssertSql(
@"@__p_0='10'
AssertSql(
@"@__p_0='10'
@__p_1='5'
SELECT [t].[CustomerID], [t].[Address], [t].[City], [t].[CompanyName], [t].[ContactName], [t].[ContactTitle], [t].[Country], [t].[Fax], [t].[Phone], [t].[PostalCode], [t].[Region], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate]
Expand All @@ -142,7 +132,6 @@ OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY
) AS [t]
LEFT JOIN [Orders] AS [o] ON [t].[CustomerID] = [o].[CustomerID]
ORDER BY [t].[CustomerID], [o].[OrderID]");
}
}

public override void Include_reference_and_collection(bool useString)
Expand Down Expand Up @@ -318,10 +307,8 @@ public override void Include_collection_order_by_non_key_with_skip(bool useStrin
{
base.Include_collection_order_by_non_key_with_skip(useString);

if (SupportsOffset)
{
AssertSql(
@"@__p_0='10'
AssertSql(
@"@__p_0='10'
SELECT [t].[CustomerID], [t].[Address], [t].[City], [t].[CompanyName], [t].[ContactName], [t].[ContactTitle], [t].[Country], [t].[Fax], [t].[Phone], [t].[PostalCode], [t].[Region], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate]
FROM (
Expand All @@ -332,7 +319,6 @@ OFFSET @__p_0 ROWS
) AS [t]
LEFT JOIN [Orders] AS [o] ON [t].[CustomerID] = [o].[CustomerID]
ORDER BY [t].[ContactTitle], [t].[CustomerID], [o].[OrderID]");
}
}

public override void Include_collection_order_by_non_key_with_first_or_default(bool useString)
Expand Down Expand Up @@ -541,10 +527,8 @@ public override void Include_duplicate_collection(bool useString)
{
base.Include_duplicate_collection(useString);

if (SupportsOffset)
{
AssertSql(
@"@__p_0='2'
AssertSql(
@"@__p_0='2'
SELECT [t].[CustomerID], [t].[Address], [t].[City], [t].[CompanyName], [t].[ContactName], [t].[ContactTitle], [t].[Country], [t].[Fax], [t].[Phone], [t].[PostalCode], [t].[Region], [t0].[CustomerID], [t0].[Address], [t0].[City], [t0].[CompanyName], [t0].[ContactName], [t0].[ContactTitle], [t0].[Country], [t0].[Fax], [t0].[Phone], [t0].[PostalCode], [t0].[Region], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate]
FROM (
Expand All @@ -561,17 +545,14 @@ OFFSET 2 ROWS FETCH NEXT 2 ROWS ONLY
LEFT JOIN [Orders] AS [o] ON [t].[CustomerID] = [o].[CustomerID]
LEFT JOIN [Orders] AS [o0] ON [t0].[CustomerID] = [o0].[CustomerID]
ORDER BY [t].[CustomerID], [t0].[CustomerID], [o].[OrderID], [o0].[OrderID]");
}
}

public override void Include_duplicate_collection_result_operator(bool useString)
{
base.Include_duplicate_collection_result_operator(useString);

if (SupportsOffset)
{
AssertSql(
@"@__p_1='1'
AssertSql(
@"@__p_1='1'
@__p_0='2'
SELECT [t1].[CustomerID], [t1].[Address], [t1].[City], [t1].[CompanyName], [t1].[ContactName], [t1].[ContactTitle], [t1].[Country], [t1].[Fax], [t1].[Phone], [t1].[PostalCode], [t1].[Region], [t1].[CustomerID0], [t1].[Address0], [t1].[City0], [t1].[CompanyName0], [t1].[ContactName0], [t1].[ContactTitle0], [t1].[Country0], [t1].[Fax0], [t1].[Phone0], [t1].[PostalCode0], [t1].[Region0], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate], [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[OrderDate]
Expand All @@ -593,7 +574,6 @@ ORDER BY [t].[CustomerID]
LEFT JOIN [Orders] AS [o] ON [t1].[CustomerID] = [o].[CustomerID]
LEFT JOIN [Orders] AS [o0] ON [t1].[CustomerID0] = [o0].[CustomerID]
ORDER BY [t1].[CustomerID], [t1].[CustomerID0], [o].[OrderID], [o0].[OrderID]");
}
}

public override void Include_collection_on_join_clause_with_order_by_and_filter(bool useString)
Expand Down Expand Up @@ -630,10 +610,8 @@ public override void Include_where_skip_take_projection(bool useString)
{
base.Include_where_skip_take_projection(useString);

if (SupportsOffset)
{
AssertSql(
@"@__p_0='1'
AssertSql(
@"@__p_0='1'
@__p_1='2'
SELECT [o0].[CustomerID]
Expand All @@ -646,17 +624,14 @@ OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY
) AS [t]
INNER JOIN [Orders] AS [o0] ON [t].[OrderID] = [o0].[OrderID]
ORDER BY [t].[OrderID], [t].[ProductID]");
}
}

public override void Include_duplicate_collection_result_operator2(bool useString)
{
base.Include_duplicate_collection_result_operator2(useString);

if (SupportsOffset)
{
AssertSql(
@"@__p_1='1'
AssertSql(
@"@__p_1='1'
@__p_0='2'
SELECT [t1].[CustomerID], [t1].[Address], [t1].[City], [t1].[CompanyName], [t1].[ContactName], [t1].[ContactTitle], [t1].[Country], [t1].[Fax], [t1].[Phone], [t1].[PostalCode], [t1].[Region], [t1].[CustomerID0], [t1].[Address0], [t1].[City0], [t1].[CompanyName0], [t1].[ContactName0], [t1].[ContactTitle0], [t1].[Country0], [t1].[Fax0], [t1].[Phone0], [t1].[PostalCode0], [t1].[Region0], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate]
Expand All @@ -677,7 +652,6 @@ ORDER BY [t].[CustomerID]
) AS [t1]
LEFT JOIN [Orders] AS [o] ON [t1].[CustomerID] = [o].[CustomerID]
ORDER BY [t1].[CustomerID], [t1].[CustomerID0], [o].[OrderID]");
}
}

public override void Include_multiple_references(bool useString)
Expand Down Expand Up @@ -705,10 +679,8 @@ public override void Include_duplicate_reference(bool useString)
{
base.Include_duplicate_reference(useString);

if (SupportsOffset)
{
AssertSql(
@"@__p_0='2'
AssertSql(
@"@__p_0='2'
SELECT [t].[OrderID], [t].[CustomerID], [t].[EmployeeID], [t].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [t0].[OrderID], [t0].[CustomerID], [t0].[EmployeeID], [t0].[OrderDate], [c0].[CustomerID], [c0].[Address], [c0].[City], [c0].[CompanyName], [c0].[ContactName], [c0].[ContactTitle], [c0].[Country], [c0].[Fax], [c0].[Phone], [c0].[PostalCode], [c0].[Region]
FROM (
Expand All @@ -725,17 +697,14 @@ OFFSET 2 ROWS FETCH NEXT 2 ROWS ONLY
LEFT JOIN [Customers] AS [c] ON [t].[CustomerID] = [c].[CustomerID]
LEFT JOIN [Customers] AS [c0] ON [t0].[CustomerID] = [c0].[CustomerID]
ORDER BY [t].[CustomerID], [t].[OrderID]");
}
}

public override void Include_duplicate_reference2(bool useString)
{
base.Include_duplicate_reference2(useString);

if (SupportsOffset)
{
AssertSql(
@"@__p_0='2'
AssertSql(
@"@__p_0='2'
SELECT [t].[OrderID], [t].[CustomerID], [t].[EmployeeID], [t].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region], [t0].[OrderID], [t0].[CustomerID], [t0].[EmployeeID], [t0].[OrderDate]
FROM (
Expand All @@ -751,17 +720,14 @@ OFFSET 2 ROWS FETCH NEXT 2 ROWS ONLY
) AS [t0]
LEFT JOIN [Customers] AS [c] ON [t].[CustomerID] = [c].[CustomerID]
ORDER BY [t].[OrderID]");
}
}

public override void Include_duplicate_reference3(bool useString)
{
base.Include_duplicate_reference3(useString);

if (SupportsOffset)
{
AssertSql(
@"@__p_0='2'
AssertSql(
@"@__p_0='2'
SELECT [t].[OrderID], [t].[CustomerID], [t].[EmployeeID], [t].[OrderDate], [t0].[OrderID], [t0].[CustomerID], [t0].[EmployeeID], [t0].[OrderDate], [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[Phone], [c].[PostalCode], [c].[Region]
FROM (
Expand All @@ -777,7 +743,6 @@ OFFSET 2 ROWS FETCH NEXT 2 ROWS ONLY
) AS [t0]
LEFT JOIN [Customers] AS [c] ON [t0].[CustomerID] = [c].[CustomerID]
ORDER BY [t].[OrderID]");
}
}

public override void Include_reference_when_projection(bool useString)
Expand Down Expand Up @@ -938,10 +903,8 @@ public override void Include_with_skip(bool useString)
{
base.Include_with_skip(useString);

if (SupportsOffset)
{
AssertSql(
@"@__p_0='80'
AssertSql(
@"@__p_0='80'
SELECT [t].[CustomerID], [t].[Address], [t].[City], [t].[CompanyName], [t].[ContactName], [t].[ContactTitle], [t].[Country], [t].[Fax], [t].[Phone], [t].[PostalCode], [t].[Region], [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate]
FROM (
Expand All @@ -952,7 +915,6 @@ OFFSET @__p_0 ROWS
) AS [t]
LEFT JOIN [Orders] AS [o] ON [t].[CustomerID] = [o].[CustomerID]
ORDER BY [t].[ContactName], [t].[CustomerID], [o].[OrderID]");
}
}

public override void Include_collection_with_multiple_conditional_order_by(bool useString)
Expand Down
Loading

0 comments on commit 0573af8

Please sign in to comment.