Skip to content

Commit

Permalink
[performance] use journey own ftr config to run scalability test (#15…
Browse files Browse the repository at this point in the history
…2596)

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 <[email protected]>
  • Loading branch information
dmlemeshko and kibanamachine authored Mar 7, 2023
1 parent 4f5037f commit bc44f52
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export async function runExtractor() {
return extractor({
param: {
journeyName: journey.config.getName(),
configPath,
scalabilitySetup,
testData,
buildId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}'`
);
Expand Down Expand Up @@ -87,6 +88,7 @@ export const extractor = async ({ param, client, log }: CLIParams) => {
await saveFile(
{
journeyName,
configPath,
kibanaVersion,
scalabilitySetup,
testData,
Expand All @@ -101,6 +103,7 @@ export const extractor = async ({ param, client, log }: CLIParams) => {
await saveFile(
{
journeyName,
configPath,
kibanaVersion,
testData,
streams: esStreams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface TestData {
export interface CLIParams {
param: {
journeyName: string;
configPath: string;
scalabilitySetup?: ScalabilitySetup;
testData: TestData;
buildId: string;
Expand Down
5 changes: 2 additions & 3 deletions x-pack/test/scalability/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions x-pack/test/scalability/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ScalabilitySetup } from '@kbn/journeys';

export interface ScalabilityJourney {
journeyName: string;
configPath?: string;
scalabilitySetup: ScalabilitySetup;
testData?: {
esArchives: string[];
Expand Down

0 comments on commit bc44f52

Please sign in to comment.