🧪 Fix CI/CD for /oauth2-credential tests (#3230)

This commit is contained in:
Iván Ovejero 2022-05-03 10:01:38 +02:00 committed by GitHub
parent 7faac85002
commit 364976db38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

4
package-lock.json generated
View file

@ -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",

View file

@ -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);

View file

@ -62,3 +62,8 @@ export const BOOTSTRAP_MYSQL_CONNECTION_NAME: Readonly<string> = '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;