ci(core): Reduce memory usage in tests (part-1) (no-changelog) (#7654)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-11-08 16:29:39 +01:00
committed by GitHub
parent 6a53c2a375
commit 0346b211a7
58 changed files with 1223 additions and 1189 deletions

View File

@@ -12,6 +12,8 @@ import type { WorkflowEntity } from '@db/entities/WorkflowEntity';
import { mockInstance, initActiveWorkflowRunner } from './shared/utils';
import * as testDb from './shared/testDb';
import { createUser } from './shared/db/users';
import { createWorkflow } from './shared/db/workflows';
describe('Webhook API', () => {
mockInstance(ExternalHooks);
@@ -31,8 +33,8 @@ describe('Webhook API', () => {
describe('Content-Type support', () => {
beforeAll(async () => {
const node = new WebhookTestingNode();
const user = await testDb.createUser();
await testDb.createWorkflow(createWebhookWorkflow(node), user);
const user = await createUser();
await createWorkflow(createWebhookWorkflow(node), user);
const nodeTypes = mockInstance(NodeTypes);
nodeTypes.getByName.mockReturnValue(node);
@@ -134,8 +136,8 @@ describe('Webhook API', () => {
describe('Params support', () => {
beforeAll(async () => {
const node = new WebhookTestingNode();
const user = await testDb.createUser();
await testDb.createWorkflow(createWebhookWorkflow(node, ':variable', 'PATCH'), user);
const user = await createUser();
await createWorkflow(createWebhookWorkflow(node, ':variable', 'PATCH'), user);
const nodeTypes = mockInstance(NodeTypes);
nodeTypes.getByName.mockReturnValue(node);