From d9b2c6d1cb1033973094d8798d27750304b8c559 Mon Sep 17 00:00:00 2001 From: ivaosthu Date: Wed, 2 Oct 2019 22:48:12 +0200 Subject: [PATCH] chore: do not destroy db on startup --- test/e2e/helpers/database-init.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/e2e/helpers/database-init.js b/test/e2e/helpers/database-init.js index 85556fb58d..727ef62a82 100644 --- a/test/e2e/helpers/database-init.js +++ b/test/e2e/helpers/database-init.js @@ -7,9 +7,14 @@ const { createDb } = require('../../../lib/db/db-pool'); const dbState = require('./database.json'); +// require('db-migrate-shared').log.silence(false); + // because of migrator bug delete process.env.DATABASE_URL; +// because of db-migrate bug (https://github.com/Unleash/unleash/issues/171) +process.setMaxListeners(0); + async function resetDatabase(stores) { return Promise.all([ stores.db('strategies').del(), @@ -59,7 +64,6 @@ module.exports = async function init(databaseSchema = 'test', getLogger) { await db.raw(`CREATE SCHEMA IF NOT EXISTS ${options.databaseSchema}`); await migrator(options); - await db.destroy(); const stores = await createStores(options, eventBus); await resetDatabase(stores); await setupDatabase(stores);