mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat: Enable Task Runners on Scaling mode Workers (no-changelog) (#11253)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
process.argv[2] = 'worker';
|
||||
|
||||
import { TaskRunnersConfig } from '@n8n/config';
|
||||
import { BinaryDataService } from 'n8n-core';
|
||||
import Container from 'typedi';
|
||||
|
||||
import { Worker } from '@/commands/worker';
|
||||
import config from '@/config';
|
||||
@@ -11,6 +13,8 @@ import { ExternalSecretsManager } from '@/external-secrets/external-secrets-mana
|
||||
import { License } from '@/license';
|
||||
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
|
||||
import { Push } from '@/push';
|
||||
import { TaskRunnerProcess } from '@/runners/task-runner-process';
|
||||
import { TaskRunnerServer } from '@/runners/task-runner-server';
|
||||
import { Publisher } from '@/scaling/pubsub/publisher.service';
|
||||
import { Subscriber } from '@/scaling/pubsub/subscriber.service';
|
||||
import { ScalingService } from '@/scaling/scaling.service';
|
||||
@@ -22,6 +26,7 @@ import { mockInstance } from '../../shared/mocking';
|
||||
|
||||
config.set('executions.mode', 'queue');
|
||||
config.set('binaryDataManager.availableModes', 'filesystem');
|
||||
Container.get(TaskRunnersConfig).disabled = false;
|
||||
mockInstance(LoadNodesAndCredentials);
|
||||
const binaryDataService = mockInstance(BinaryDataService);
|
||||
const externalHooks = mockInstance(ExternalHooks);
|
||||
@@ -31,6 +36,8 @@ const messageEventBus = mockInstance(MessageEventBus);
|
||||
const logStreamingEventRelay = mockInstance(LogStreamingEventRelay);
|
||||
const scalingService = mockInstance(ScalingService);
|
||||
const orchestrationWorkerService = mockInstance(OrchestrationWorkerService);
|
||||
const taskRunnerServer = mockInstance(TaskRunnerServer);
|
||||
const taskRunnerProcess = mockInstance(TaskRunnerProcess);
|
||||
mockInstance(Publisher);
|
||||
mockInstance(Subscriber);
|
||||
mockInstance(Telemetry);
|
||||
@@ -55,6 +62,8 @@ test('worker initializes all its components', async () => {
|
||||
expect(logStreamingEventRelay.init).toHaveBeenCalledTimes(1);
|
||||
expect(orchestrationWorkerService.init).toHaveBeenCalledTimes(1);
|
||||
expect(messageEventBus.send).toHaveBeenCalledTimes(1);
|
||||
expect(taskRunnerServer.start).toHaveBeenCalledTimes(1);
|
||||
expect(taskRunnerProcess.start).toHaveBeenCalledTimes(1);
|
||||
|
||||
expect(config.getEnv('executions.mode')).toBe('queue');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user