From 809776acd73de48e08a109de187ab281bd5d0c6f Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 8 Oct 2024 00:43:57 +0200 Subject: [PATCH] events-backend: skip tests if postgres tests are skipped Signed-off-by: Patrik Oldsberg --- plugins/events-backend/src/migrations.test.ts | 11 +++++++---- .../src/service/hub/DatabaseEventBusStore.test.ts | 5 ++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/plugins/events-backend/src/migrations.test.ts b/plugins/events-backend/src/migrations.test.ts index 1c90260ed3..3aefeda864 100644 --- a/plugins/events-backend/src/migrations.test.ts +++ b/plugins/events-backend/src/migrations.test.ts @@ -41,11 +41,14 @@ async function migrateUntilBefore(knex: Knex, target: string): Promise { jest.setTimeout(60_000); -describe('migrations', () => { - const databases = TestDatabases.create({ - ids: ['POSTGRES_9', 'POSTGRES_13', 'POSTGRES_16'], - }); +const databases = TestDatabases.create({ + ids: ['POSTGRES_9', 'POSTGRES_13', 'POSTGRES_16'], +}); +const maybeDescribe = + databases.eachSupportedId().length > 0 ? describe : describe.skip; + +maybeDescribe('migrations', () => { it.each(databases.eachSupportedId())( '20240523100528_init.js, %p', async databaseId => { diff --git a/plugins/events-backend/src/service/hub/DatabaseEventBusStore.test.ts b/plugins/events-backend/src/service/hub/DatabaseEventBusStore.test.ts index 7086d90cbf..ade462a920 100644 --- a/plugins/events-backend/src/service/hub/DatabaseEventBusStore.test.ts +++ b/plugins/events-backend/src/service/hub/DatabaseEventBusStore.test.ts @@ -27,7 +27,10 @@ const databases = TestDatabases.create({ ids: ['POSTGRES_9', 'POSTGRES_13', 'POSTGRES_16'], }); -describe('DatabaseEventBusStore', () => { +const maybeDescribe = + databases.eachSupportedId().length > 0 ? describe : describe.skip; + +maybeDescribe('DatabaseEventBusStore', () => { it.each(databases.eachSupportedId())( 'should clean up old events, %p', async databaseId => {