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

Uncomment test output helpers everywhere #31017

Merged
merged 1 commit into from
Jun 15, 2023
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 @@ -17,7 +17,7 @@ public class EmbeddedDocumentsTest : IClassFixture<EmbeddedDocumentsTest.CosmosF
public EmbeddedDocumentsTest(CosmosFixture fixture, ITestOutputHelper testOutputHelper)
{
Fixture = fixture;
//TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact(Skip = "Issue #17670")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public FromSqlQueryCosmosTest(
: base(fixture)
{
ClearLog();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

protected NorthwindContext CreateContext()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public NorthwindAggregateOperatorsQueryCosmosTest(
: base(fixture)
{
ClearLog();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public NorthwindFunctionsQueryCosmosTest(
: base(fixture)
{
ClearLog();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public NorthwindKeylessEntitiesQueryCosmosTest(
: base(fixture)
{
ClearLog();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public NorthwindMiscellaneousQueryCosmosTest(
: base(fixture)
{
ClearLog();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public NorthwindSelectQueryCosmosTest(
: base(fixture)
{
ClearLog();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public NorthwindWhereQueryCosmosTest(
: base(fixture)
{
ClearLog();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public abstract class EntitySplittingTestBase : NonSharedModelTestBase
{
protected EntitySplittingTestBase(ITestOutputHelper testOutputHelper)
{
//TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
// TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ namespace Microsoft.EntityFrameworkCore.Query;

public abstract class JsonQueryAdHocTestBase : NonSharedModelTestBase
{
protected JsonQueryAdHocTestBase(ITestOutputHelper testOutputHelper)
{
//TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

protected override string StoreName
=> "JsonQueryAdHocTest";

Expand Down Expand Up @@ -415,4 +410,7 @@ public class MyJsonEntityArrayOfPrimitives
}

#endregion

protected TestSqlLoggerFactory TestSqlLoggerFactory
=> (TestSqlLoggerFactory)ListLoggerFactory;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ private static readonly MethodInfo StringConcatMethodInfo

protected ExpectedQueryRewritingVisitor ExpectedQueryRewriter { get; init; }

protected OperatorsProceduralQueryTestBase(ITestOutputHelper testOutputHelper)
protected OperatorsProceduralQueryTestBase()
{
//TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Binaries = new()
{
((typeof(string), typeof(string)), typeof(bool), Expression.Equal),
Expand Down Expand Up @@ -297,7 +296,7 @@ private Expression MainLoop(
var possibleBinariesForResultType = possibleBinaries.Where(x => x.ResultType == currentResultType).ToList();
var possibleUnariesForResultType = possibleUnaries.Where(x => x.ResultType == currentResultType).ToList();

// if we can't go any deeper (no matching operations) then simply return source
// if we can't go any deeper (no matching operations) then simply return source
if (possibleBinariesForResultType.Count == 0 && possibleUnariesForResultType.Count == 0)
{
return AddRootPropertyAccess(random, currentResultType, rootPropertyExpressions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ public abstract class OperatorsQueryTestBase : NonSharedModelTestBase
{
protected OperatorsData ExpectedData { get; init; }

protected OperatorsQueryTestBase(ITestOutputHelper testOutputHelper)
protected OperatorsQueryTestBase()
{
//TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
ExpectedData = OperatorsData.Instance;
}

Expand Down Expand Up @@ -301,4 +300,7 @@ class Owned
{
public string SomeProperty { get; set; } = "";
}

protected TestSqlLoggerFactory TestSqlLoggerFactory
=> (TestSqlLoggerFactory)ListLoggerFactory;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public abstract class TableSplittingTestBase : NonSharedModelTestBase
{
protected TableSplittingTestBase(ITestOutputHelper testOutputHelper)
{
//TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
// TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public BuiltInDataTypesSqlServerTest(BuiltInDataTypesSqlServerFixture fixture, I
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public InheritanceBulkUpdatesSqlServerTest(
: base(fixture)
{
ClearLog();
// Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public NorthwindBulkUpdatesSqlServerTest(
: base(fixture)
{
ClearLog();
// Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public TPCInheritanceBulkUpdatesSqlServerTest(
: base(fixture)
{
ClearLog();
// Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ namespace Microsoft.EntityFrameworkCore;

public class DataAnnotationSqlServerTest : DataAnnotationRelationalTestBase<DataAnnotationSqlServerTest.DataAnnotationSqlServerFixture>
{
// ReSharper disable once UnusedParameter.Local
public DataAnnotationSqlServerTest(DataAnnotationSqlServerFixture fixture, ITestOutputHelper testOutputHelper)
: base(fixture)
{
fixture.TestSqlLoggerFactory.Clear();
//fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

protected override void UseTransaction(DatabaseFacade facade, IDbContextTransaction transaction)
Expand Down
5 changes: 2 additions & 3 deletions test/EFCore.SqlServer.FunctionalTests/DbContextPoolingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2177,11 +2177,10 @@ private async Task Dispose(IDisposable disposable, bool async)
}
}

private readonly ITestOutputHelper _testOutputHelper = null;
private readonly ITestOutputHelper _testOutputHelper;

// ReSharper disable once UnusedParameter.Local
public DbContextPoolingTest(NorthwindQuerySqlServerFixture<NoopModelCustomizer> fixture, ITestOutputHelper testOutputHelper)
{
//_testOutputHelper = testOutputHelper;
_testOutputHelper = testOutputHelper;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public MigrationsSqlServerTest(MigrationsSqlServerFixture fixture, ITestOutputHe
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

public override async Task Create_table()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public ComplexNavigationsCollectionsQuerySqlServerTest(
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public ComplexNavigationsCollectionsSharedTypeQuerySqlServerTest(
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public ComplexNavigationsCollectionsSplitQuerySqlServerTest(
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public ComplexNavigationsCollectionsSplitSharedTypeQuerySqlServerTest(
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public ComplexNavigationsQuerySqlServerTest(
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

protected override bool CanExecuteQueryString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public ComplexNavigationsSharedTypeQuerySqlServerTest(
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public CompositeKeysQuerySqlServerTest(
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

protected override bool CanExecuteQueryString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public CompositeKeysSplitQuerySqlServerTest(
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

protected override bool CanExecuteQueryString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public Ef6GroupBySqlServerTest(Ef6GroupBySqlServerFixture fixture, ITestOutputHe
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public FiltersInheritanceQuerySqlServerTest(FiltersInheritanceQuerySqlServerFixt
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class FromSqlQuerySqlServerTest : FromSqlQueryTestBase<NorthwindQuerySqlS
public FromSqlQuerySqlServerTest(NorthwindQuerySqlServerFixture<NoopModelCustomizer> fixture, ITestOutputHelper testOutputHelper)
: base(fixture)
{
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

public override async Task FromSqlRaw_queryable_simple(bool async)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public FunkyDataQuerySqlServerTest(FunkyDataQuerySqlServerFixture fixture, ITest
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

protected virtual bool CanExecuteQueryString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ namespace Microsoft.EntityFrameworkCore.Query;

public class GearsOfWarQuerySqlServerTest : GearsOfWarQueryRelationalTestBase<GearsOfWarQuerySqlServerFixture>
{
#pragma warning disable IDE0060 // Remove unused parameter
public GearsOfWarQuerySqlServerTest(GearsOfWarQuerySqlServerFixture fixture, ITestOutputHelper testOutputHelper)
#pragma warning restore IDE0060 // Remove unused parameter
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

protected override bool CanExecuteQueryString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ namespace Microsoft.EntityFrameworkCore.Query;
public class IncompleteMappingInheritanceQuerySqlServerTest : InheritanceRelationalQueryTestBase<
IncompleteMappingInheritanceQuerySqlServerFixture>
{
#pragma warning disable IDE0060 // Remove unused parameter
public IncompleteMappingInheritanceQuerySqlServerTest(
IncompleteMappingInheritanceQuerySqlServerFixture fixture,
ITestOutputHelper testOutputHelper)
#pragma warning restore IDE0060 // Remove unused parameter
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ namespace Microsoft.EntityFrameworkCore.Query;

public class InheritanceQuerySqlServerTest : InheritanceRelationalQueryTestBase<InheritanceQuerySqlServerFixture>
{
#pragma warning disable IDE0060 // Remove unused parameter
public InheritanceQuerySqlServerTest(InheritanceQuerySqlServerFixture fixture, ITestOutputHelper testOutputHelper)
#pragma warning restore IDE0060 // Remove unused parameter
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
//Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ namespace Microsoft.EntityFrameworkCore.Query;

public class JsonQueryAdHocSqlServerTest : JsonQueryAdHocTestBase
{
public JsonQueryAdHocSqlServerTest(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}

protected override ITestStoreFactory TestStoreFactory
=> SqlServerTestStoreFactory.Instance;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public JsonQuerySqlServerTest(JsonQuerySqlServerFixture fixture, ITestOutputHelp
: base(fixture)
{
Fixture.TestSqlLoggerFactory.Clear();
// Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper);
}

public override async Task Basic_json_projection_owner_entity(bool async)
Expand Down
Loading