mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix: Ensure diagnostics stay disabled in e2e even when enabled by environment variable (#15322)
This commit is contained in:
@@ -10,18 +10,19 @@ import assert from 'node:assert';
|
|||||||
|
|
||||||
import { inTest, inE2ETests } from '@/constants';
|
import { inTest, inE2ETests } from '@/constants';
|
||||||
|
|
||||||
|
const globalConfig = Container.get(GlobalConfig);
|
||||||
|
|
||||||
if (inE2ETests) {
|
if (inE2ETests) {
|
||||||
// Skip loading config from env variables in end-to-end tests
|
globalConfig.diagnostics.enabled = false;
|
||||||
process.env.N8N_DIAGNOSTICS_ENABLED = 'false';
|
globalConfig.publicApi.disabled = true;
|
||||||
process.env.N8N_PUBLIC_API_DISABLED = 'true';
|
|
||||||
process.env.EXTERNAL_FRONTEND_HOOKS_URLS = '';
|
process.env.EXTERNAL_FRONTEND_HOOKS_URLS = '';
|
||||||
process.env.N8N_PERSONALIZATION_ENABLED = 'false';
|
process.env.N8N_PERSONALIZATION_ENABLED = 'false';
|
||||||
process.env.N8N_AI_ENABLED = 'true';
|
process.env.N8N_AI_ENABLED = 'true';
|
||||||
} else if (inTest) {
|
} else if (inTest) {
|
||||||
process.env.N8N_LOG_LEVEL = 'silent';
|
globalConfig.logging.level = 'silent';
|
||||||
process.env.N8N_PUBLIC_API_DISABLED = 'true';
|
globalConfig.publicApi.disabled = true;
|
||||||
process.env.SKIP_STATISTICS_EVENTS = 'true';
|
process.env.SKIP_STATISTICS_EVENTS = 'true';
|
||||||
process.env.N8N_SECURE_COOKIE = 'false';
|
globalConfig.auth.cookie.secure = false;
|
||||||
process.env.N8N_SKIP_AUTH_ON_OAUTH_CALLBACK = 'true';
|
process.env.N8N_SKIP_AUTH_ON_OAUTH_CALLBACK = 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,7 +34,6 @@ const config = convict(schema, { args: [] });
|
|||||||
config.getEnv = config.get;
|
config.getEnv = config.get;
|
||||||
|
|
||||||
const logger = Container.get(Logger);
|
const logger = Container.get(Logger);
|
||||||
const globalConfig = Container.get(GlobalConfig);
|
|
||||||
|
|
||||||
// Load overwrites when not in tests
|
// Load overwrites when not in tests
|
||||||
if (!inE2ETests && !inTest) {
|
if (!inE2ETests && !inTest) {
|
||||||
|
|||||||
Reference in New Issue
Block a user