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

Change the E2E class Fixture to allow parallel running #2049

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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,17 +17,18 @@

namespace Microsoft.Test.E2E.AspNet.OData.Aggregation
{
public class AggregationTestsEFClassic: AggregationTests
public class AggregationTestsEFClassic: AggregationTests<AggregationTestsEFClassic>
{
public AggregationTestsEFClassic(WebHostTestFixture fixture)
public AggregationTestsEFClassic(WebHostTestFixture<AggregationTestsEFClassic> fixture)
: base(fixture)
{
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
configuration.AddControllers(typeof(CustomersController));
base.UpdateConfiguration(configuration);

UpdateConfigureOnBase(configuration);
}

[Theory]
Expand All @@ -54,50 +55,50 @@ public async Task CustomAggregateStdDevWorks(string query)
}

#if NETCORE
public class AggregationTestsEFCoreInMemory : AggregationTests
public class AggregationTestsEFCoreInMemory : AggregationTests<AggregationTestsEFCoreInMemory>
{
public AggregationTestsEFCoreInMemory(WebHostTestFixture fixture)
public AggregationTestsEFCoreInMemory(WebHostTestFixture<AggregationTestsEFCoreInMemory> fixture)
: base(fixture)
{
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
configuration.AddControllers(typeof(CoreCustomersController<AggregationContextCoreInMemory>));
base.UpdateConfiguration(configuration);

UpdateConfigureOnBase(configuration);
}
}

public class AggregationTestsEFCoreSql : AggregationTests
public class AggregationTestsEFCoreSql : AggregationTests<AggregationTestsEFCoreSql>
{
public AggregationTestsEFCoreSql(WebHostTestFixture fixture)
public AggregationTestsEFCoreSql(WebHostTestFixture<AggregationTestsEFCoreSql> fixture)
: base(fixture)
{
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
configuration.AddControllers(typeof(CoreCustomersController<AggregationContextCoreSql>));
base.UpdateConfiguration(configuration);

UpdateConfigureOnBase(configuration);
}
}
#endif


#if !NETCORE
public class LinqToSqlAggregationTests : WebHostTestBase
public class LinqToSqlAggregationTests : WebHostTestBase<LinqToSqlAggregationTests>
{
protected string AggregationTestBaseUrl => "{0}/aggregation/Customers";

public LinqToSqlAggregationTests(WebHostTestFixture fixture)
public LinqToSqlAggregationTests(WebHostTestFixture<LinqToSqlAggregationTests> fixture)
: base(fixture)
{
}


protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{

configuration.AddControllers(typeof(LinqToSqlCustomersController));
configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
configuration.Count().Filter().OrderBy().Expand().MaxTop(null);
Expand Down Expand Up @@ -128,16 +129,16 @@ public async Task ApplyThrows()
}
#endif

public abstract class AggregationTests : WebHostTestBase
public abstract class AggregationTests<T> : WebHostTestBase<T>
{
protected string AggregationTestBaseUrl => "{0}/aggregation/Customers";

public AggregationTests(WebHostTestFixture fixture)
public AggregationTests(WebHostTestFixture<T> fixture)
:base(fixture)
{
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigureOnBase(WebRouteConfiguration configuration)
{
configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
configuration.Count().Filter().OrderBy().Expand().MaxTop(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@

namespace Microsoft.Test.E2E.AspNet.OData.Aggregation
{
public class PagedAggregationTests : WebHostTestBase
public class PagedAggregationTests : WebHostTestBase<PagedAggregationTests>
{
private const string AggregationTestBaseUrl = "{0}/pagedaggregation/Customers";

public PagedAggregationTests(WebHostTestFixture fixture)
public PagedAggregationTests(WebHostTestFixture<PagedAggregationTests> fixture)
:base(fixture)
{
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
configuration.AddControllers(typeof (Paged.CustomersController));
configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

namespace Microsoft.Test.E2E.AspNet.OData.AlternateKeys
{
public class AlternateKeysTest : WebHostTestBase
public class AlternateKeysTest : WebHostTestBase<AlternateKeysTest>
{
public AlternateKeysTest(WebHostTestFixture fixture)
public AlternateKeysTest(WebHostTestFixture<AlternateKeysTest> fixture)
:base(fixture)
{
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
var controllers = new[]
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

namespace Microsoft.Test.E2E.AspNet.OData.AutoExpand
{
public class AutoExpandTests : WebHostTestBase
public class AutoExpandTests : WebHostTestBase<AutoExpandTests>
{
private const string AutoExpandTestBaseUrl = "{0}/autoexpand/Customers(5)";

public AutoExpandTests(WebHostTestFixture fixture)
public AutoExpandTests(WebHostTestFixture<AutoExpandTests> fixture)
:base(fixture)
{
}
Expand All @@ -39,18 +39,18 @@ public static TheoryDataSet<string, int> AutoExpandTestData
}
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
configuration.AddControllers(
typeof (CustomersController),
typeof (CustomersController),
typeof (PeopleController),
typeof (NormalOrdersController));
configuration.JsonReferenceLoopHandling =
Newtonsoft.Json.ReferenceLoopHandling.Ignore;
configuration.Count().Filter().OrderBy().Expand().MaxTop(null).Select();
configuration.MapODataServiceRoute(
"autoexpand",
"autoexpand",
"autoexpand",
"autoexpand",
AutoExpandEdmModel.GetEdmModel(configuration));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ public DefaultBatchOrderController()
}
}

public class DefaultBatchHandlerCUDBatchTests : WebHostTestBase
public class DefaultBatchHandlerCUDBatchTests : WebHostTestBase<DefaultBatchHandlerCUDBatchTests>
{
public DefaultBatchHandlerCUDBatchTests(WebHostTestFixture fixture)
public DefaultBatchHandlerCUDBatchTests(WebHostTestFixture<DefaultBatchHandlerCUDBatchTests> fixture)
:base(fixture)
{
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
ODataModelBuilder builder = configuration.CreateConventionModelBuilder();
configuration.Count().Filter().OrderBy().Expand().MaxTop(null);
Expand Down Expand Up @@ -549,14 +549,14 @@ public async Task CanHandleSingleDeleteInBatch()
}
}

public class DefaultBatchHandlerQueryBatchTests : WebHostTestBase
public class DefaultBatchHandlerQueryBatchTests : WebHostTestBase<DefaultBatchHandlerQueryBatchTests>
{
public DefaultBatchHandlerQueryBatchTests(WebHostTestFixture fixture)
public DefaultBatchHandlerQueryBatchTests(WebHostTestFixture<DefaultBatchHandlerQueryBatchTests> fixture)
:base(fixture)
{
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
configuration.MapODataServiceRoute(
"batch",
Expand Down Expand Up @@ -618,14 +618,14 @@ public async Task CanBatchQueriesWithDataServicesClient()
}


public class DefaultBatchHandlerErrorsBatchTests : WebHostTestBase
public class DefaultBatchHandlerErrorsBatchTests : WebHostTestBase<DefaultBatchHandlerErrorsBatchTests>
{
public DefaultBatchHandlerErrorsBatchTests(WebHostTestFixture fixture)
public DefaultBatchHandlerErrorsBatchTests(WebHostTestFixture<DefaultBatchHandlerErrorsBatchTests> fixture)
:base(fixture)
{
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
configuration.MapODataServiceRoute(
"batch",
Expand Down Expand Up @@ -685,14 +685,14 @@ public async Task SendsIndividualErrorWhenOneOfTheRequestsFails()
}


public class DefaultBatchHandlerLinksBatchTests : WebHostTestBase
public class DefaultBatchHandlerLinksBatchTests : WebHostTestBase<DefaultBatchHandlerLinksBatchTests>
{
public DefaultBatchHandlerLinksBatchTests(WebHostTestFixture fixture)
public DefaultBatchHandlerLinksBatchTests(WebHostTestFixture<DefaultBatchHandlerLinksBatchTests> fixture)
:base(fixture)
{
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
configuration.MapODataServiceRoute(
"batch",
Expand Down Expand Up @@ -738,14 +738,14 @@ public async Task CanSetLinksInABatchWithDataServicesClient()
}
}

public class DefaultBatchHandlerContinueOnErrorBatchTests : WebHostTestBase
public class DefaultBatchHandlerContinueOnErrorBatchTests : WebHostTestBase<DefaultBatchHandlerContinueOnErrorBatchTests>
{
public DefaultBatchHandlerContinueOnErrorBatchTests(WebHostTestFixture fixture)
public DefaultBatchHandlerContinueOnErrorBatchTests(WebHostTestFixture<DefaultBatchHandlerContinueOnErrorBatchTests> fixture)
:base(fixture)
{
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
ODataModelBuilder builder = configuration.CreateConventionModelBuilder();
configuration.MapODataServiceRoute(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ public UnbufferedBatchOrderController()
}
}

public class CUDBatchTests : WebHostTestBase
public class CUDBatchTests : WebHostTestBase<CUDBatchTests>
{
public CUDBatchTests(WebHostTestFixture fixture)
: base(fixture)
public CUDBatchTests(WebHostTestFixture<CUDBatchTests> fixture)
:base(fixture)
{
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
ODataModelBuilder builder = configuration.CreateConventionModelBuilder();
configuration.Count().Filter().OrderBy().Expand().MaxTop(null);
Expand Down Expand Up @@ -445,14 +445,14 @@ public async Task CanHandleSingleDeleteInBatch()
}
}

public class QueryBatchTests : WebHostTestBase
public class QueryBatchTests : WebHostTestBase<QueryBatchTests>
{
public QueryBatchTests(WebHostTestFixture fixture)
public QueryBatchTests(WebHostTestFixture<QueryBatchTests> fixture)
:base(fixture)
{
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
ODataModelBuilder builder = configuration.CreateConventionModelBuilder();
configuration.MapODataServiceRoute(
Expand Down Expand Up @@ -509,14 +509,14 @@ public async Task CanBatchQueriesWithDataServicesClient()
}
}

public class ErrorsBatchTests : WebHostTestBase
public class ErrorsBatchTests : WebHostTestBase<ErrorsBatchTests>
{
public ErrorsBatchTests(WebHostTestFixture fixture)
public ErrorsBatchTests(WebHostTestFixture<ErrorsBatchTests> fixture)
:base(fixture)
{
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
ODataModelBuilder builder = configuration.CreateConventionModelBuilder();
configuration.MapODataServiceRoute(
Expand Down Expand Up @@ -570,14 +570,14 @@ public async Task SendsIndividualErrorWhenOneOfTheRequestsFails()
}
}

public class LinksBatchTests : WebHostTestBase
public class LinksBatchTests : WebHostTestBase<LinksBatchTests>
{
public LinksBatchTests(WebHostTestFixture fixture)
public LinksBatchTests(WebHostTestFixture<LinksBatchTests> fixture)
:base(fixture)
{
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
ODataModelBuilder builder = configuration.CreateConventionModelBuilder();
configuration.MapODataServiceRoute(
Expand Down Expand Up @@ -616,14 +616,14 @@ public virtual async Task CanSetLinksInABatchWithDataServicesClient()
}
}

public class ContinueOnErrorBatchTests : WebHostTestBase
public class ContinueOnErrorBatchTests : WebHostTestBase<ContinueOnErrorBatchTests>
{
public ContinueOnErrorBatchTests(WebHostTestFixture fixture)
public ContinueOnErrorBatchTests(WebHostTestFixture<ContinueOnErrorBatchTests> fixture)
:base(fixture)
{
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
ODataModelBuilder builder = configuration.CreateConventionModelBuilder();
configuration.MapODataServiceRoute(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@

namespace Microsoft.Test.E2E.AspNet.OData.BoundOperation
{
public class BoundOperationTest : WebHostTestBase
public class BoundOperationTest : WebHostTestBase<BoundOperationTest>
{
private const string CollectionOfEmployee = "Collection(NS.Employee)";
private const string CollectionOfManager = "Collection(NS.Manager)";
private const string Employee = "NS.Employee";
private const string Manager = "NS.Manager";

public BoundOperationTest(WebHostTestFixture fixture)
public BoundOperationTest(WebHostTestFixture<BoundOperationTest> fixture)
:base(fixture)
{
}
Expand All @@ -43,7 +43,7 @@ private async Task<HttpResponseMessage> ResetDatasource()
return responseForPost;
}

protected override void UpdateConfiguration(WebRouteConfiguration configuration)
protected static void UpdateConfigure(WebRouteConfiguration configuration)
{
var controllers = new[] { typeof(EmployeesController), typeof(MetadataController) };
configuration.AddControllers(controllers);
Expand Down
Loading