From 75cde751ea6e72826f4f69d9098be614478856a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20=C3=81brah=C3=A1m?= Date: Tue, 19 Sep 2023 21:58:20 +0200 Subject: [PATCH] convert base config to a function instead of const --- .../public/management/cypress/cypress.config.ts | 8 ++++---- .../public/management/cypress/cypress_base.config.ts | 4 ++-- .../public/management/cypress/cypress_endpoint.config.ts | 8 ++++---- .../cypress/cypress_endpoint_serverless.config.ts | 8 +++++--- .../management/cypress/cypress_serverless.config.ts | 8 ++++---- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress.config.ts b/x-pack/plugins/security_solution/public/management/cypress/cypress.config.ts index f64212c461a13..ad18b6ca8ef1d 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/cypress.config.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/cypress.config.ts @@ -6,21 +6,21 @@ */ import { defineCypressConfig } from '@kbn/cypress-config'; -import { CY_BASE_CONFIG } from './cypress_base.config'; +import { getCypressBaseConfig } from './cypress_base.config'; import { dataLoaders } from './support/data_loaders'; export default defineCypressConfig({ - ...CY_BASE_CONFIG, + ...getCypressBaseConfig(), env: { - ...CY_BASE_CONFIG.env, + ...getCypressBaseConfig().env, grepTags: '@ess', }, e2e: { - ...CY_BASE_CONFIG.e2e, + ...getCypressBaseConfig().e2e, specPattern: 'public/management/cypress/e2e/mocked_data/', setupNodeEvents: (on, config) => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts b/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts index c3fa475ffc22e..b45e33388d039 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts @@ -5,7 +5,7 @@ * 2.0. */ -export const CY_BASE_CONFIG = { +export const getCypressBaseConfig = () => ({ reporter: '../../../../node_modules/cypress-multi-reporters', reporterOptions: { configFile: './public/management/reporter_config.json', @@ -51,4 +51,4 @@ export const CY_BASE_CONFIG = { supportFile: 'public/management/cypress/support/e2e.ts', experimentalRunAllSpecs: true, }, -}; +}); diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress_endpoint.config.ts b/x-pack/plugins/security_solution/public/management/cypress/cypress_endpoint.config.ts index fb19269df83af..409e3dc258ee2 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/cypress_endpoint.config.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/cypress_endpoint.config.ts @@ -6,7 +6,7 @@ */ import { defineCypressConfig } from '@kbn/cypress-config'; -import { CY_BASE_CONFIG } from './cypress_base.config'; +import { getCypressBaseConfig } from './cypress_base.config'; import { dataLoaders, dataLoadersForRealEndpoints } from './support/data_loaders'; @@ -14,10 +14,10 @@ import { responseActionTasks } from './support/response_actions'; // eslint-disable-next-line import/no-default-export export default defineCypressConfig({ - ...CY_BASE_CONFIG, + ...getCypressBaseConfig(), env: { - ...CY_BASE_CONFIG.env, + ...getCypressBaseConfig().env, 'cypress-react-selector': { root: '#security-solution-app', @@ -27,7 +27,7 @@ export default defineCypressConfig({ }, e2e: { - ...CY_BASE_CONFIG.e2e, + ...getCypressBaseConfig().e2e, experimentalMemoryManagement: true, experimentalInteractiveRunEvents: true, diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress_endpoint_serverless.config.ts b/x-pack/plugins/security_solution/public/management/cypress/cypress_endpoint_serverless.config.ts index ac14b8a38961f..d0fe78831f892 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/cypress_endpoint_serverless.config.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/cypress_endpoint_serverless.config.ts @@ -6,16 +6,16 @@ */ import { defineCypressConfig } from '@kbn/cypress-config'; -import { CY_BASE_CONFIG } from './cypress_base.config'; +import { getCypressBaseConfig } from './cypress_base.config'; import { dataLoaders } from './support/data_loaders'; import { responseActionTasks } from './support/response_actions'; // eslint-disable-next-line import/no-default-export export default defineCypressConfig({ - ...CY_BASE_CONFIG, + ...getCypressBaseConfig(), env: { - ...CY_BASE_CONFIG.env, + ...getCypressBaseConfig().env, IS_SERVERLESS: true, grepTags: '@serverless --@brokenInServerless', @@ -26,6 +26,8 @@ export default defineCypressConfig({ }, e2e: { + ...getCypressBaseConfig().e2e, + experimentalMemoryManagement: true, experimentalInteractiveRunEvents: true, diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress_serverless.config.ts b/x-pack/plugins/security_solution/public/management/cypress/cypress_serverless.config.ts index 5425c09c45681..60517176bc482 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/cypress_serverless.config.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/cypress_serverless.config.ts @@ -6,15 +6,15 @@ */ import { defineCypressConfig } from '@kbn/cypress-config'; -import { CY_BASE_CONFIG } from './cypress_base.config'; +import { getCypressBaseConfig } from './cypress_base.config'; import { dataLoaders } from './support/data_loaders'; // eslint-disable-next-line import/no-default-export export default defineCypressConfig({ - ...CY_BASE_CONFIG, + ...getCypressBaseConfig(), env: { - ...CY_BASE_CONFIG.env, + ...getCypressBaseConfig().env, IS_SERVERLESS: true, @@ -22,7 +22,7 @@ export default defineCypressConfig({ }, e2e: { - ...CY_BASE_CONFIG.e2e, + ...getCypressBaseConfig().e2e, specPattern: 'public/management/cypress/e2e/mocked_data/',