mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
ci: Fix DB tests (no-changelog) (#10282)
This commit is contained in:
parent
84efbd9b9c
commit
47a68b0220
|
@ -5,45 +5,27 @@ import request, { type Response } from 'supertest';
|
||||||
import { N8N_VERSION } from '@/constants';
|
import { N8N_VERSION } from '@/constants';
|
||||||
import { PrometheusMetricsService } from '@/metrics/prometheus-metrics.service';
|
import { PrometheusMetricsService } from '@/metrics/prometheus-metrics.service';
|
||||||
import { setupTestServer } from './shared/utils';
|
import { setupTestServer } from './shared/utils';
|
||||||
import { mockInstance } from '@test/mocking';
|
|
||||||
import { GlobalConfig } from '@n8n/config';
|
import { GlobalConfig } from '@n8n/config';
|
||||||
|
|
||||||
jest.unmock('@/eventbus/MessageEventBus/MessageEventBus');
|
jest.unmock('@/eventbus/MessageEventBus/MessageEventBus');
|
||||||
|
|
||||||
const toLines = (response: Response) => response.text.trim().split('\n');
|
const toLines = (response: Response) => response.text.trim().split('\n');
|
||||||
|
|
||||||
mockInstance(GlobalConfig, {
|
const globalConfig = Container.get(GlobalConfig);
|
||||||
database: {
|
// @ts-expect-error `metrics` is a readonly property
|
||||||
type: 'sqlite',
|
globalConfig.endpoints.metrics = {
|
||||||
sqlite: {
|
prefix: 'n8n_test_',
|
||||||
database: 'database.sqlite',
|
includeDefaultMetrics: true,
|
||||||
enableWAL: false,
|
includeApiEndpoints: true,
|
||||||
executeVacuumOnStartup: false,
|
includeCacheMetrics: true,
|
||||||
poolSize: 0,
|
includeMessageEventBusMetrics: true,
|
||||||
},
|
includeCredentialTypeLabel: false,
|
||||||
logging: {
|
includeNodeTypeLabel: false,
|
||||||
enabled: false,
|
includeWorkflowIdLabel: false,
|
||||||
maxQueryExecutionTime: 0,
|
includeApiPathLabel: true,
|
||||||
options: 'error',
|
includeApiMethodLabel: true,
|
||||||
},
|
includeApiStatusCodeLabel: true,
|
||||||
tablePrefix: '',
|
};
|
||||||
},
|
|
||||||
endpoints: {
|
|
||||||
metrics: {
|
|
||||||
prefix: 'n8n_test_',
|
|
||||||
includeDefaultMetrics: true,
|
|
||||||
includeApiEndpoints: true,
|
|
||||||
includeCacheMetrics: true,
|
|
||||||
includeMessageEventBusMetrics: true,
|
|
||||||
includeCredentialTypeLabel: false,
|
|
||||||
includeNodeTypeLabel: false,
|
|
||||||
includeWorkflowIdLabel: false,
|
|
||||||
includeApiPathLabel: true,
|
|
||||||
includeApiMethodLabel: true,
|
|
||||||
includeApiStatusCodeLabel: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const server = setupTestServer({ endpointGroups: ['metrics'] });
|
const server = setupTestServer({ endpointGroups: ['metrics'] });
|
||||||
const agent = request.agent(server.app);
|
const agent = request.agent(server.app);
|
||||||
|
|
Loading…
Reference in a new issue