mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(core): Use DI in execution services (no-changelog) (#8358)
This commit is contained in:
@@ -23,14 +23,14 @@ import { setSchedulerAsLoadedNode } from './shared/utils';
|
||||
import * as testDb from './shared/testDb';
|
||||
import { createOwner } from './shared/db/users';
|
||||
import { createWorkflow } from './shared/db/workflows';
|
||||
import { ExecutionsService } from '@/executions/executions.service';
|
||||
import { ExecutionService } from '@/executions/execution.service';
|
||||
import { WorkflowService } from '@/workflows/workflow.service';
|
||||
import { ActiveWorkflowsService } from '@/services/activeWorkflows.service';
|
||||
|
||||
mockInstance(ActiveExecutions);
|
||||
mockInstance(Push);
|
||||
mockInstance(SecretsHelper);
|
||||
mockInstance(ExecutionsService);
|
||||
mockInstance(ExecutionService);
|
||||
mockInstance(WorkflowService);
|
||||
|
||||
const webhookService = mockInstance(WebhookService);
|
||||
|
||||
@@ -6,6 +6,9 @@ import { createWorkflow } from './shared/db/workflows';
|
||||
import * as testDb from './shared/testDb';
|
||||
import { setupTestServer } from './shared/utils';
|
||||
import { mockInstance } from '../shared/mocking';
|
||||
import { EnterpriseExecutionsService } from '@/executions/execution.service.ee';
|
||||
|
||||
mockInstance(EnterpriseExecutionsService);
|
||||
|
||||
mockInstance(Push);
|
||||
let testServer = setupTestServer({ endpointGroups: ['executions'] });
|
||||
|
||||
@@ -18,7 +18,7 @@ import { createWorkflow, createWorkflowWithTrigger } from '../shared/db/workflow
|
||||
import { createTag } from '../shared/db/tags';
|
||||
import { mockInstance } from '../../shared/mocking';
|
||||
import { Push } from '@/push';
|
||||
import { ExecutionsService } from '@/executions/executions.service';
|
||||
import { ExecutionService } from '@/executions/execution.service';
|
||||
|
||||
let workflowOwnerRole: Role;
|
||||
let owner: User;
|
||||
@@ -31,7 +31,7 @@ const testServer = utils.setupTestServer({ endpointGroups: ['publicApi'] });
|
||||
const license = testServer.license;
|
||||
|
||||
mockInstance(Push);
|
||||
mockInstance(ExecutionsService);
|
||||
mockInstance(ExecutionService);
|
||||
|
||||
beforeAll(async () => {
|
||||
const [globalOwnerRole, globalMemberRole, fetchedWorkflowOwnerRole] = await getAllRoles();
|
||||
|
||||
@@ -18,7 +18,7 @@ import { SettingsRepository } from '@db/repositories/settings.repository';
|
||||
import { mockNodeTypesData } from '../../../unit/Helpers';
|
||||
import { MultiMainSetup } from '@/services/orchestration/main/MultiMainSetup.ee';
|
||||
import { mockInstance } from '../../../shared/mocking';
|
||||
import { ExecutionsService } from '@/executions/executions.service';
|
||||
import { ExecutionService } from '@/executions/execution.service';
|
||||
|
||||
export { setupTestServer } from './testServer';
|
||||
|
||||
@@ -32,7 +32,7 @@ export { setupTestServer } from './testServer';
|
||||
export async function initActiveWorkflowRunner() {
|
||||
mockInstance(MultiMainSetup);
|
||||
|
||||
mockInstance(ExecutionsService);
|
||||
mockInstance(ExecutionService);
|
||||
const { ActiveWorkflowRunner } = await import('@/ActiveWorkflowRunner');
|
||||
const workflowRunner = Container.get(ActiveWorkflowRunner);
|
||||
await workflowRunner.init();
|
||||
|
||||
@@ -18,10 +18,10 @@ import * as testDb from './shared/testDb';
|
||||
import type { SuperAgentTest } from 'supertest';
|
||||
import type { Role } from '@db/entities/Role';
|
||||
import type { User } from '@db/entities/User';
|
||||
import { ExecutionsService } from '@/executions/executions.service';
|
||||
import { ExecutionService } from '@/executions/execution.service';
|
||||
import { mockInstance } from '../shared/mocking';
|
||||
|
||||
mockInstance(ExecutionsService);
|
||||
mockInstance(ExecutionService);
|
||||
|
||||
const testServer = utils.setupTestServer({
|
||||
endpointGroups: ['users'],
|
||||
|
||||
Reference in New Issue
Block a user