mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Simplify worker pubsub message handler (#11086)
This commit is contained in:
@@ -11,8 +11,8 @@ import { ExternalSecretsManager } from '@/external-secrets/external-secrets-mana
|
||||
import { License } from '@/license';
|
||||
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
|
||||
import { Publisher } from '@/scaling/pubsub/publisher.service';
|
||||
import { Subscriber } from '@/scaling/pubsub/subscriber.service';
|
||||
import { ScalingService } from '@/scaling/scaling.service';
|
||||
import { OrchestrationHandlerWorkerService } from '@/services/orchestration/worker/orchestration.handler.worker.service';
|
||||
import { OrchestrationWorkerService } from '@/services/orchestration/worker/orchestration.worker.service';
|
||||
import { setupTestCommand } from '@test-integration/utils/test-command';
|
||||
|
||||
@@ -27,10 +27,10 @@ const externalSecretsManager = mockInstance(ExternalSecretsManager);
|
||||
const license = mockInstance(License, { loadCertStr: async () => '' });
|
||||
const messageEventBus = mockInstance(MessageEventBus);
|
||||
const logStreamingEventRelay = mockInstance(LogStreamingEventRelay);
|
||||
const orchestrationHandlerWorkerService = mockInstance(OrchestrationHandlerWorkerService);
|
||||
const scalingService = mockInstance(ScalingService);
|
||||
const orchestrationWorkerService = mockInstance(OrchestrationWorkerService);
|
||||
mockInstance(Publisher);
|
||||
mockInstance(Subscriber);
|
||||
|
||||
const command = setupTestCommand(Worker);
|
||||
|
||||
@@ -48,6 +48,5 @@ test('worker initializes all its components', async () => {
|
||||
expect(scalingService.setupWorker).toHaveBeenCalledTimes(1);
|
||||
expect(logStreamingEventRelay.init).toHaveBeenCalledTimes(1);
|
||||
expect(orchestrationWorkerService.init).toHaveBeenCalledTimes(1);
|
||||
expect(orchestrationHandlerWorkerService.initWithOptions).toHaveBeenCalledTimes(1);
|
||||
expect(messageEventBus.send).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user