Test Postgres database definition
This commit is contained in:
@@ -56,11 +56,7 @@ internal sealed class UiTestHarness : IAsyncDisposable
|
||||
CreateNoWindow = true
|
||||
};
|
||||
startInfo.Environment["ASPNETCORE_ENVIRONMENT"] = "UITest";
|
||||
#if POSTGRES
|
||||
startInfo.Environment["ConnectionStrings__EventsPostgres"] = ResolveUiTestConnectionString();
|
||||
#else
|
||||
startInfo.Environment["ConnectionStrings__EventsMssql"] = ResolveUiTestConnectionString();
|
||||
#endif
|
||||
|
||||
var appProcess = Process.Start(startInfo)
|
||||
?? throw new InvalidOperationException("Failed to start the MVC app process for UI tests.");
|
||||
@@ -171,11 +167,11 @@ internal sealed class UiTestHarness : IAsyncDisposable
|
||||
.AddUserSecrets<Program>(optional: true)
|
||||
.Build();
|
||||
|
||||
var connectionString = configuration.GetConnectionString("EventDB-Test");
|
||||
var connectionString = configuration.GetConnectionString("EventsPostgres-Test");
|
||||
if (string.IsNullOrWhiteSpace(connectionString))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"The EventDB-Test connection string must be available so UI tests can connect to the selected provider's test database.");
|
||||
"The EventsPostgres-Test connection string must be available so UI tests can connect to the PostgreSQL test database on port 5433.");
|
||||
}
|
||||
|
||||
return connectionString;
|
||||
|
||||
Reference in New Issue
Block a user