From 364976db38c13d0fb365e38efb4dd8febaf381ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 3 May 2022 10:01:38 +0200 Subject: [PATCH] :test_tube: Fix CI/CD for `/oauth2-credential` tests (#3230) --- package-lock.json | 4 ++-- packages/cli/test/integration/oauth2.api.test.ts | 8 ++++++-- packages/cli/test/integration/shared/constants.ts | 5 +++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 17a986a45f..fc11eecfc9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "n8n", - "version": "0.174.0", + "version": "0.175.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "n8n", - "version": "0.174.0", + "version": "0.175.0", "dependencies": { "@babel/core": "^7.14.6", "@fontsource/open-sans": "^4.5.0", diff --git a/packages/cli/test/integration/oauth2.api.test.ts b/packages/cli/test/integration/oauth2.api.test.ts index 2cf6eb9d01..f66dca3d28 100644 --- a/packages/cli/test/integration/oauth2.api.test.ts +++ b/packages/cli/test/integration/oauth2.api.test.ts @@ -6,6 +6,7 @@ import { RESPONSE_ERROR_MESSAGES } from '../../src/constants'; import type { Role } from '../../src/databases/entities/Role'; import { CredentialTypes, LoadNodesAndCredentials } from '../../src'; +import { LOAD_NODES_AND_CREDS_TEST_TIMEOUT } from './shared/constants'; const SCOPES_ENDPOINT = '/oauth2-credential/scopes'; @@ -14,7 +15,10 @@ let testDbName = ''; let globalOwnerRole: Role; beforeAll(async () => { - app = utils.initTestServer({ endpointGroups: ['oauth2-credential'], applyAuth: true }); + app = utils.initTestServer({ + endpointGroups: ['oauth2-credential'], + applyAuth: true, + }); const initResult = await testDb.init(); testDbName = initResult.testDbName; @@ -28,7 +32,7 @@ beforeAll(async () => { const credentialTypes = CredentialTypes(); await credentialTypes.init(loadNodesAndCredentials.credentialTypes); -}); +}, LOAD_NODES_AND_CREDS_TEST_TIMEOUT); afterAll(async () => { await testDb.terminate(testDbName); diff --git a/packages/cli/test/integration/shared/constants.ts b/packages/cli/test/integration/shared/constants.ts index 75c2a69a38..180a961637 100644 --- a/packages/cli/test/integration/shared/constants.ts +++ b/packages/cli/test/integration/shared/constants.ts @@ -62,3 +62,8 @@ export const BOOTSTRAP_MYSQL_CONNECTION_NAME: Readonly = 'n8n_bs_mysql'; * Timeout (in milliseconds) to account for fake SMTP service being slow to respond. */ export const SMTP_TEST_TIMEOUT = 30_000; + +/** + * Timeout (in milliseconds) to account for `LoadNodesAndCredentials()` being slow to run on CI/CD server. + */ +export const LOAD_NODES_AND_CREDS_TEST_TIMEOUT = 30_000;