Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI/CD for /oauth2-credential tests #3230

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions packages/cli/test/integration/oauth2.api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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;

Expand All @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions packages/cli/test/integration/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;