No longer any need to create databases, but drop them for consistency
This commit is contained in:
@@ -328,8 +328,8 @@ async function testAppServe(pluginName: string, appDir: string) {
|
||||
}
|
||||
}
|
||||
|
||||
/** Creates PG databases (drops if exists before) */
|
||||
async function createDB(database: string) {
|
||||
/** Drops PG databases */
|
||||
async function dropDB(database: string) {
|
||||
const config = {
|
||||
host: process.env.POSTGRES_HOST,
|
||||
port: process.env.POSTGRES_PORT,
|
||||
@@ -342,7 +342,6 @@ async function createDB(database: string) {
|
||||
} catch (_) {
|
||||
/* do nothing*/
|
||||
}
|
||||
return pgtools.createdb(config, database);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -350,7 +349,7 @@ async function createDB(database: string) {
|
||||
*/
|
||||
async function testBackendStart(appDir: string, isPostgres: boolean) {
|
||||
if (isPostgres) {
|
||||
print('Creating DBs');
|
||||
print('Dropping old DBs');
|
||||
await Promise.all(
|
||||
[
|
||||
'catalog',
|
||||
@@ -359,7 +358,7 @@ async function testBackendStart(appDir: string, isPostgres: boolean) {
|
||||
'identity',
|
||||
'proxy',
|
||||
'techdocs',
|
||||
].map(name => createDB(`backstage_plugin_${name}`)),
|
||||
].map(name => dropDB(`backstage_plugin_${name}`)),
|
||||
);
|
||||
print('Created DBs');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user