No longer any need to create databases, but drop them for consistency

This commit is contained in:
Joel Low
2020-10-06 18:18:45 +08:00
parent c990535157
commit 7151da64e0
+4 -5
View File
@@ -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');
}