refactor(core): Clean up event relays (no-changelog) (#10284)

This commit is contained in:
Iván Ovejero
2024-08-02 16:52:49 +02:00
committed by GitHub
parent 55f2ffe256
commit aa0a470dce
49 changed files with 487 additions and 397 deletions

View File

@@ -21,7 +21,7 @@ import {
TestFailProvider,
} from '../../shared/ExternalSecrets/utils';
import type { SuperAgentTest } from '../shared/types';
import type { EventService } from '@/eventbus/event.service';
import type { EventService } from '@/events/event.service';
let authOwnerAgent: SuperAgentTest;
let authMemberAgent: SuperAgentTest;

View File

@@ -15,7 +15,7 @@ import { type JobQueue, Queue } from '@/Queue';
import { setupTestCommand } from '@test-integration/utils/testCommand';
import { mockInstance } from '../../shared/mocking';
import { AuditEventRelay } from '@/eventbus/audit-event-relay.service';
import { LogStreamingEventRelay } from '@/events/log-streaming-event-relay';
config.set('executions.mode', 'queue');
config.set('binaryDataManager.availableModes', 'filesystem');
@@ -26,7 +26,7 @@ const externalHooks = mockInstance(ExternalHooks);
const externalSecretsManager = mockInstance(ExternalSecretsManager);
const license = mockInstance(License);
const messageEventBus = mockInstance(MessageEventBus);
const auditEventRelay = mockInstance(AuditEventRelay);
const logStreamingEventRelay = mockInstance(LogStreamingEventRelay);
const orchestrationHandlerWorkerService = mockInstance(OrchestrationHandlerWorkerService);
const queue = mockInstance(Queue);
const orchestrationWorkerService = mockInstance(OrchestrationWorkerService);
@@ -45,7 +45,7 @@ test('worker initializes all its components', async () => {
expect(externalHooks.init).toHaveBeenCalledTimes(1);
expect(externalSecretsManager.init).toHaveBeenCalledTimes(1);
expect(messageEventBus.initialize).toHaveBeenCalledTimes(1);
expect(auditEventRelay.init).toHaveBeenCalledTimes(1);
expect(logStreamingEventRelay.init).toHaveBeenCalledTimes(1);
expect(queue.init).toHaveBeenCalledTimes(1);
expect(queue.process).toHaveBeenCalledTimes(1);
expect(orchestrationWorkerService.init).toHaveBeenCalledTimes(1);

View File

@@ -4,7 +4,7 @@ import { mock } from 'jest-mock-extended';
import type { BaseCommand } from '@/commands/BaseCommand';
import * as testDb from '../testDb';
import { TelemetryEventRelay } from '@/telemetry/telemetry-event-relay.service';
import { TelemetryEventRelay } from '@/events/telemetry-event-relay';
import { mockInstance } from '@test/mocking';
export const setupTestCommand = <T extends BaseCommand>(Command: Class<T>) => {

View File

@@ -1,6 +1,6 @@
import { LicenseErrors, LicenseService } from '@/license/license.service';
import type { License } from '@/License';
import type { EventService } from '@/eventbus/event.service';
import type { EventService } from '@/events/event.service';
import type { WorkflowRepository } from '@db/repositories/workflow.repository';
import type { TEntitlement } from '@n8n_io/license-sdk';
import { mock } from 'jest-mock-extended';