Skip to content

Commit

Permalink
chore(NA): rename journeys folder into journeys_e2e inside x-pack/per…
Browse files Browse the repository at this point in the history
…formance to correctly classify journey e2e files (#178340)

The source code classifier we currently have was incorrectly classifying
e2e journey files as `non-package` instead of `tests or mocks` as it was
not using the name standards we used for FTR files.

We could have created a `functional-tests` package for the performance
folder (which is what we want to do in the future) but because we don't
have the feature to create ownerless packages it would not be easy to
find a given owner for that folder.

As such I'm just opting for a second solution which is applying the same
name standards to this journeys folder as we have for FTR and changing a
little the classifier to recognise it.

This should fix the problem found at
#178017.

Co-authored-by: Alex Szabo <[email protected]>
  • Loading branch information
mistic and delanni authored Mar 14, 2024
1 parent f1d0cd1 commit 3a040a1
Show file tree
Hide file tree
Showing 28 changed files with 31 additions and 30 deletions.
36 changes: 18 additions & 18 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -446,24 +446,24 @@ enabled:
- x-pack/test_serverless/functional/test_suites/security/common_configs/config.group4.ts
- x-pack/test_serverless/functional/test_suites/security/common_configs/config.group5.ts
- x-pack/test_serverless/functional/test_suites/security/common_configs/config.group6.ts
- x-pack/performance/journeys/ecommerce_dashboard.ts
- x-pack/performance/journeys/ecommerce_dashboard_map_only.ts
- x-pack/performance/journeys/flight_dashboard.ts
- x-pack/performance/journeys/login.ts
- x-pack/performance/journeys/many_fields_discover.ts
- x-pack/performance/journeys/many_fields_lens_editor.ts
- x-pack/performance/journeys/many_fields_transform.ts
- x-pack/performance/journeys/tsdb_logs_data_visualizer.ts
- x-pack/performance/journeys/promotion_tracking_dashboard.ts
- x-pack/performance/journeys/web_logs_dashboard.ts
- x-pack/performance/journeys/data_stress_test_lens.ts
- x-pack/performance/journeys/ecommerce_dashboard_saved_search_only.ts
- x-pack/performance/journeys/ecommerce_dashboard_tsvb_gauge_only.ts
- x-pack/performance/journeys/dashboard_listing_page.ts
- x-pack/performance/journeys/tags_listing_page.ts
- x-pack/performance/journeys/cloud_security_dashboard.ts
- x-pack/performance/journeys/apm_service_inventory.ts
- x-pack/performance/journeys/infra_hosts_view.ts
- x-pack/performance/journeys_e2e/ecommerce_dashboard.ts
- x-pack/performance/journeys_e2e/ecommerce_dashboard_map_only.ts
- x-pack/performance/journeys_e2e/flight_dashboard.ts
- x-pack/performance/journeys_e2e/login.ts
- x-pack/performance/journeys_e2e/many_fields_discover.ts
- x-pack/performance/journeys_e2e/many_fields_lens_editor.ts
- x-pack/performance/journeys_e2e/many_fields_transform.ts
- x-pack/performance/journeys_e2e/tsdb_logs_data_visualizer.ts
- x-pack/performance/journeys_e2e/promotion_tracking_dashboard.ts
- x-pack/performance/journeys_e2e/web_logs_dashboard.ts
- x-pack/performance/journeys_e2e/data_stress_test_lens.ts
- x-pack/performance/journeys_e2e/ecommerce_dashboard_saved_search_only.ts
- x-pack/performance/journeys_e2e/ecommerce_dashboard_tsvb_gauge_only.ts
- x-pack/performance/journeys_e2e/dashboard_listing_page.ts
- x-pack/performance/journeys_e2e/tags_listing_page.ts
- x-pack/performance/journeys_e2e/cloud_security_dashboard.ts
- x-pack/performance/journeys_e2e/apm_service_inventory.ts
- x-pack/performance/journeys_e2e/infra_hosts_view.ts
- x-pack/test/custom_branding/config.ts
- x-pack/test/profiling_api_integration/cloud/config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/actions/trial_license_complete_tier/configs/ess.config.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ OUTPUT_DIR="${KIBANA_DIR}/${OUTPUT_REL}"
.buildkite/scripts/bootstrap.sh

echo "--- Extract APM metrics"
for journey in x-pack/performance/journeys/*; do
for journey in x-pack/performance/journeys_e2e/*; do
echo "Looking for journey=${journey} and BUILD_ID=${BUILD_ID} in APM traces"

node scripts/extract_performance_testing_dataset \
Expand Down
4 changes: 2 additions & 2 deletions api_docs/kbn_journeys.devdocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
"tags": [],
"label": "Constructor",
"description": [
"\nCreate a Journey which should be exported from a file in the\nx-pack/performance/journeys directory."
"\nCreate a Journey which should be exported from a file in the\nx-pack/performance/journeys_e2e directory."
],
"signature": [
"any"
Expand Down Expand Up @@ -1409,4 +1409,4 @@
}
]
}
}
}
4 changes: 2 additions & 2 deletions dev_docs/tutorials/performance/adding_performance_journey.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Let's assume we instrumented dashboard with load time metrics and want to track
Journey supports loading test data with esArchiver or kbnArchiver. Similar to functional tests, it might require to implement custom wait
for UI rendering to be completed.

Simply create a new file in `x-pack/performance/journeys` with the following code:
Simply create a new file in `x-pack/performance/journeys_e2e` with the following code:

```
export const journey = new Journey({
Expand Down Expand Up @@ -51,7 +51,7 @@ In oder to get correct and consistent metrics, it is important to design journey

### Running performance journey locally for troubleshooting purposes
Use the Node script:
`node scripts/run_performance.js --journey-path x-pack/performance/journeys/$YOUR_JOURNEY_NAME.ts`
`node scripts/run_performance.js --journey-path x-pack/performance/journeys_e2e/$YOUR_JOURNEY_NAME.ts`

Scripts steps include:
- start Elasticsearch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export TEST_CLOUD=1
Run your journey with the command:

```
node scripts/functional_test_runner.js --config x-pack/performance/journeys/$YOUR_JOURNEY_NAME.ts`
node scripts/functional_test_runner.js --config x-pack/performance/journeys_e2e/$YOUR_JOURNEY_NAME.ts`
```

APM & Telemetry labels will be updated on the fly and metrics/traces should be available in Telemetry Staging and kibana-ops-e2e-perf cluster.
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-journeys/journey/journey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class Journey<CtxExt extends object> {

/**
* Create a Journey which should be exported from a file in the
* x-pack/performance/journeys directory.
* x-pack/performance/journeys_e2e directory.
*/
constructor(opts?: JourneyConfigOptions<CtxExt>) {
const path = callsites().at(1)?.getFileName();
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-repo-source-classifier/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const TEST_DIR = new Set([
'stub',
'e2e',
'ftr_e2e',
'journeys_e2e',
'storybook',
'.storybook',
'integration_tests',
Expand Down
4 changes: 2 additions & 2 deletions src/dev/performance/run_performance_cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ToolingLog } from '@kbn/tooling-log';
import fs from 'fs';
import path from 'path';

const JOURNEY_BASE_PATH = 'x-pack/performance/journeys';
const JOURNEY_BASE_PATH = 'x-pack/performance/journeys_e2e';

export interface Journey {
name: string;
Expand Down Expand Up @@ -126,7 +126,7 @@ run(
if (journeyPath && fs.statSync(journeyPath).isFile()) {
journeys.push({ name: path.parse(journeyPath).name, path: journeyPath });
} else {
// default dir is x-pack/performance/journeys
// default dir is x-pack/performance/journeys_e2e
const dir = journeyPath ?? path.resolve(REPO_ROOT, JOURNEY_BASE_PATH);
readFilesRecursively(dir, (filePath: string) =>
journeys.push({
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions x-pack/plugins/lens/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ Run all tests from the `x-pack` root directory
- Run `node scripts/functional_tests_server`
- Run `node ../scripts/functional_test_runner.js --config ./test/api_integration/config.ts --grep=Lens`
- Performance journeys:
- Run `node scripts/functional_tests_server.js --config x-pack/test/performance/journeys/data_stress_test_lens/config.ts`
- Run `node scripts/functional_test_runner --config x-pack/test/performance/journeys/data_stress_test_lens/config.ts`
- Run `node scripts/functional_tests_server.js --config x-pack/test/performance/journeys_e2e/data_stress_test_lens/config.ts`
- Run `node scripts/functional_test_runner --config x-pack/test/performance/journeys_e2e/data_stress_test_lens/config.ts`

## Developing tips

Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/scalability/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ 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 configPath = journey.configPath ?? 'x-pack/performance/journeys_e2e/login.ts';

const baseConfig = (await readConfigFile(path.resolve(REPO_ROOT, configPath))).getAll();

Expand Down

0 comments on commit 3a040a1

Please sign in to comment.