Skip to content

Commit d9eca37

Browse files
committed
Changed the schema if the tests are not running on CI.
1 parent c06e2e0 commit d9eca37

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/Thinktecture.EntityFrameworkCore.SqlServer.Tests/IntegrationTestsBase.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ protected IntegrationTestsBase(ITestOutputHelper testOutputHelper, bool useShare
3030

3131
protected override void ConfigureTestDbContextProvider(SqlServerTestDbContextProviderBuilder<TestDbContext> builder)
3232
{
33+
var gitBranchName = TestContext.Instance.Configuration["SourceBranchName"];
34+
var schema = String.IsNullOrWhiteSpace(gitBranchName) ? "tests" : $"{TestContext.Instance.Configuration["SourceBranchName"]}_tests";
35+
3336
builder.UseMigrationExecutionStrategy(IMigrationExecutionStrategy.Migrations)
3437
.UseMigrationLogLevel(LogLevel.Warning)
3538
.CollectExecutedCommands()
@@ -49,7 +52,7 @@ protected override void ConfigureTestDbContextProvider(SqlServerTestDbContextPro
4952
if (IsTenantDatabaseSupportEnabled)
5053
optionsBuilder.AddTenantDatabaseSupport<TestTenantDatabaseProviderFactory>();
5154
})
52-
.UseSharedTableSchema($"{TestContext.Instance.Configuration["SourceBranchName"]}_tests")
55+
.UseSharedTableSchema(schema)
5356
.InitializeContext(ctx => ctx.ConfigureModel = ConfigureModel)
5457
.DisableModelCache();
5558
}

0 commit comments

Comments
 (0)