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
Этот коммит содержится в:
Saturnino Abril
2024-03-28 16:43:53 +08:00
коммит произвёл GitHub
родитель b6da56e44d
Коммит ed00cf78ff
6 изменённых файлов: 27 добавлений и 8 удалений

Просмотреть файл

@@ -55,6 +55,7 @@ services:
environment: environment:
MM_SERVICESETTINGS_ALLOWCORSFROM: "*" MM_SERVICESETTINGS_ALLOWCORSFROM: "*"
MM_SERVICESETTINGS_ENABLELOCALMODE: "true" MM_SERVICESETTINGS_ENABLELOCALMODE: "true"
MM_SERVICESETTINGS_ENABLESECURITYFIXALERT: "false"
MM_PLUGINSETTINGS_ENABLED: "true" MM_PLUGINSETTINGS_ENABLED: "true"
MM_PLUGINSETTINGS_ENABLEUPLOADS: "true" MM_PLUGINSETTINGS_ENABLEUPLOADS: "true"
MM_PLUGINSETTINGS_AUTOMATICPREPACKAGEDPLUGINS: "true" MM_PLUGINSETTINGS_AUTOMATICPREPACKAGEDPLUGINS: "true"
@@ -67,6 +68,7 @@ services:
MM_FEATUREFLAGS_ONBOARDINGTOURTIPS: "false" MM_FEATUREFLAGS_ONBOARDINGTOURTIPS: "false"
MM_SERVICEENVIRONMENT: "test" MM_SERVICEENVIRONMENT: "test"
MM_FEATUREFLAGS_MOVETHREADSENABLED: "true" MM_FEATUREFLAGS_MOVETHREADSENABLED: "true"
MM_LOGSETTINGS_ENABLEDIAGNOSTICS: "false"
network_mode: host network_mode: host
depends_on: depends_on:
$(for service in $ENABLED_DOCKER_SERVICES; do $(for service in $ENABLED_DOCKER_SERVICES; do

Просмотреть файл

@@ -35,7 +35,7 @@
"DeveloperFlags": "", "DeveloperFlags": "",
"EnableClientPerformanceDebugging": false, "EnableClientPerformanceDebugging": false,
"EnableOpenTracing": false, "EnableOpenTracing": false,
"EnableSecurityFixAlert": true, "EnableSecurityFixAlert": false,
"EnableInsecureOutgoingConnections": false, "EnableInsecureOutgoingConnections": false,
"AllowedUntrustedInternalConnections": "localhost", "AllowedUntrustedInternalConnections": "localhost",
"EnableMultifactorAuthentication": false, "EnableMultifactorAuthentication": false,

Просмотреть файл

@@ -36,7 +36,7 @@
"DeveloperFlags": "", "DeveloperFlags": "",
"EnableClientPerformanceDebugging": false, "EnableClientPerformanceDebugging": false,
"EnableOpenTracing": false, "EnableOpenTracing": false,
"EnableSecurityFixAlert": true, "EnableSecurityFixAlert": false,
"EnableInsecureOutgoingConnections": false, "EnableInsecureOutgoingConnections": false,
"AllowedUntrustedInternalConnections": "localhost", "AllowedUntrustedInternalConnections": "localhost",
"EnableMultifactorAuthentication": false, "EnableMultifactorAuthentication": false,
@@ -170,7 +170,7 @@
"FileJson": true, "FileJson": true,
"FileLocation": "", "FileLocation": "",
"EnableWebhookDebugging": true, "EnableWebhookDebugging": true,
"EnableDiagnostics": true, "EnableDiagnostics": false,
"VerboseDiagnostics": false, "VerboseDiagnostics": false,
"EnableSentry": false, "EnableSentry": false,
"AdvancedLoggingJSON": {}, "AdvancedLoggingJSON": {},

Просмотреть файл

@@ -180,6 +180,11 @@ function printServerDetails() {
- TelemetryId = ${config.TelemetryId} - TelemetryId = ${config.TelemetryId}
- ServiceEnvironment = ${config.ServiceEnvironment}`); - 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) { function sysadminSetup(user) {

Просмотреть файл

@@ -103,6 +103,12 @@ async function printClientInfo(client: Client) {
- BuildEnterpriseReady = ${config.BuildEnterpriseReady} - BuildEnterpriseReady = ${config.BuildEnterpriseReady}
- TelemetryId = ${config.TelemetryId} - TelemetryId = ${config.TelemetryId}
- ServiceEnvironment = ${config.ServiceEnvironment}`); - 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) { async function ensurePluginsLoaded(client: Client) {

Просмотреть файл

@@ -5,14 +5,15 @@ import merge from 'deepmerge';
import { import {
AdminConfig, AdminConfig,
ExperimentalSettings,
PasswordSettings,
ServiceSettings,
TeamSettings,
PluginSettings,
ClusterSettings, ClusterSettings,
CollapsedThreads, CollapsedThreads,
EmailSettings, EmailSettings,
ExperimentalSettings,
LogSettings,
PasswordSettings,
PluginSettings,
ServiceSettings,
TeamSettings,
} from '@mattermost/types/config'; } from '@mattermost/types/config';
import testConfig from '@e2e-test.config'; import testConfig from '@e2e-test.config';
@@ -24,6 +25,7 @@ type TestAdminConfig = {
ClusterSettings: Partial<ClusterSettings>; ClusterSettings: Partial<ClusterSettings>;
EmailSettings: Partial<EmailSettings>; EmailSettings: Partial<EmailSettings>;
ExperimentalSettings: Partial<ExperimentalSettings>; ExperimentalSettings: Partial<ExperimentalSettings>;
LogSettings: Partial<LogSettings>;
PasswordSettings: Partial<PasswordSettings>; PasswordSettings: Partial<PasswordSettings>;
PluginSettings: Partial<PluginSettings>; PluginSettings: Partial<PluginSettings>;
ServiceSettings: Partial<ServiceSettings>; ServiceSettings: Partial<ServiceSettings>;
@@ -40,6 +42,9 @@ const onPremServerConfig = (): Partial<TestAdminConfig> => {
EmailSettings: { EmailSettings: {
PushNotificationServer: testConfig.pushNotificationServer, PushNotificationServer: testConfig.pushNotificationServer,
}, },
LogSettings: {
EnableDiagnostics: false,
},
PasswordSettings: { PasswordSettings: {
MinimumLength: 5, MinimumLength: 5,
Lowercase: false, Lowercase: false,
@@ -65,6 +70,7 @@ const onPremServerConfig = (): Partial<TestAdminConfig> => {
ServiceSettings: { ServiceSettings: {
SiteURL: testConfig.baseURL, SiteURL: testConfig.baseURL,
EnableOnboardingFlow: false, EnableOnboardingFlow: false,
EnableSecurityFixAlert: false,
GiphySdkKey: 's0glxvzVg9azvPipKxcPLpXV0q1x1fVP', GiphySdkKey: 's0glxvzVg9azvPipKxcPLpXV0q1x1fVP',
}, },
TeamSettings: { TeamSettings: {