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
This commit is contained in:
Saturnino Abril 2024-03-28 16:43:53 +08:00 committed by GitHub
parent b6da56e44d
commit ed00cf78ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 27 additions and 8 deletions

View File

@ -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

View File

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

View File

@ -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": {},

View File

@ -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) {

View File

@ -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) {

View File

@ -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<ClusterSettings>;
EmailSettings: Partial<EmailSettings>;
ExperimentalSettings: Partial<ExperimentalSettings>;
LogSettings: Partial<LogSettings>;
PasswordSettings: Partial<PasswordSettings>;
PluginSettings: Partial<PluginSettings>;
ServiceSettings: Partial<ServiceSettings>;
@ -40,6 +42,9 @@ const onPremServerConfig = (): Partial<TestAdminConfig> => {
EmailSettings: {
PushNotificationServer: testConfig.pushNotificationServer,
},
LogSettings: {
EnableDiagnostics: false,
},
PasswordSettings: {
MinimumLength: 5,
Lowercase: false,
@ -65,6 +70,7 @@ const onPremServerConfig = (): Partial<TestAdminConfig> => {
ServiceSettings: {
SiteURL: testConfig.baseURL,
EnableOnboardingFlow: false,
EnableSecurityFixAlert: false,
GiphySdkKey: 's0glxvzVg9azvPipKxcPLpXV0q1x1fVP',
},
TeamSettings: {