[performance] use journey own ftr config to run scalability test (#152596)

While debugging scalability testing failure for
`cloud_security_dashboard` journey, I found that we hardcoded base FTR
config to `x-pack/performance/journeys/login.ts` and main issue is that
Kibana is not started properly.

This PR makes few changes:
- update `kbn-performance-testing-dataset-extractor` to save journey
path as `configPath` so it can be later used to start ES/Kibana in the
scalability run with the same configuration it was run for the single
user journey run.
- update scalability entry configuration to read base FTR config from
generated scalability json file (`configPath` property)

How to test:
- make sure to clone the latest
[kibana-load-testing](https://github.com/elastic/kibana-load-testing)
repo and build it `mvn clean test-compile`
- from kibana root directory run any api capacity test
```
node scripts/run_scalability.js --journey-path x-pack/test/scalability/apis/api.core.capabilities.json
```
Expected result: logs should display
```
debg Loading config file from x-pack/performance/journeys/login.ts
```
- download the latest artifacts from
[buildkite](https://buildkite.com/elastic/kibana-performance-data-set-extraction/builds/171#0186a342-9dea-4a9b-bbe4-c96449563269),
find `cloud_security_dashboard-<uuid>.json`
- from kibana root directory run scalability test for
`cloud_security_dashboard` journey
```
node scripts/run_scalability.js --journey-path <path to cloud_security_dashboard-<uuid>.json>
```
Expected result: logs should display 
```
debg Loading config file from x-pack/performance/journeys/cloud_security_dashboard.ts
```

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Dzmitry Lemechko 2023-03-07 13:20:21 +01:00 committed by GitHub
parent 4f5037f985
commit bc44f524ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 4 deletions

View file

@ -77,6 +77,7 @@ export async function runExtractor() {
return extractor({
param: {
journeyName: journey.config.getName(),
configPath,
scalabilitySetup,
testData,
buildId,

View file

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

View file

@ -40,6 +40,7 @@ export interface TestData {
export interface CLIParams {
param: {
journeyName: string;
configPath: string;
scalabilitySetup?: ScalabilitySetup;
testData: TestData;
buildId: string;

View file

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

View file

@ -9,6 +9,7 @@ import { ScalabilitySetup } from '@kbn/journeys';
export interface ScalabilityJourney {
journeyName: string;
configPath?: string;
scalabilitySetup: ScalabilitySetup;
testData?: {
esArchives: string[];