From a74084da7dee9fbbbaca0a5c5cf6b5bc4e0e802d Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 7 Mar 2023 08:30:23 -0500 Subject: [PATCH] [8.7] [performance] use journey own ftr config to run scalability test (#152596) (#152806) # Backport This will backport the following commits from `main` to `8.7`: - [[performance] use journey own ftr config to run scalability test (#152596)](https://github.com/elastic/kibana/pull/152596) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Dzmitry Lemechko --- .../kbn-performance-testing-dataset-extractor/src/cli.ts | 1 + .../src/extractor.ts | 5 ++++- .../kbn-performance-testing-dataset-extractor/src/types.ts | 1 + x-pack/test/scalability/config.ts | 5 ++--- x-pack/test/scalability/types.ts | 1 + 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/kbn-performance-testing-dataset-extractor/src/cli.ts b/packages/kbn-performance-testing-dataset-extractor/src/cli.ts index f2e88addd63fe..2721147580ae7 100644 --- a/packages/kbn-performance-testing-dataset-extractor/src/cli.ts +++ b/packages/kbn-performance-testing-dataset-extractor/src/cli.ts @@ -77,6 +77,7 @@ export async function runExtractor() { return extractor({ param: { journeyName: journey.config.getName(), + configPath, scalabilitySetup, testData, buildId, diff --git a/packages/kbn-performance-testing-dataset-extractor/src/extractor.ts b/packages/kbn-performance-testing-dataset-extractor/src/extractor.ts index e53bc45a17f1b..168a66e87c046 100644 --- a/packages/kbn-performance-testing-dataset-extractor/src/extractor.ts +++ b/packages/kbn-performance-testing-dataset-extractor/src/extractor.ts @@ -42,7 +42,8 @@ export const extractor = async ({ param, client, log }: CLIParams) => { username: client.username, password: client.password, }; - const { journeyName, scalabilitySetup, testData, buildId, withoutStaticResources } = param; + const { journeyName, configPath, scalabilitySetup, testData, buildId, withoutStaticResources } = + param; log.info( `Searching transactions with 'labels.testBuildId=${buildId}' and 'labels.journeyName=${journeyName}'` ); @@ -87,6 +88,7 @@ export const extractor = async ({ param, client, log }: CLIParams) => { await saveFile( { journeyName, + configPath, kibanaVersion, scalabilitySetup, testData, @@ -101,6 +103,7 @@ export const extractor = async ({ param, client, log }: CLIParams) => { await saveFile( { journeyName, + configPath, kibanaVersion, testData, streams: esStreams, diff --git a/packages/kbn-performance-testing-dataset-extractor/src/types.ts b/packages/kbn-performance-testing-dataset-extractor/src/types.ts index 3b7eb1a356adf..080678f0fe715 100644 --- a/packages/kbn-performance-testing-dataset-extractor/src/types.ts +++ b/packages/kbn-performance-testing-dataset-extractor/src/types.ts @@ -40,6 +40,7 @@ export interface TestData { export interface CLIParams { param: { journeyName: string; + configPath: string; scalabilitySetup?: ScalabilitySetup; testData: TestData; buildId: string; diff --git a/x-pack/test/scalability/config.ts b/x-pack/test/scalability/config.ts index 5c637bdfe9d7b..86619232c0dc2 100644 --- a/x-pack/test/scalability/config.ts +++ b/x-pack/test/scalability/config.ts @@ -42,10 +42,9 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { } const journey: ScalabilityJourney = JSON.parse(fs.readFileSync(scalabilityJsonPath, 'utf8')); + const configPath = journey.configPath ?? 'x-pack/performance/journeys/login.ts'; - const baseConfig = ( - await readConfigFile(require.resolve('../../performance/journeys/login.ts')) - ).getAll(); + const baseConfig = (await readConfigFile(path.resolve(REPO_ROOT, configPath))).getAll(); return { ...baseConfig, diff --git a/x-pack/test/scalability/types.ts b/x-pack/test/scalability/types.ts index 1b57ad519a8a4..e55f02e56a89b 100644 --- a/x-pack/test/scalability/types.ts +++ b/x-pack/test/scalability/types.ts @@ -9,6 +9,7 @@ import { ScalabilitySetup } from '@kbn/journeys'; export interface ScalabilityJourney { journeyName: string; + configPath?: string; scalabilitySetup: ScalabilitySetup; testData?: { esArchives: string[];