mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
ci(core): Reduce memory usage in tests (part-2) (no-changelog) (#7671)
This also gets rid of `Db.collection`, which was another source of circular dependencies.
This commit is contained in:
committed by
GitHub
parent
37dd658dc5
commit
000e76e3b4
@@ -14,18 +14,12 @@ import { rawBodyReader, bodyParser, setupAuthMiddlewares } from '@/middlewares';
|
||||
import { InternalHooks } from '@/InternalHooks';
|
||||
import { PostHogClient } from '@/posthog';
|
||||
import { License } from '@/License';
|
||||
|
||||
import {
|
||||
SettingsRepository,
|
||||
SharedCredentialsRepository,
|
||||
SharedWorkflowRepository,
|
||||
} from '@/databases/repositories';
|
||||
import { Logger } from '@/Logger';
|
||||
|
||||
import { mockInstance } from '../../../shared/mocking';
|
||||
import * as testDb from '../../shared/testDb';
|
||||
import { AUTHLESS_ENDPOINTS, PUBLIC_API_REST_PATH_SEGMENT, REST_PATH_SEGMENT } from '../constants';
|
||||
import type { SetupProps, TestServer } from '../types';
|
||||
import { mockInstance } from './mocking';
|
||||
|
||||
/**
|
||||
* Plugin to prefix a path segment into a request URL pathname.
|
||||
@@ -217,6 +211,7 @@ export const setupTestServer = ({
|
||||
|
||||
case 'owner':
|
||||
const { UserService } = await import('@/services/user.service');
|
||||
const { SettingsRepository } = await import('@db/repositories/settings.repository');
|
||||
const { OwnerController } = await import('@/controllers/owner.controller');
|
||||
registerController(
|
||||
app,
|
||||
@@ -232,6 +227,12 @@ export const setupTestServer = ({
|
||||
break;
|
||||
|
||||
case 'users':
|
||||
const { SharedCredentialsRepository } = await import(
|
||||
'@db/repositories/sharedCredentials.repository'
|
||||
);
|
||||
const { SharedWorkflowRepository } = await import(
|
||||
'@db/repositories/sharedWorkflow.repository'
|
||||
);
|
||||
const { ActiveWorkflowRunner } = await import('@/ActiveWorkflowRunner');
|
||||
const { ExternalHooks } = await import('@/ExternalHooks');
|
||||
const { JwtService } = await import('@/services/jwt.service');
|
||||
|
||||
Reference in New Issue
Block a user