Skip to content

Commit

Permalink
Compliance tests now fail on non-public test classes
Browse files Browse the repository at this point in the history
  • Loading branch information
roji committed Apr 12, 2019
1 parent 56e1b6d commit b333c16
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ public class InMemoryComplianceTest : ComplianceTestBase
{
typeof(FunkyDataQueryTestBase<>),
typeof(OptimisticConcurrencyTestBase<>),
typeof(StoreGeneratedTestBase<>)
typeof(StoreGeneratedTestBase<>),
typeof(LoadTestBase<>), // issue #15318
typeof(GraphUpdatesTestBase<>), // issue #15318
typeof(ProxyGraphUpdatesTestBase<>), // issue #15318
typeof(ComplexNavigationsWeakQueryTestBase<>), // issue #15285
typeof(FiltersInheritanceTestBase<>), // issue #15264
typeof(FiltersTestBase<>), // issue #15264
typeof(OwnedQueryTestBase<>) // issue #15285
};

protected override Assembly TargetAssembly { get; } = typeof(InMemoryComplianceTest).Assembly;
Expand Down
3 changes: 2 additions & 1 deletion test/EFCore.Specification.Tests/ComplianceTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ protected virtual IEnumerable<Type> GetBaseTestClasses()
=> typeof(ComplianceTestBase).Assembly.ExportedTypes.Where(t => t.Name.Contains("TestBase"));

private static bool Implements(Type type, Type interfaceOrBaseType)
=> interfaceOrBaseType.IsGenericTypeDefinition
=> (type.IsPublic || type.IsNestedPublic) &&
interfaceOrBaseType.IsGenericTypeDefinition
? GetGenericTypeImplementations(type, interfaceOrBaseType).Any()
: interfaceOrBaseType.IsAssignableFrom(type);

Expand Down
16 changes: 16 additions & 0 deletions test/EFCore.SqlServer.FunctionalTests/SqlServerComplianceTest.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.EntityFrameworkCore.Query;

namespace Microsoft.EntityFrameworkCore
{
public class SqlServerComplianceTest : RelationalComplianceTestBase
{
protected override ICollection<Type> IgnoredTestBases { get; } = new HashSet<Type>
{
typeof(LoadTestBase<>), // issue #15318
typeof(GraphUpdatesTestBase<>), // issue #15318
typeof(ProxyGraphUpdatesTestBase<>), // issue #15318
typeof(ComplexNavigationsWeakQueryTestBase<>), // issue #15285
typeof(FiltersInheritanceTestBase<>), // issue #15264
typeof(FiltersTestBase<>), // issue #15264
typeof(OwnedQueryTestBase<>), // issue #15285
typeof(QueryFilterFuncletizationTestBase<>), // issue #15264
typeof(RelationalOwnedQueryTestBase<>) // issue #15285
};

protected override Assembly TargetAssembly { get; } = typeof(SqlServerComplianceTest).Assembly;
}
}
11 changes: 10 additions & 1 deletion test/EFCore.Sqlite.FunctionalTests/SqliteComplianceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ public class SqliteComplianceTest : RelationalComplianceTestBase
typeof(AsyncFromSqlSprocQueryTestBase<>),
typeof(FromSqlSprocQueryTestBase<>),
typeof(SqlExecutorTestBase<>),
typeof(UdfDbFunctionTestBase<>)
typeof(UdfDbFunctionTestBase<>),
typeof(LoadTestBase<>), // issue #15318
typeof(GraphUpdatesTestBase<>), // issue #15318
typeof(ProxyGraphUpdatesTestBase<>), // issue #15318
typeof(ComplexNavigationsWeakQueryTestBase<>), // issue #15285
typeof(FiltersInheritanceTestBase<>), // issue #15264
typeof(FiltersTestBase<>), // issue #15264
typeof(OwnedQueryTestBase<>), // issue #15285
typeof(QueryFilterFuncletizationTestBase<>), // issue #15264
typeof(RelationalOwnedQueryTestBase<>) // issue #15285
};

protected override Assembly TargetAssembly { get; } = typeof(SqliteComplianceTest).Assembly;
Expand Down

0 comments on commit b333c16

Please sign in to comment.