From ed00cf78ffeff11d436e6ceef8029b5d47ecd32b Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Thu, 28 Mar 2024 16:43:53 +0800 Subject: [PATCH] CLD-7353 E2E: Disable sending diagnostics and security alert on test servers (#26510) * test: disable sending diagnostics and security alert on test servers * log notable server config --- e2e-tests/.ci/server.generate.sh | 2 ++ .../tests/support/api/cloud_default_config.json | 2 +- .../support/api/on_prem_default_config.json | 4 ++-- e2e-tests/cypress/tests/support/index.js | 5 +++++ e2e-tests/playwright/global_setup.ts | 6 ++++++ .../playwright/support/server/default_config.ts | 16 +++++++++++----- 6 files changed, 27 insertions(+), 8 deletions(-) diff --git a/e2e-tests/.ci/server.generate.sh b/e2e-tests/.ci/server.generate.sh index e61fc9987a8..417372f3d41 100755 --- a/e2e-tests/.ci/server.generate.sh +++ b/e2e-tests/.ci/server.generate.sh @@ -55,6 +55,7 @@ services: environment: MM_SERVICESETTINGS_ALLOWCORSFROM: "*" MM_SERVICESETTINGS_ENABLELOCALMODE: "true" + MM_SERVICESETTINGS_ENABLESECURITYFIXALERT: "false" MM_PLUGINSETTINGS_ENABLED: "true" MM_PLUGINSETTINGS_ENABLEUPLOADS: "true" MM_PLUGINSETTINGS_AUTOMATICPREPACKAGEDPLUGINS: "true" @@ -67,6 +68,7 @@ services: MM_FEATUREFLAGS_ONBOARDINGTOURTIPS: "false" MM_SERVICEENVIRONMENT: "test" MM_FEATUREFLAGS_MOVETHREADSENABLED: "true" + MM_LOGSETTINGS_ENABLEDIAGNOSTICS: "false" network_mode: host depends_on: $(for service in $ENABLED_DOCKER_SERVICES; do diff --git a/e2e-tests/cypress/tests/support/api/cloud_default_config.json b/e2e-tests/cypress/tests/support/api/cloud_default_config.json index 6b6287031cd..ad4fc60edf2 100644 --- a/e2e-tests/cypress/tests/support/api/cloud_default_config.json +++ b/e2e-tests/cypress/tests/support/api/cloud_default_config.json @@ -35,7 +35,7 @@ "DeveloperFlags": "", "EnableClientPerformanceDebugging": false, "EnableOpenTracing": false, - "EnableSecurityFixAlert": true, + "EnableSecurityFixAlert": false, "EnableInsecureOutgoingConnections": false, "AllowedUntrustedInternalConnections": "localhost", "EnableMultifactorAuthentication": false, diff --git a/e2e-tests/cypress/tests/support/api/on_prem_default_config.json b/e2e-tests/cypress/tests/support/api/on_prem_default_config.json index f8a7964ca3f..97581d850fe 100644 --- a/e2e-tests/cypress/tests/support/api/on_prem_default_config.json +++ b/e2e-tests/cypress/tests/support/api/on_prem_default_config.json @@ -36,7 +36,7 @@ "DeveloperFlags": "", "EnableClientPerformanceDebugging": false, "EnableOpenTracing": false, - "EnableSecurityFixAlert": true, + "EnableSecurityFixAlert": false, "EnableInsecureOutgoingConnections": false, "AllowedUntrustedInternalConnections": "localhost", "EnableMultifactorAuthentication": false, @@ -170,7 +170,7 @@ "FileJson": true, "FileLocation": "", "EnableWebhookDebugging": true, - "EnableDiagnostics": true, + "EnableDiagnostics": false, "VerboseDiagnostics": false, "EnableSentry": false, "AdvancedLoggingJSON": {}, diff --git a/e2e-tests/cypress/tests/support/index.js b/e2e-tests/cypress/tests/support/index.js index 3e0d8b27ada..bfce25277f1 100644 --- a/e2e-tests/cypress/tests/support/index.js +++ b/e2e-tests/cypress/tests/support/index.js @@ -180,6 +180,11 @@ function printServerDetails() { - TelemetryId = ${config.TelemetryId} - ServiceEnvironment = ${config.ServiceEnvironment}`); }); + cy.apiGetConfig().then(({config}) => { + cy.log(`Notable Server Config: + - ServiceSettings.EnableSecurityFixAlert = ${config.ServiceSettings.EnableSecurityFixAlert} + - LogSettings.EnableDiagnostics = ${config.LogSettings.EnableDiagnostics}`); + }); } function sysadminSetup(user) { diff --git a/e2e-tests/playwright/global_setup.ts b/e2e-tests/playwright/global_setup.ts index e76f1bc5e7d..55e5fe54d04 100644 --- a/e2e-tests/playwright/global_setup.ts +++ b/e2e-tests/playwright/global_setup.ts @@ -103,6 +103,12 @@ async function printClientInfo(client: Client) { - BuildEnterpriseReady = ${config.BuildEnterpriseReady} - TelemetryId = ${config.TelemetryId} - ServiceEnvironment = ${config.ServiceEnvironment}`); + + const {LogSettings, ServiceSettings} = await client.getConfig(); + // eslint-disable-next-line no-console + console.log(`Notable Server Config: + - ServiceSettings.EnableSecurityFixAlert = ${ServiceSettings.EnableSecurityFixAlert} + - LogSettings.EnableDiagnostics = ${LogSettings.EnableDiagnostics}`); } async function ensurePluginsLoaded(client: Client) { diff --git a/e2e-tests/playwright/support/server/default_config.ts b/e2e-tests/playwright/support/server/default_config.ts index 4dd9b300e2c..7cb69410af7 100644 --- a/e2e-tests/playwright/support/server/default_config.ts +++ b/e2e-tests/playwright/support/server/default_config.ts @@ -5,14 +5,15 @@ import merge from 'deepmerge'; import { AdminConfig, - ExperimentalSettings, - PasswordSettings, - ServiceSettings, - TeamSettings, - PluginSettings, ClusterSettings, CollapsedThreads, EmailSettings, + ExperimentalSettings, + LogSettings, + PasswordSettings, + PluginSettings, + ServiceSettings, + TeamSettings, } from '@mattermost/types/config'; import testConfig from '@e2e-test.config'; @@ -24,6 +25,7 @@ type TestAdminConfig = { ClusterSettings: Partial; EmailSettings: Partial; ExperimentalSettings: Partial; + LogSettings: Partial; PasswordSettings: Partial; PluginSettings: Partial; ServiceSettings: Partial; @@ -40,6 +42,9 @@ const onPremServerConfig = (): Partial => { EmailSettings: { PushNotificationServer: testConfig.pushNotificationServer, }, + LogSettings: { + EnableDiagnostics: false, + }, PasswordSettings: { MinimumLength: 5, Lowercase: false, @@ -65,6 +70,7 @@ const onPremServerConfig = (): Partial => { ServiceSettings: { SiteURL: testConfig.baseURL, EnableOnboardingFlow: false, + EnableSecurityFixAlert: false, GiphySdkKey: 's0glxvzVg9azvPipKxcPLpXV0q1x1fVP', }, TeamSettings: {