From c3c032a006496bdb770d4b95a6af23cd00229400 Mon Sep 17 00:00:00 2001 From: Cavit Baturalp Gurdin Date: Tue, 10 May 2022 17:14:09 +0300 Subject: [PATCH 1/6] restructure performance tests for per journey config --- .../functional/performance_playwright.sh | 8 ++-- .../ecommerce_dashboard.config.ts | 35 ++++++++++++++++++ .../ecommerce_dashboard.ts | 0 .../flight_dashboard.config.ts | 35 ++++++++++++++++++ .../flight_dashboard}/flight_dashboard.ts | 0 .../journeys/login/login.config.ts | 35 ++++++++++++++++++ .../playwright => journeys/login}/login.ts | 2 +- .../many_fields_discover.config.ts | 37 +++++++++++++++++++ .../many_fields_discover.ts | 0 .../performance.config.ts} | 18 +++------ .../promotion_tracking_dashboard.config.ts | 37 +++++++++++++++++++ .../promotion_tracking_dashboard.ts | 0 .../web_logs_dashboard.config.ts | 37 +++++++++++++++++++ .../web_logs_dashboard}/web_logs_dashboard.ts | 2 +- .../performance/tests/playwright/index.ts | 24 ------------ x-pack/test/performance/utils.ts | 12 ++++++ 16 files changed, 239 insertions(+), 43 deletions(-) create mode 100644 x-pack/test/performance/journeys/ecommerce_dashboard/ecommerce_dashboard.config.ts rename x-pack/test/performance/{tests/playwright => journeys/ecommerce_dashboard}/ecommerce_dashboard.ts (100%) create mode 100644 x-pack/test/performance/journeys/flight_dashboard/flight_dashboard.config.ts rename x-pack/test/performance/{tests/playwright => journeys/flight_dashboard}/flight_dashboard.ts (100%) create mode 100644 x-pack/test/performance/journeys/login/login.config.ts rename x-pack/test/performance/{tests/playwright => journeys/login}/login.ts (94%) create mode 100644 x-pack/test/performance/journeys/many_fields_discover/many_fields_discover.config.ts rename x-pack/test/performance/{tests/playwright => journeys/many_fields_discover}/many_fields_discover.ts (100%) rename x-pack/test/performance/{config.playwright.ts => journeys/performance.config.ts} (83%) create mode 100644 x-pack/test/performance/journeys/promotion_tracking_dashboard/promotion_tracking_dashboard.config.ts rename x-pack/test/performance/{tests/playwright => journeys/promotion_tracking_dashboard}/promotion_tracking_dashboard.ts (100%) create mode 100644 x-pack/test/performance/journeys/web_logs_dashboard/web_logs_dashboard.config.ts rename x-pack/test/performance/{tests/playwright => journeys/web_logs_dashboard}/web_logs_dashboard.ts (96%) delete mode 100644 x-pack/test/performance/tests/playwright/index.ts create mode 100644 x-pack/test/performance/utils.ts diff --git a/.buildkite/scripts/steps/functional/performance_playwright.sh b/.buildkite/scripts/steps/functional/performance_playwright.sh index a1c3f23ced51e..5aa9a97559cc1 100644 --- a/.buildkite/scripts/steps/functional/performance_playwright.sh +++ b/.buildkite/scripts/steps/functional/performance_playwright.sh @@ -29,8 +29,8 @@ for i in "${journeys[@]}"; do checks-reporter-with-killswitch "Run Performance Tests with Playwright Config (Journey:${i},Phase: WARMUP)" \ node scripts/functional_tests \ - --config x-pack/test/performance/config.playwright.ts \ - --include "x-pack/test/performance/tests/playwright/${i}.ts" \ + --config "x-pack/test/performance/journeys/${i}/${i}.config.ts" \ + --include "x-pack/test/performance/journeys/${i}/${i}.ts" \ --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ --debug \ --bail @@ -40,8 +40,8 @@ for i in "${journeys[@]}"; do checks-reporter-with-killswitch "Run Performance Tests with Playwright Config (Journey:${i},Phase: TEST)" \ node scripts/functional_tests \ - --config x-pack/test/performance/config.playwright.ts \ - --include "x-pack/test/performance/tests/playwright/${i}.ts" \ + --config "x-pack/test/performance/journeys/${i}/${i}.config.ts" \ + --include "x-pack/test/performance/journeys/${i}/${i}.ts" \ --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ --debug \ --bail diff --git a/x-pack/test/performance/journeys/ecommerce_dashboard/ecommerce_dashboard.config.ts b/x-pack/test/performance/journeys/ecommerce_dashboard/ecommerce_dashboard.config.ts new file mode 100644 index 0000000000000..22cabf08dfe94 --- /dev/null +++ b/x-pack/test/performance/journeys/ecommerce_dashboard/ecommerce_dashboard.config.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { FtrConfigProviderContext } from '@kbn/test'; +import * as saferLodashSet from '@elastic/safer-lodash-set'; +import { serializeApmGlobalLabels } from '../../utils'; + +export default async function ({ readConfigFile, log }: FtrConfigProviderContext) { + const performanceConfig = await readConfigFile(require.resolve('../performance.config')); + + const testFiles = [require.resolve('./ecommerce_dashboard')]; + + const config = { + testFiles, + ...performanceConfig.getAll(), + }; + + const apmGlobalLabels = { + ...performanceConfig.get('kbnTestServer').env, + ftrConfig: `x-pack/test/performance/tests/journeys/ecommerce_dashboard/ecommerce_dashboard.config.ts`, + performancePhase: process.env.TEST_PERFORMANCE_PHASE, + journeyName: 'ecommerce_dashboard', + }; + + saferLodashSet.set( + config, + 'kbnTestServer.env.ELASTIC_APM_GLOBAL_LABELS', + serializeApmGlobalLabels(apmGlobalLabels) + ); + + return config; +} diff --git a/x-pack/test/performance/tests/playwright/ecommerce_dashboard.ts b/x-pack/test/performance/journeys/ecommerce_dashboard/ecommerce_dashboard.ts similarity index 100% rename from x-pack/test/performance/tests/playwright/ecommerce_dashboard.ts rename to x-pack/test/performance/journeys/ecommerce_dashboard/ecommerce_dashboard.ts diff --git a/x-pack/test/performance/journeys/flight_dashboard/flight_dashboard.config.ts b/x-pack/test/performance/journeys/flight_dashboard/flight_dashboard.config.ts new file mode 100644 index 0000000000000..56a3439d3025a --- /dev/null +++ b/x-pack/test/performance/journeys/flight_dashboard/flight_dashboard.config.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { FtrConfigProviderContext } from '@kbn/test'; +import * as saferLodashSet from '@elastic/safer-lodash-set'; +import { serializeApmGlobalLabels } from '../../utils'; + +export default async function ({ readConfigFile, log }: FtrConfigProviderContext) { + const performanceConfig = await readConfigFile(require.resolve('../performance.config')); + + const testFiles = [require.resolve('./flight_dashboard')]; + + const config = { + testFiles, + ...performanceConfig.getAll(), + }; + + const apmGlobalLabels = { + ...performanceConfig.get('kbnTestServer').env, + ftrConfig: `x-pack/test/performance/tests/journeys/flight_dashboard/flight_dashboard.config.ts`, + performancePhase: process.env.TEST_PERFORMANCE_PHASE, + journeyName: 'flight_dashboard', + }; + + saferLodashSet.set( + config, + 'kbnTestServer.env.ELASTIC_APM_GLOBAL_LABELS', + serializeApmGlobalLabels(apmGlobalLabels) + ); + + return config; +} diff --git a/x-pack/test/performance/tests/playwright/flight_dashboard.ts b/x-pack/test/performance/journeys/flight_dashboard/flight_dashboard.ts similarity index 100% rename from x-pack/test/performance/tests/playwright/flight_dashboard.ts rename to x-pack/test/performance/journeys/flight_dashboard/flight_dashboard.ts diff --git a/x-pack/test/performance/journeys/login/login.config.ts b/x-pack/test/performance/journeys/login/login.config.ts new file mode 100644 index 0000000000000..8de4e153015c9 --- /dev/null +++ b/x-pack/test/performance/journeys/login/login.config.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { FtrConfigProviderContext } from '@kbn/test'; +import * as saferLodashSet from '@elastic/safer-lodash-set'; +import { serializeApmGlobalLabels } from '../../utils'; + +export default async function ({ readConfigFile, log }: FtrConfigProviderContext) { + const performanceConfig = await readConfigFile(require.resolve('../performance.config')); + + const testFiles = [require.resolve('./login')]; + + const config = { + testFiles, + ...performanceConfig.getAll(), + }; + + const apmGlobalLabels = { + ...performanceConfig.get('kbnTestServer').env, + ftrConfig: `x-pack/test/performance/tests/journeys/login/login.config.ts`, + performancePhase: process.env.TEST_PERFORMANCE_PHASE, + journeyName: 'login', + }; + + saferLodashSet.set( + config, + 'kbnTestServer.env.ELASTIC_APM_GLOBAL_LABELS', + serializeApmGlobalLabels(apmGlobalLabels) + ); + + return config; +} diff --git a/x-pack/test/performance/tests/playwright/login.ts b/x-pack/test/performance/journeys/login/login.ts similarity index 94% rename from x-pack/test/performance/tests/playwright/login.ts rename to x-pack/test/performance/journeys/login/login.ts index 74baabc049f86..62bb4e512beda 100644 --- a/x-pack/test/performance/tests/playwright/login.ts +++ b/x-pack/test/performance/journeys/login/login.ts @@ -7,7 +7,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; import { StepCtx } from '../../services/performance'; -export default function ecommerceDashboard({ getService }: FtrProviderContext) { +export default function login({ getService }: FtrProviderContext) { describe('login', () => { it('login', async () => { const inputDelays = getService('inputDelays'); diff --git a/x-pack/test/performance/journeys/many_fields_discover/many_fields_discover.config.ts b/x-pack/test/performance/journeys/many_fields_discover/many_fields_discover.config.ts new file mode 100644 index 0000000000000..270e95d6b13a6 --- /dev/null +++ b/x-pack/test/performance/journeys/many_fields_discover/many_fields_discover.config.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { FtrConfigProviderContext } from '@kbn/test'; +import * as saferLodashSet from '@elastic/safer-lodash-set'; +import { serializeApmGlobalLabels } from '../../utils'; + +async function manyFieldsDiscover({ readConfigFile, log }: FtrConfigProviderContext) { + const performanceConfig = await readConfigFile(require.resolve('../performance.config')); + + const testFiles = [require.resolve('./many_fields_discover')]; + + const config = { + testFiles, + ...performanceConfig.getAll(), + }; + + const apmGlobalLabels = { + ...performanceConfig.get('kbnTestServer').env, + ftrConfig: `x-pack/test/performance/tests/journeys/many_fields_discover/many_fields_discover.config.ts`, + performancePhase: process.env.TEST_PERFORMANCE_PHASE, + journeyName: 'many_fields_discover', + }; + + saferLodashSet.set( + config, + 'kbnTestServer.env.ELASTIC_APM_GLOBAL_LABELS', + serializeApmGlobalLabels(apmGlobalLabels) + ); + + return config; +} + +export default manyFieldsDiscover; diff --git a/x-pack/test/performance/tests/playwright/many_fields_discover.ts b/x-pack/test/performance/journeys/many_fields_discover/many_fields_discover.ts similarity index 100% rename from x-pack/test/performance/tests/playwright/many_fields_discover.ts rename to x-pack/test/performance/journeys/many_fields_discover/many_fields_discover.ts diff --git a/x-pack/test/performance/config.playwright.ts b/x-pack/test/performance/journeys/performance.config.ts similarity index 83% rename from x-pack/test/performance/config.playwright.ts rename to x-pack/test/performance/journeys/performance.config.ts index 44a53d7be80a1..c21e69728f63d 100644 --- a/x-pack/test/performance/config.playwright.ts +++ b/x-pack/test/performance/journeys/performance.config.ts @@ -7,17 +7,15 @@ import uuid from 'uuid'; import { FtrConfigProviderContext } from '@kbn/test'; -import { services } from './services'; -import { pageObjects } from './page_objects'; +import { services } from '../services'; +import { pageObjects } from '../page_objects'; // These "secret" values are intentionally written in the source. We would make the APM server accept anonymous traffic if we could const APM_SERVER_URL = 'https://kibana-ops-e2e-perf.apm.us-central1.gcp.cloud.es.io:443'; const APM_PUBLIC_TOKEN = 'CTs9y3cvcfq13bQqsB'; export default async function ({ readConfigFile, log }: FtrConfigProviderContext) { - const functionalConfig = await readConfigFile(require.resolve('../functional/config.base.js')); - - const testFiles = [require.resolve('./tests/playwright')]; + const functionalConfig = await readConfigFile(require.resolve('../../functional/config.base.js')); const testBuildId = process.env.BUILDKITE_BUILD_ID ?? `local-${uuid()}`; const testJobId = process.env.BUILDKITE_JOB_ID ?? `local-${uuid()}`; @@ -26,7 +24,6 @@ export default async function ({ readConfigFile, log }: FtrConfigProviderContext log.info(` 👷‍♀️ BUILD ID ${testBuildId}\n 👷 JOB ID ${testJobId}\n 👷‍♂️ EXECUTION ID:${executionId}`); return { - testFiles, services, pageObjects, servicesRequiredForTestAnalysis: ['performance'], @@ -58,15 +55,10 @@ export default async function ({ readConfigFile, log }: FtrConfigProviderContext // for a body with larger size, we might need to reconfigure the APM server to increase the limit. // https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#long-field-max-length ELASTIC_APM_LONG_FIELD_MAX_LENGTH: 300_000, - ELASTIC_APM_GLOBAL_LABELS: Object.entries({ - ftrConfig: `x-pack/test/performance/tests/config.playwright`, - performancePhase: process.env.TEST_PERFORMANCE_PHASE, - journeyName: process.env.JOURNEY_NAME, + ELASTIC_APM_GLOBAL_LABELS: { testJobId, testBuildId, - }) - .filter(([, v]) => !!v) - .reduce((acc, [k, v]) => (acc ? `${acc},${k}=${v}` : `${k}=${v}`), ''), + }, }, // delay shutdown by 15 seconds to ensure that APM can report the data it collects during test execution delayShutdown: 15_000, diff --git a/x-pack/test/performance/journeys/promotion_tracking_dashboard/promotion_tracking_dashboard.config.ts b/x-pack/test/performance/journeys/promotion_tracking_dashboard/promotion_tracking_dashboard.config.ts new file mode 100644 index 0000000000000..11c021782e9e2 --- /dev/null +++ b/x-pack/test/performance/journeys/promotion_tracking_dashboard/promotion_tracking_dashboard.config.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { FtrConfigProviderContext } from '@kbn/test'; +import * as saferLodashSet from '@elastic/safer-lodash-set'; +import { serializeApmGlobalLabels } from '../../utils'; + +async function promotionTrackingDashboard({ readConfigFile, log }: FtrConfigProviderContext) { + const performanceConfig = await readConfigFile(require.resolve('../performance.config')); + + const testFiles = [require.resolve('./promotion_tracking_dashboard')]; + + const config = { + testFiles, + ...performanceConfig.getAll(), + }; + + const apmGlobalLabels = { + ...performanceConfig.get('kbnTestServer').env, + ftrConfig: `x-pack/test/performance/tests/journeys/promotion_tracking_dashboard/promotion_tracking_dashboard.config.ts`, + performancePhase: process.env.TEST_PERFORMANCE_PHASE, + journeyName: 'promotion_tracking_dashboard', + }; + + saferLodashSet.set( + config, + 'kbnTestServer.env.ELASTIC_APM_GLOBAL_LABELS', + serializeApmGlobalLabels(apmGlobalLabels) + ); + + return config; +} + +export default promotionTrackingDashboard; diff --git a/x-pack/test/performance/tests/playwright/promotion_tracking_dashboard.ts b/x-pack/test/performance/journeys/promotion_tracking_dashboard/promotion_tracking_dashboard.ts similarity index 100% rename from x-pack/test/performance/tests/playwright/promotion_tracking_dashboard.ts rename to x-pack/test/performance/journeys/promotion_tracking_dashboard/promotion_tracking_dashboard.ts diff --git a/x-pack/test/performance/journeys/web_logs_dashboard/web_logs_dashboard.config.ts b/x-pack/test/performance/journeys/web_logs_dashboard/web_logs_dashboard.config.ts new file mode 100644 index 0000000000000..f884d4c352de5 --- /dev/null +++ b/x-pack/test/performance/journeys/web_logs_dashboard/web_logs_dashboard.config.ts @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { FtrConfigProviderContext } from '@kbn/test'; +import * as saferLodashSet from '@elastic/safer-lodash-set'; +import { serializeApmGlobalLabels } from '../../utils'; + +async function webLogsDashboard({ readConfigFile, log }: FtrConfigProviderContext) { + const performanceConfig = await readConfigFile(require.resolve('../performance.config')); + + const testFiles = [require.resolve('./web_logs_dashboard')]; + + const config = { + testFiles, + ...performanceConfig.getAll(), + }; + + const apmGlobalLabels = { + ...performanceConfig.get('kbnTestServer').env, + ftrConfig: `x-pack/test/performance/tests/journeys/web_logs_dashboard/web_logs_dashboard.config.ts`, + performancePhase: process.env.TEST_PERFORMANCE_PHASE, + journeyName: 'web_logs_dashboard', + }; + + saferLodashSet.set( + config, + 'kbnTestServer.env.ELASTIC_APM_GLOBAL_LABELS', + serializeApmGlobalLabels(apmGlobalLabels) + ); + + return config; +} + +export default webLogsDashboard; diff --git a/x-pack/test/performance/tests/playwright/web_logs_dashboard.ts b/x-pack/test/performance/journeys/web_logs_dashboard/web_logs_dashboard.ts similarity index 96% rename from x-pack/test/performance/tests/playwright/web_logs_dashboard.ts rename to x-pack/test/performance/journeys/web_logs_dashboard/web_logs_dashboard.ts index 6ecee7f1244f7..a2e36947580b3 100644 --- a/x-pack/test/performance/tests/playwright/web_logs_dashboard.ts +++ b/x-pack/test/performance/journeys/web_logs_dashboard/web_logs_dashboard.ts @@ -7,7 +7,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; import { StepCtx } from '../../services/performance'; -export default function weblogDashboard({ getService }: FtrProviderContext) { +export default function weblogsDashboard({ getService }: FtrProviderContext) { describe('weblogs_dashboard', () => { it('weblogs_dashboard', async () => { const performance = getService('performance'); diff --git a/x-pack/test/performance/tests/playwright/index.ts b/x-pack/test/performance/tests/playwright/index.ts deleted file mode 100644 index d7e7c43b00178..0000000000000 --- a/x-pack/test/performance/tests/playwright/index.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { FtrProviderContext } from '../../ftr_provider_context'; - -export default function ({ loadTestFile, getService }: FtrProviderContext) { - const performance = getService('performance'); - - describe('Performance tests', () => { - loadTestFile(require.resolve('./login')); - loadTestFile(require.resolve('./ecommerce_dashboard')); - loadTestFile(require.resolve('./flight_dashboard')); - loadTestFile(require.resolve('./web_logs_dashboard')); - loadTestFile(require.resolve('./promotion_tracking_dashboard')); - loadTestFile(require.resolve('./many_fields_discover')); - - after(async () => { - await performance.shutdownBrowser(); - }); - }); -} diff --git a/x-pack/test/performance/utils.ts b/x-pack/test/performance/utils.ts new file mode 100644 index 0000000000000..bb6f8e0aebe64 --- /dev/null +++ b/x-pack/test/performance/utils.ts @@ -0,0 +1,12 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export function serializeApmGlobalLabels(obj: any) { + return Object.entries(obj) + .filter(([, v]) => !!v) + .reduce((acc, [k, v]) => (acc ? `${acc},${k}=${v}` : `${k}=${v}`), ''); +} From 01c5d51496f585c21876e45e6e8e911706bef17a Mon Sep 17 00:00:00 2001 From: Cavit Baturalp Gurdin Date: Wed, 11 May 2022 15:26:14 +0200 Subject: [PATCH 2/6] allow default exports for performance folder --- .eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.js b/.eslintrc.js index dfbdd4de96f0a..d4da7515059d3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -571,6 +571,7 @@ module.exports = { 'x-pack/test/*/*config.*ts', 'x-pack/test/saved_object_api_integration/*/apis/**/*', 'x-pack/test/ui_capabilities/*/tests/**/*', + 'x-pack/test/performance/**/*.ts', ], rules: { 'import/no-default-export': 'off', From 8c901a93365cbf1281be2053b0d5f50fb43d3abf Mon Sep 17 00:00:00 2001 From: Cavit Baturalp Gurdin Date: Thu, 12 May 2022 13:22:45 +0200 Subject: [PATCH 3/6] restructure performance tests for per journey config --- .buildkite/ftr_configs.yml | 6 ++++ .../functional/performance_playwright.sh | 6 ++-- .../{performance.config.ts => base.config.ts} | 0 ...commerce_dashboard.config.ts => config.ts} | 26 +++++++++-------- .../{flight_dashboard.config.ts => config.ts} | 26 +++++++++-------- .../login/{login.config.ts => config.ts} | 26 +++++++++-------- ...ny_fields_discover.config.ts => config.ts} | 28 +++++++++---------- ...tracking_dashboard.config.ts => config.ts} | 28 +++++++++---------- ...web_logs_dashboard.config.ts => config.ts} | 28 +++++++++---------- 9 files changed, 92 insertions(+), 82 deletions(-) rename x-pack/test/performance/journeys/{performance.config.ts => base.config.ts} (100%) rename x-pack/test/performance/journeys/ecommerce_dashboard/{ecommerce_dashboard.config.ts => config.ts} (64%) rename x-pack/test/performance/journeys/flight_dashboard/{flight_dashboard.config.ts => config.ts} (64%) rename x-pack/test/performance/journeys/login/{login.config.ts => config.ts} (58%) rename x-pack/test/performance/journeys/many_fields_discover/{many_fields_discover.config.ts => config.ts} (62%) rename x-pack/test/performance/journeys/promotion_tracking_dashboard/{promotion_tracking_dashboard.config.ts => config.ts} (61%) rename x-pack/test/performance/journeys/web_logs_dashboard/{web_logs_dashboard.config.ts => config.ts} (62%) diff --git a/.buildkite/ftr_configs.yml b/.buildkite/ftr_configs.yml index 5340b4bf578cd..ead8182e0dbf1 100644 --- a/.buildkite/ftr_configs.yml +++ b/.buildkite/ftr_configs.yml @@ -239,3 +239,9 @@ enabled: - x-pack/test/ui_capabilities/spaces_only/config.ts - x-pack/test/upgrade_assistant_integration/config.js - x-pack/test/usage_collection/config.ts + - x-pack/test/performance/journeys/ecommerce_dashboard/config.ts + - x-pack/test/performance/journeys/flight_dashboard/config.ts + - x-pack/test/performance/journeys/login/config.ts + - x-pack/test/performance/journeys/many_fields_discover/config.ts + - x-pack/test/performance/journeys/promotion_tracking_dashboard/config.ts + - x-pack/test/performance/journeys/web_logs_dashboard/config.ts diff --git a/.buildkite/scripts/steps/functional/performance_playwright.sh b/.buildkite/scripts/steps/functional/performance_playwright.sh index 5aa9a97559cc1..b6ffcd9679c30 100644 --- a/.buildkite/scripts/steps/functional/performance_playwright.sh +++ b/.buildkite/scripts/steps/functional/performance_playwright.sh @@ -29,8 +29,7 @@ for i in "${journeys[@]}"; do checks-reporter-with-killswitch "Run Performance Tests with Playwright Config (Journey:${i},Phase: WARMUP)" \ node scripts/functional_tests \ - --config "x-pack/test/performance/journeys/${i}/${i}.config.ts" \ - --include "x-pack/test/performance/journeys/${i}/${i}.ts" \ + --config "x-pack/test/performance/journeys/${i}/config.ts" \ --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ --debug \ --bail @@ -40,8 +39,7 @@ for i in "${journeys[@]}"; do checks-reporter-with-killswitch "Run Performance Tests with Playwright Config (Journey:${i},Phase: TEST)" \ node scripts/functional_tests \ - --config "x-pack/test/performance/journeys/${i}/${i}.config.ts" \ - --include "x-pack/test/performance/journeys/${i}/${i}.ts" \ + --config "x-pack/test/performance/journeys/${i}/config.ts" \ --kibana-install-dir "$KIBANA_BUILD_LOCATION" \ --debug \ --bail diff --git a/x-pack/test/performance/journeys/performance.config.ts b/x-pack/test/performance/journeys/base.config.ts similarity index 100% rename from x-pack/test/performance/journeys/performance.config.ts rename to x-pack/test/performance/journeys/base.config.ts diff --git a/x-pack/test/performance/journeys/ecommerce_dashboard/ecommerce_dashboard.config.ts b/x-pack/test/performance/journeys/ecommerce_dashboard/config.ts similarity index 64% rename from x-pack/test/performance/journeys/ecommerce_dashboard/ecommerce_dashboard.config.ts rename to x-pack/test/performance/journeys/ecommerce_dashboard/config.ts index 22cabf08dfe94..76ffe9a5f19ba 100644 --- a/x-pack/test/performance/journeys/ecommerce_dashboard/ecommerce_dashboard.config.ts +++ b/x-pack/test/performance/journeys/ecommerce_dashboard/config.ts @@ -5,11 +5,10 @@ * 2.0. */ import { FtrConfigProviderContext } from '@kbn/test'; -import * as saferLodashSet from '@elastic/safer-lodash-set'; import { serializeApmGlobalLabels } from '../../utils'; -export default async function ({ readConfigFile, log }: FtrConfigProviderContext) { - const performanceConfig = await readConfigFile(require.resolve('../performance.config')); +export default async function ({ readConfigFile }: FtrConfigProviderContext) { + const performanceConfig = await readConfigFile(require.resolve('../base.config')); const testFiles = [require.resolve('./ecommerce_dashboard')]; @@ -19,17 +18,20 @@ export default async function ({ readConfigFile, log }: FtrConfigProviderContext }; const apmGlobalLabels = { - ...performanceConfig.get('kbnTestServer').env, - ftrConfig: `x-pack/test/performance/tests/journeys/ecommerce_dashboard/ecommerce_dashboard.config.ts`, + ...performanceConfig.get('kbnTestServer').env.ELASTIC_APM_GLOBAL_LABELS, + ftrConfig: `x-pack/test/performance/tests/journeys/ecommerce_dashboard/config.ts`, performancePhase: process.env.TEST_PERFORMANCE_PHASE, journeyName: 'ecommerce_dashboard', }; - saferLodashSet.set( - config, - 'kbnTestServer.env.ELASTIC_APM_GLOBAL_LABELS', - serializeApmGlobalLabels(apmGlobalLabels) - ); - - return config; + return { + ...config, + kbnTestServer: { + ...config.kbnTestServer, + env: { + ...config.kbnTestServer.env, + ELASTIC_APM_GLOBAL_LABELS: serializeApmGlobalLabels(apmGlobalLabels), + }, + }, + }; } diff --git a/x-pack/test/performance/journeys/flight_dashboard/flight_dashboard.config.ts b/x-pack/test/performance/journeys/flight_dashboard/config.ts similarity index 64% rename from x-pack/test/performance/journeys/flight_dashboard/flight_dashboard.config.ts rename to x-pack/test/performance/journeys/flight_dashboard/config.ts index 56a3439d3025a..8640dcd7c1650 100644 --- a/x-pack/test/performance/journeys/flight_dashboard/flight_dashboard.config.ts +++ b/x-pack/test/performance/journeys/flight_dashboard/config.ts @@ -5,11 +5,10 @@ * 2.0. */ import { FtrConfigProviderContext } from '@kbn/test'; -import * as saferLodashSet from '@elastic/safer-lodash-set'; import { serializeApmGlobalLabels } from '../../utils'; -export default async function ({ readConfigFile, log }: FtrConfigProviderContext) { - const performanceConfig = await readConfigFile(require.resolve('../performance.config')); +export default async function ({ readConfigFile }: FtrConfigProviderContext) { + const performanceConfig = await readConfigFile(require.resolve('../base.config')); const testFiles = [require.resolve('./flight_dashboard')]; @@ -19,17 +18,20 @@ export default async function ({ readConfigFile, log }: FtrConfigProviderContext }; const apmGlobalLabels = { - ...performanceConfig.get('kbnTestServer').env, - ftrConfig: `x-pack/test/performance/tests/journeys/flight_dashboard/flight_dashboard.config.ts`, + ...performanceConfig.get('kbnTestServer').env.ELASTIC_APM_GLOBAL_LABELS, + ftrConfig: `x-pack/test/performance/tests/journeys/flight_dashboard/config.ts`, performancePhase: process.env.TEST_PERFORMANCE_PHASE, journeyName: 'flight_dashboard', }; - saferLodashSet.set( - config, - 'kbnTestServer.env.ELASTIC_APM_GLOBAL_LABELS', - serializeApmGlobalLabels(apmGlobalLabels) - ); - - return config; + return { + ...config, + kbnTestServer: { + ...config.kbnTestServer, + env: { + ...config.kbnTestServer.env, + ELASTIC_APM_GLOBAL_LABELS: serializeApmGlobalLabels(apmGlobalLabels), + }, + }, + }; } diff --git a/x-pack/test/performance/journeys/login/login.config.ts b/x-pack/test/performance/journeys/login/config.ts similarity index 58% rename from x-pack/test/performance/journeys/login/login.config.ts rename to x-pack/test/performance/journeys/login/config.ts index 8de4e153015c9..230713eba3024 100644 --- a/x-pack/test/performance/journeys/login/login.config.ts +++ b/x-pack/test/performance/journeys/login/config.ts @@ -5,11 +5,10 @@ * 2.0. */ import { FtrConfigProviderContext } from '@kbn/test'; -import * as saferLodashSet from '@elastic/safer-lodash-set'; import { serializeApmGlobalLabels } from '../../utils'; -export default async function ({ readConfigFile, log }: FtrConfigProviderContext) { - const performanceConfig = await readConfigFile(require.resolve('../performance.config')); +export default async function ({ readConfigFile }: FtrConfigProviderContext) { + const performanceConfig = await readConfigFile(require.resolve('../base.config')); const testFiles = [require.resolve('./login')]; @@ -19,17 +18,20 @@ export default async function ({ readConfigFile, log }: FtrConfigProviderContext }; const apmGlobalLabels = { - ...performanceConfig.get('kbnTestServer').env, - ftrConfig: `x-pack/test/performance/tests/journeys/login/login.config.ts`, + ...performanceConfig.get('kbnTestServer').env.ELASTIC_APM_GLOBAL_LABELS, + ftrConfig: `x-pack/test/performance/tests/journeys/login/config.ts`, performancePhase: process.env.TEST_PERFORMANCE_PHASE, journeyName: 'login', }; - saferLodashSet.set( - config, - 'kbnTestServer.env.ELASTIC_APM_GLOBAL_LABELS', - serializeApmGlobalLabels(apmGlobalLabels) - ); - - return config; + return { + ...config, + kbnTestServer: { + ...config.kbnTestServer, + env: { + ...config.kbnTestServer.env, + ELASTIC_APM_GLOBAL_LABELS: serializeApmGlobalLabels(apmGlobalLabels), + }, + }, + }; } diff --git a/x-pack/test/performance/journeys/many_fields_discover/many_fields_discover.config.ts b/x-pack/test/performance/journeys/many_fields_discover/config.ts similarity index 62% rename from x-pack/test/performance/journeys/many_fields_discover/many_fields_discover.config.ts rename to x-pack/test/performance/journeys/many_fields_discover/config.ts index 270e95d6b13a6..28fc3b74b3574 100644 --- a/x-pack/test/performance/journeys/many_fields_discover/many_fields_discover.config.ts +++ b/x-pack/test/performance/journeys/many_fields_discover/config.ts @@ -5,11 +5,10 @@ * 2.0. */ import { FtrConfigProviderContext } from '@kbn/test'; -import * as saferLodashSet from '@elastic/safer-lodash-set'; import { serializeApmGlobalLabels } from '../../utils'; -async function manyFieldsDiscover({ readConfigFile, log }: FtrConfigProviderContext) { - const performanceConfig = await readConfigFile(require.resolve('../performance.config')); +export default async function manyFieldsDiscover({ readConfigFile }: FtrConfigProviderContext) { + const performanceConfig = await readConfigFile(require.resolve('../base.config')); const testFiles = [require.resolve('./many_fields_discover')]; @@ -19,19 +18,20 @@ async function manyFieldsDiscover({ readConfigFile, log }: FtrConfigProviderCont }; const apmGlobalLabels = { - ...performanceConfig.get('kbnTestServer').env, - ftrConfig: `x-pack/test/performance/tests/journeys/many_fields_discover/many_fields_discover.config.ts`, + ...performanceConfig.get('kbnTestServer').env.ELASTIC_APM_GLOBAL_LABELS, + ftrConfig: `x-pack/test/performance/tests/journeys/many_fields_discover/config.ts`, performancePhase: process.env.TEST_PERFORMANCE_PHASE, journeyName: 'many_fields_discover', }; - saferLodashSet.set( - config, - 'kbnTestServer.env.ELASTIC_APM_GLOBAL_LABELS', - serializeApmGlobalLabels(apmGlobalLabels) - ); - - return config; + return { + ...config, + kbnTestServer: { + ...config.kbnTestServer, + env: { + ...config.kbnTestServer.env, + ELASTIC_APM_GLOBAL_LABELS: serializeApmGlobalLabels(apmGlobalLabels), + }, + }, + }; } - -export default manyFieldsDiscover; diff --git a/x-pack/test/performance/journeys/promotion_tracking_dashboard/promotion_tracking_dashboard.config.ts b/x-pack/test/performance/journeys/promotion_tracking_dashboard/config.ts similarity index 61% rename from x-pack/test/performance/journeys/promotion_tracking_dashboard/promotion_tracking_dashboard.config.ts rename to x-pack/test/performance/journeys/promotion_tracking_dashboard/config.ts index 11c021782e9e2..49fa459c1a917 100644 --- a/x-pack/test/performance/journeys/promotion_tracking_dashboard/promotion_tracking_dashboard.config.ts +++ b/x-pack/test/performance/journeys/promotion_tracking_dashboard/config.ts @@ -5,11 +5,10 @@ * 2.0. */ import { FtrConfigProviderContext } from '@kbn/test'; -import * as saferLodashSet from '@elastic/safer-lodash-set'; import { serializeApmGlobalLabels } from '../../utils'; -async function promotionTrackingDashboard({ readConfigFile, log }: FtrConfigProviderContext) { - const performanceConfig = await readConfigFile(require.resolve('../performance.config')); +export default async function ({ readConfigFile, log }: FtrConfigProviderContext) { + const performanceConfig = await readConfigFile(require.resolve('../base.config')); const testFiles = [require.resolve('./promotion_tracking_dashboard')]; @@ -19,19 +18,20 @@ async function promotionTrackingDashboard({ readConfigFile, log }: FtrConfigProv }; const apmGlobalLabels = { - ...performanceConfig.get('kbnTestServer').env, - ftrConfig: `x-pack/test/performance/tests/journeys/promotion_tracking_dashboard/promotion_tracking_dashboard.config.ts`, + ...performanceConfig.get('kbnTestServer').env.ELASTIC_APM_GLOBAL_LABELS, + ftrConfig: `x-pack/test/performance/tests/journeys/promotion_tracking_dashboard/config.ts`, performancePhase: process.env.TEST_PERFORMANCE_PHASE, journeyName: 'promotion_tracking_dashboard', }; - saferLodashSet.set( - config, - 'kbnTestServer.env.ELASTIC_APM_GLOBAL_LABELS', - serializeApmGlobalLabels(apmGlobalLabels) - ); - - return config; + return { + ...config, + kbnTestServer: { + ...config.kbnTestServer, + env: { + ...config.kbnTestServer.env, + ELASTIC_APM_GLOBAL_LABELS: serializeApmGlobalLabels(apmGlobalLabels), + }, + }, + }; } - -export default promotionTrackingDashboard; diff --git a/x-pack/test/performance/journeys/web_logs_dashboard/web_logs_dashboard.config.ts b/x-pack/test/performance/journeys/web_logs_dashboard/config.ts similarity index 62% rename from x-pack/test/performance/journeys/web_logs_dashboard/web_logs_dashboard.config.ts rename to x-pack/test/performance/journeys/web_logs_dashboard/config.ts index f884d4c352de5..5e3bbd832b1b6 100644 --- a/x-pack/test/performance/journeys/web_logs_dashboard/web_logs_dashboard.config.ts +++ b/x-pack/test/performance/journeys/web_logs_dashboard/config.ts @@ -5,11 +5,10 @@ * 2.0. */ import { FtrConfigProviderContext } from '@kbn/test'; -import * as saferLodashSet from '@elastic/safer-lodash-set'; import { serializeApmGlobalLabels } from '../../utils'; -async function webLogsDashboard({ readConfigFile, log }: FtrConfigProviderContext) { - const performanceConfig = await readConfigFile(require.resolve('../performance.config')); +export default async function webLogsDashboard({ readConfigFile, log }: FtrConfigProviderContext) { + const performanceConfig = await readConfigFile(require.resolve('../base.config')); const testFiles = [require.resolve('./web_logs_dashboard')]; @@ -19,19 +18,20 @@ async function webLogsDashboard({ readConfigFile, log }: FtrConfigProviderContex }; const apmGlobalLabels = { - ...performanceConfig.get('kbnTestServer').env, - ftrConfig: `x-pack/test/performance/tests/journeys/web_logs_dashboard/web_logs_dashboard.config.ts`, + ...performanceConfig.get('kbnTestServer').env.ELASTIC_APM_GLOBAL_LABELS, + ftrConfig: `x-pack/test/performance/tests/journeys/web_logs_dashboard/config.ts`, performancePhase: process.env.TEST_PERFORMANCE_PHASE, journeyName: 'web_logs_dashboard', }; - saferLodashSet.set( - config, - 'kbnTestServer.env.ELASTIC_APM_GLOBAL_LABELS', - serializeApmGlobalLabels(apmGlobalLabels) - ); - - return config; + return { + ...config, + kbnTestServer: { + ...config.kbnTestServer, + env: { + ...config.kbnTestServer.env, + ELASTIC_APM_GLOBAL_LABELS: serializeApmGlobalLabels(apmGlobalLabels), + }, + }, + }; } - -export default webLogsDashboard; From 90f606c04f6cb623db247f9244d66abac1c68842 Mon Sep 17 00:00:00 2001 From: Cavit Baturalp Gurdin Date: Thu, 12 May 2022 13:44:54 +0200 Subject: [PATCH 4/6] consistent function naming --- .../journeys/ecommerce_dashboard/ecommerce_dashboard.ts | 2 +- .../performance/journeys/flight_dashboard/flight_dashboard.ts | 2 +- x-pack/test/performance/journeys/login/login.ts | 2 +- x-pack/test/performance/journeys/many_fields_discover/config.ts | 2 +- .../journeys/many_fields_discover/many_fields_discover.ts | 2 +- .../performance/journeys/promotion_tracking_dashboard/config.ts | 2 +- .../promotion_tracking_dashboard.ts | 2 +- .../journeys/web_logs_dashboard/web_logs_dashboard.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/x-pack/test/performance/journeys/ecommerce_dashboard/ecommerce_dashboard.ts b/x-pack/test/performance/journeys/ecommerce_dashboard/ecommerce_dashboard.ts index 143ca97c6d0b0..67dabe30c90ff 100644 --- a/x-pack/test/performance/journeys/ecommerce_dashboard/ecommerce_dashboard.ts +++ b/x-pack/test/performance/journeys/ecommerce_dashboard/ecommerce_dashboard.ts @@ -8,7 +8,7 @@ import { Page } from 'playwright'; import { FtrProviderContext } from '../../ftr_provider_context'; import { StepCtx } from '../../services/performance'; -export default function ecommerceDashboard({ getService }: FtrProviderContext) { +export default function ({ getService }: FtrProviderContext) { describe('ecommerce_dashboard', () => { it('ecommerce_dashboard', async () => { const performance = getService('performance'); diff --git a/x-pack/test/performance/journeys/flight_dashboard/flight_dashboard.ts b/x-pack/test/performance/journeys/flight_dashboard/flight_dashboard.ts index 4844265018a05..344ae13511917 100644 --- a/x-pack/test/performance/journeys/flight_dashboard/flight_dashboard.ts +++ b/x-pack/test/performance/journeys/flight_dashboard/flight_dashboard.ts @@ -7,7 +7,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; import { StepCtx } from '../../services/performance'; -export default function flightDashboard({ getService }: FtrProviderContext) { +export default function ({ getService }: FtrProviderContext) { describe('flight_dashboard', () => { it('flight_dashboard', async () => { const performance = getService('performance'); diff --git a/x-pack/test/performance/journeys/login/login.ts b/x-pack/test/performance/journeys/login/login.ts index 62bb4e512beda..f1fd17174322f 100644 --- a/x-pack/test/performance/journeys/login/login.ts +++ b/x-pack/test/performance/journeys/login/login.ts @@ -7,7 +7,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; import { StepCtx } from '../../services/performance'; -export default function login({ getService }: FtrProviderContext) { +export default function ({ getService }: FtrProviderContext) { describe('login', () => { it('login', async () => { const inputDelays = getService('inputDelays'); diff --git a/x-pack/test/performance/journeys/many_fields_discover/config.ts b/x-pack/test/performance/journeys/many_fields_discover/config.ts index 28fc3b74b3574..85e4b26a18b9c 100644 --- a/x-pack/test/performance/journeys/many_fields_discover/config.ts +++ b/x-pack/test/performance/journeys/many_fields_discover/config.ts @@ -7,7 +7,7 @@ import { FtrConfigProviderContext } from '@kbn/test'; import { serializeApmGlobalLabels } from '../../utils'; -export default async function manyFieldsDiscover({ readConfigFile }: FtrConfigProviderContext) { +export default async function ({ readConfigFile }: FtrConfigProviderContext) { const performanceConfig = await readConfigFile(require.resolve('../base.config')); const testFiles = [require.resolve('./many_fields_discover')]; diff --git a/x-pack/test/performance/journeys/many_fields_discover/many_fields_discover.ts b/x-pack/test/performance/journeys/many_fields_discover/many_fields_discover.ts index 0e66b63bb5794..381f0b4e46003 100644 --- a/x-pack/test/performance/journeys/many_fields_discover/many_fields_discover.ts +++ b/x-pack/test/performance/journeys/many_fields_discover/many_fields_discover.ts @@ -7,7 +7,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; import { StepCtx } from '../../services/performance'; -export default function manyFieldsDiscover({ getService }: FtrProviderContext) { +export default function ({ getService }: FtrProviderContext) { // FAILING: https://github.com/elastic/kibana/issues/130287 describe.skip('many_fields_discover', () => { const performance = getService('performance'); diff --git a/x-pack/test/performance/journeys/promotion_tracking_dashboard/config.ts b/x-pack/test/performance/journeys/promotion_tracking_dashboard/config.ts index 49fa459c1a917..fb8d500aa7c09 100644 --- a/x-pack/test/performance/journeys/promotion_tracking_dashboard/config.ts +++ b/x-pack/test/performance/journeys/promotion_tracking_dashboard/config.ts @@ -7,7 +7,7 @@ import { FtrConfigProviderContext } from '@kbn/test'; import { serializeApmGlobalLabels } from '../../utils'; -export default async function ({ readConfigFile, log }: FtrConfigProviderContext) { +export default async function ({ readConfigFile }: FtrConfigProviderContext) { const performanceConfig = await readConfigFile(require.resolve('../base.config')); const testFiles = [require.resolve('./promotion_tracking_dashboard')]; diff --git a/x-pack/test/performance/journeys/promotion_tracking_dashboard/promotion_tracking_dashboard.ts b/x-pack/test/performance/journeys/promotion_tracking_dashboard/promotion_tracking_dashboard.ts index cb0fb09aafefa..7c44573962a1e 100644 --- a/x-pack/test/performance/journeys/promotion_tracking_dashboard/promotion_tracking_dashboard.ts +++ b/x-pack/test/performance/journeys/promotion_tracking_dashboard/promotion_tracking_dashboard.ts @@ -7,7 +7,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; import { StepCtx } from '../../services/performance'; -export default function promotionTrackingDashboard({ getService }: FtrProviderContext) { +export default function ({ getService }: FtrProviderContext) { describe('promotion_tracking_dashboard', () => { const performance = getService('performance'); const esArchiver = getService('esArchiver'); diff --git a/x-pack/test/performance/journeys/web_logs_dashboard/web_logs_dashboard.ts b/x-pack/test/performance/journeys/web_logs_dashboard/web_logs_dashboard.ts index a2e36947580b3..6cb7b05df14d4 100644 --- a/x-pack/test/performance/journeys/web_logs_dashboard/web_logs_dashboard.ts +++ b/x-pack/test/performance/journeys/web_logs_dashboard/web_logs_dashboard.ts @@ -7,7 +7,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; import { StepCtx } from '../../services/performance'; -export default function weblogsDashboard({ getService }: FtrProviderContext) { +export default function ({ getService }: FtrProviderContext) { describe('weblogs_dashboard', () => { it('weblogs_dashboard', async () => { const performance = getService('performance'); From 0f6c0f0ad7e19fb7ea14bbbb853cb8bcc6fff70b Mon Sep 17 00:00:00 2001 From: Cavit Baturalp Gurdin Date: Tue, 17 May 2022 18:25:01 +0200 Subject: [PATCH 5/6] add cleanup hook to performance service for browser instance cleanup --- x-pack/test/performance/services/performance.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x-pack/test/performance/services/performance.ts b/x-pack/test/performance/services/performance.ts index ffe7211c63153..35db8020309a7 100644 --- a/x-pack/test/performance/services/performance.ts +++ b/x-pack/test/performance/services/performance.ts @@ -37,6 +37,10 @@ export class PerformanceTestingService extends FtrService { constructor(ctx: FtrProviderContext) { super(ctx); + + ctx.getService('lifecycle').cleanup.add(async () => { + await this.shutdownBrowser(); + }); } private getKibanaUrl() { @@ -173,7 +177,7 @@ export class PerformanceTestingService extends FtrService { } } - public async shutdownBrowser() { + private async shutdownBrowser() { if (this.browser) { await (await this.getBrowserInstance()).close(); } From e6948c1e30c02afe93c05a74ad29fede1d049cd6 Mon Sep 17 00:00:00 2001 From: spalger Date: Tue, 31 May 2022 10:42:35 -0500 Subject: [PATCH 6/6] only enable APM in performance configs when TEST_PERFORMANCE_PHASE is set --- .buildkite/scripts/steps/functional/performance_playwright.sh | 2 -- x-pack/test/performance/journeys/base.config.ts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.buildkite/scripts/steps/functional/performance_playwright.sh b/.buildkite/scripts/steps/functional/performance_playwright.sh index b6ffcd9679c30..e4553fcf09ca1 100644 --- a/.buildkite/scripts/steps/functional/performance_playwright.sh +++ b/.buildkite/scripts/steps/functional/performance_playwright.sh @@ -24,7 +24,6 @@ for i in "${journeys[@]}"; do echo "JOURNEY[${i}] is running" export TEST_PERFORMANCE_PHASE=WARMUP - export ELASTIC_APM_ACTIVE=false export JOURNEY_NAME="${i}" checks-reporter-with-killswitch "Run Performance Tests with Playwright Config (Journey:${i},Phase: WARMUP)" \ @@ -35,7 +34,6 @@ for i in "${journeys[@]}"; do --bail export TEST_PERFORMANCE_PHASE=TEST - export ELASTIC_APM_ACTIVE=true checks-reporter-with-killswitch "Run Performance Tests with Playwright Config (Journey:${i},Phase: TEST)" \ node scripts/functional_tests \ diff --git a/x-pack/test/performance/journeys/base.config.ts b/x-pack/test/performance/journeys/base.config.ts index c21e69728f63d..ea91aa2e6b197 100644 --- a/x-pack/test/performance/journeys/base.config.ts +++ b/x-pack/test/performance/journeys/base.config.ts @@ -38,7 +38,7 @@ export default async function ({ readConfigFile, log }: FtrConfigProviderContext ...functionalConfig.get('kbnTestServer'), serverArgs: [...functionalConfig.get('kbnTestServer.serverArgs')], env: { - ELASTIC_APM_ACTIVE: process.env.ELASTIC_APM_ACTIVE, + ELASTIC_APM_ACTIVE: process.env.TEST_PERFORMANCE_PHASE ? 'true' : 'false', ELASTIC_APM_CONTEXT_PROPAGATION_ONLY: 'false', ELASTIC_APM_ENVIRONMENT: process.env.CI ? 'ci' : 'development', ELASTIC_APM_TRANSACTION_SAMPLE_RATE: '1.0',