Skip to content

Commit

Permalink
Update DatabaseTests.cs
Browse files Browse the repository at this point in the history
Create scratch db on Postgres
  • Loading branch information
jas88 committed Jul 17, 2024
1 parent e53537e commit c2caf6b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tests/IsIdentifiableTests/DatabaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ public void CheckFiles()
var constr = element?.Element("ConnectionString")?.Value;

TestConnectionStrings.Add(databaseType, constr);
// Make sure our scratch db exists for PostgreSQL
if (databaseType == DatabaseType.PostgreSql)
{
var server = GetTestServer(DatabaseType.PostgreSql);
if (server.DiscoverDatabases()
.All(db => db.GetWrappedName()?.Contains(_testScratchDatabase) != true))
server.CreateDatabase(_testScratchDatabase);
}
}
}
catch (Exception exception)
Expand Down

0 comments on commit c2caf6b

Please sign in to comment.