[ska] [xpack] relocate platform tests (#225223)

## Summary

Part of https://github.com/elastic/kibana-team/issues/1503

This PR is mostly about moving platform tests from x-pack/test/

Before:

```
x-pack/test/
     | - ftr_apis/
     | - load/
     | - plugin_api_perf/
     | - fleet_packages/
     | - fleet_tasks/
     | - scalability/
     | - task_manager_claimer_update_by_query/
```

After: 
```
x-pack/platform/test/
     | - ftr_apis/
     | - load/
     | - plugin_api_perf/
     | - fleet_packages/
     | - fleet_tasks/
     | - scalability/
     | - task_manager_claimer_update_by_query/

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Dzmitry Lemechko 2025-06-25 18:01:04 +03:00 committed by GitHub
parent efedad1b3e
commit 58b8c7aec0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
99 changed files with 107 additions and 84 deletions

View file

@ -30,13 +30,13 @@ disabled:
- x-pack/platform/test/alerting_api_integration/security_and_spaces/group2/tests/telemetry/config.ts
- x-pack/platform/test/alerting_api_integration/spaces_only_legacy/config.ts
- x-pack/test/cloud_integration/config.ts
- x-pack/test/load/config.ts
- x-pack/test/plugin_api_perf/config.js
- x-pack/platform/test/load/config.ts
- x-pack/platform/test/plugin_api_perf/config.ts
- x-pack/test/screenshot_creation/config.ts
- x-pack/test/fleet_packages/config.ts
- x-pack/platform/test/fleet_packages/config.ts
# Scalability testing config that we run in its own pipeline
- x-pack/test/scalability/config.ts
- x-pack/platform/test/scalability/config.ts
# Cypress configs, for now these are still run manually
- x-pack/test/fleet_cypress/cli_config.ts
@ -173,8 +173,8 @@ enabled:
- x-pack/test/fleet_api_integration/config.package_policy.ts
- x-pack/test/fleet_api_integration/config.space_awareness.ts
- x-pack/test/fleet_functional/config.ts
- x-pack/test/fleet_tasks/config.ts
- x-pack/test/ftr_apis/security_and_spaces/config.ts
- x-pack/platform/test/fleet_tasks/config.ts
- x-pack/platform/test/ftr_apis/security_and_spaces/config.ts
- x-pack/test/functional_basic/apps/ml/permissions/config.ts
- x-pack/test/functional_basic/apps/ml/data_visualizer/group1/config.ts
- x-pack/test/functional_basic/apps/ml/data_visualizer/group2/config.ts
@ -330,7 +330,7 @@ enabled:
- x-pack/test/spaces_api_integration/security_and_spaces/config_basic.ts
- x-pack/test/spaces_api_integration/security_and_spaces/config_trial.ts
- x-pack/test/spaces_api_integration/spaces_only/config.ts
- x-pack/test/task_manager_claimer_update_by_query/config.ts
- x-pack/platform/test/task_manager_claimer_update_by_query/config.ts
- x-pack/test/ui_capabilities/security_and_spaces/config.ts
- x-pack/test/ui_capabilities/spaces_only/config.ts
- x-pack/test/upgrade_assistant_integration/config.ts

View file

@ -9,4 +9,4 @@ echo '--- Installing all packages'
node scripts/functional_tests \
--debug \
--bail \
--config x-pack/test/fleet_packages/config.ts
--config x-pack/platform/test/fleet_packages/config.ts

View file

@ -22,7 +22,7 @@ checkout_and_compile_load_runner
echo "--- Run single apis capacity tests"
cd "$KIBANA_DIR"
node scripts/run_scalability --kibana-install-dir "$KIBANA_BUILD_LOCATION" --journey-path "x-pack/test/scalability/apis"
node scripts/run_scalability --kibana-install-dir "$KIBANA_BUILD_LOCATION" --journey-path "x-pack/platform/test/scalability/apis"
echo "--- Upload test results"
upload_test_results

27
.github/CODEOWNERS vendored
View file

@ -982,7 +982,9 @@ x-pack/platform/test/plugin_api_integration/plugins/elasticsearch_client @elasti
x-pack/platform/test/plugin_api_integration/plugins/event_log @elastic/response-ops
x-pack/platform/test/plugin_api_integration/plugins/feature_usage_test @elastic/kibana-security
x-pack/platform/test/plugin_api_integration/plugins/sample_task_plugin @elastic/response-ops
x-pack/platform/test/plugin_api_perf/plugins/task_manager_performance @elastic/response-ops
x-pack/platform/test/saved_object_api_integration/common/plugins/saved_object_test_plugin @elastic/kibana-security
x-pack/platform/test/task_manager_claimer_update_by_query/plugins/sample_task_plugin_mget @elastic/response-ops
x-pack/solutions/chat/packages/wc-framework-types-browser @elastic/search-kibana @elastic/workchat-eng
x-pack/solutions/chat/packages/wc-framework-types-common @elastic/search-kibana @elastic/workchat-eng
x-pack/solutions/chat/packages/wc-framework-types-server @elastic/search-kibana @elastic/workchat-eng
@ -1103,7 +1105,6 @@ x-pack/test/functional_execution_context/plugins/alerts @elastic/kibana-core
x-pack/test/functional_with_es_ssl/plugins/alerts @elastic/response-ops
x-pack/test/functional_with_es_ssl/plugins/cases @elastic/response-ops
x-pack/test/licensing_plugin/plugins/test_feature_usage @elastic/kibana-security
x-pack/test/plugin_api_perf/plugins/task_manager_performance @elastic/response-ops
x-pack/test/plugin_functional/plugins/global_search_test @elastic/kibana-core
x-pack/test/plugin_functional/plugins/resolver_test @elastic/security-solution
x-pack/test/security_api_integration/packages/helpers @elastic/kibana-security
@ -1114,7 +1115,6 @@ x-pack/test/security_api_integration/plugins/saml_provider @elastic/kibana-secur
x-pack/test/security_api_integration/plugins/user_profiles_consumer @elastic/kibana-security
x-pack/test/security_functional/plugins/test_endpoints @elastic/kibana-security
x-pack/test/spaces_api_integration/common/plugins/spaces_test_plugin @elastic/kibana-security
x-pack/test/task_manager_claimer_update_by_query/plugins/sample_task_plugin_mget @elastic/response-ops
x-pack/test/ui_capabilities/common/plugins/foo_plugin @elastic/kibana-security
x-pack/test/usage_collection/plugins/application_usage_test @elastic/kibana-core
x-pack/test/usage_collection/plugins/stack_management_usage_test @elastic/kibana-management
@ -1477,8 +1477,8 @@ src/platform/plugins/shared/discover/public/context_awareness/profile_providers/
/x-pack/test/functional/es_archives/fleet @elastic/fleet
/x-pack/test/api_integration/services/fleet_and_agents.ts @elastic/fleet
/x-pack/test/fleet_api_integration @elastic/fleet
/x-pack/test/fleet_packages @elastic/fleet
/x-pack/test/fleet_tasks @elastic/fleet
/x-pack/platform/test/fleet_packages @elastic/fleet
/x-pack/platform/test/fleet_tasks @elastic/fleet
/src/platform/test/api_integration/apis/custom_integration/*.ts @elastic/fleet
/x-pack/test/fleet_cypress @elastic/fleet
/x-pack/test/fleet_functional @elastic/fleet
@ -1696,6 +1696,7 @@ x-pack/platform/plugins/shared/ml/server/models/data_recognizer/modules/security
# QA - Appex QA
.buildkite/scout_ci_config.yml @elastic/appex-qa
/x-pack/test/.gitignore @elastic/appex-qa
/x-pack/platform/test/index.d.ts @elastic/appex-qa
/src/platform/packages/shared/kbn-es/src/serverless_resources/project_roles/es/roles.yml @elastic/appex-qa
/src/platform/packages/shared/kbn-es/src/serverless_resources/project_roles/oblt/roles.yml @elastic/appex-qa
/src/platform/packages/shared/kbn-es/src/serverless_resources/project_roles/security/roles.yml @elastic/appex-qa
@ -1766,7 +1767,7 @@ x-pack/platform/plugins/shared/ml/server/models/data_recognizer/modules/security
/x-pack/platform/test/api_integration/services @elastic/appex-qa
/x-pack/platform/test/api_integration/apis/kibana/config.ts @elastic/appex-qa
/x-pack/test/tsconfig.json @elastic/appex-qa
/x-pack/test/load @elastic/appex-qa
/x-pack/platform/test/load @elastic/appex-qa
/src/platform/test/tsconfig.json @elastic/appex-qa
/src/platform/test/plugin_functional/services/index.ts @elastic/appex-qa
/src/platform/test/plugin_functional/README.md @elastic/appex-qa
@ -1818,7 +1819,7 @@ x-pack/platform/plugins/shared/ml/server/models/data_recognizer/modules/security
/src/platform/test/accessibility/ftr_provider_context.ts @elastic/appex-qa
/src/platform/test/accessibility/config.ts @elastic/appex-qa
/src/platform/test/accessibility/apps/index.ts @elastic/appex-qa
/x-pack/test/scalability @elastic/appex-qa
/x-pack/platform/test/scalability @elastic/appex-qa
/src/dev/performance @elastic/appex-qa
/x-pack/test/functional/config.*.* @elastic/appex-qa
/x-pack/platform/test/functional/config.*.* @elastic/appex-qa
@ -2017,9 +2018,9 @@ x-pack/platform/plugins/private/cloud_integrations/cloud_full_story/server/confi
/x-pack/test/functional/es_archives/security @elastic/kibana-security
/x-pack/test/functional/fixtures/kbn_archiver/spaces @elastic/kibana-security
/x-pack/test/functional/fixtures/kbn_archiver/security @elastic/kibana-security
/x-pack/test/ftr_apis/common/lib @elastic/kibana-security
/x-pack/test/ftr_apis/common/fixtures/es_archiver/base_data/space_1.json @elastic/kibana-security # Assigned per only use: https://github.com/elastic/kibana/blob/main/x-pack/test/ftr_apis/security_and_spaces/apis/test_utils.ts#L33
/x-pack/test/ftr_apis/common/fixtures/es_archiver/base_data/default_space.json @elastic/kibana-security # Assigned per only use: https://github.com/elastic/kibana/blob/main/x-pack/test/ftr_apis/security_and_spaces/apis/test_utils.ts#L33
/x-pack/platform/test/ftr_apis/common/lib @elastic/kibana-security
/x-pack/platform/test/ftr_apis/common/fixtures/es_archiver/base_data/space_1.json @elastic/kibana-security # Assigned per only use: https://github.com/elastic/kibana/blob/main/x-pack/platform/test/ftr_apis/security_and_spaces/apis/test_utils.ts#L33
/x-pack/platform/test/ftr_apis/common/fixtures/es_archiver/base_data/default_space.json @elastic/kibana-security # Assigned per only use: https://github.com/elastic/kibana/blob/main/x-pack/platform/test/ftr_apis/security_and_spaces/apis/test_utils.ts#L33
/x-pack/platform/test/api_integration/apis/cloud @elastic/kibana-security # Assigned per https://github.com/elastic/kibana/pull/198444
/src/platform/test/plugin_functional/snapshots/baseline/hardening @elastic/kibana-security # Assigned per https://github.com/elastic/kibana/pull/190716
/src/platform/test/functional/page_objects/login_page.ts @elastic/kibana-security
@ -2036,7 +2037,7 @@ x-pack/platform/plugins/private/cloud_integrations/cloud_full_story/server/confi
/x-pack/test/common/services/spaces.ts @elastic/kibana-security
/x-pack/test/api_integration/config_security_*.ts @elastic/kibana-security
/x-pack/test/functional/apps/api_keys @elastic/kibana-security
/x-pack/test/ftr_apis/security_and_spaces @elastic/kibana-security
/x-pack/platform/test/ftr_apis/security_and_spaces @elastic/kibana-security
/src/platform/test/server_integration/services/supertest.js @elastic/kibana-security @elastic/kibana-core
/src/platform/test/server_integration/http/ssl @elastic/kibana-security # Assigned per https://github.com/elastic/kibana/pull/53810
/src/platform/test/server_integration/http/ssl_with_p12 @elastic/kibana-security # Assigned per https://github.com/elastic/kibana/pull/199795#discussion_r1846522206
@ -2096,8 +2097,8 @@ x-pack/platform/plugins/private/cloud_integrations/cloud_full_story/server/confi
# Response Ops team
/x-pack/test/functional/es_archives/rule_registry @elastic/response-ops
/x-pack/test/functional/es_archives/event_log_multiple_indicies @elastic/response-ops
/x-pack/test/functional/es_archives/task_manager* @elastic/response-ops # Assigned per https://github.com/elastic/kibana/blob/assign-response-ops/x-pack/test/plugin_api_perf/plugins/task_manager_performance/kibana.jsonc#L4
/x-pack/test/plugin_api_perf @elastic/response-ops # Assigned per https://github.com/elastic/kibana/blob/assign-response-ops/x-pack/test/plugin_api_perf/plugins/task_manager_performance/kibana.jsonc#L4
/x-pack/test/functional/es_archives/task_manager* @elastic/response-ops # Assigned per https://github.com/elastic/kibana/blob/assign-response-ops/x-pack/platform/test/plugin_api_perf/plugins/task_manager_performance/kibana.jsonc#L4
/x-pack/platform/test/plugin_api_perf @elastic/response-ops # Assigned per https://github.com/elastic/kibana/blob/assign-response-ops/x-pack/platform/test/plugin_api_perf/plugins/task_manager_performance/kibana.jsonc#L4
/x-pack/test/functional/page_objects/maintenance_windows_page.ts @elastic/response-ops
/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/index.ts @elastic/response-ops
/x-pack/test_serverless/functional/test_suites/observability/rules/rules_list.ts @elastic/response-ops
@ -2132,7 +2133,7 @@ x-pack/platform/plugins/private/cloud_integrations/cloud_full_story/server/confi
/x-pack/platform/test/plugin_api_integration/test_suites/task_manager/ @elastic/response-ops
/x-pack/test/functional_with_es_ssl/apps/embeddable_alerts_table/ @elastic/response-ops
/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/ @elastic/response-ops
/x-pack/test/task_manager_claimer_update_by_query/ @elastic/response-ops
/x-pack/platform/test/task_manager_claimer_update_by_query/ @elastic/response-ops
/docs/user/alerting/ @elastic/response-ops
/docs/management/connectors/ @elastic/response-ops
/x-pack/test/cases_api_integration/ @elastic/response-ops

View file

@ -8,6 +8,7 @@ tags: ['kibana', 'onboarding', 'setup', 'performance', 'development', 'telemetry
---
## Overview
It is important to test individual API endpoint for the baseline performance, scalability, or breaking point. If an API doesnt meet performance requirements, it is a bottleneck.
This capacity tests track how response time changes while we slowly increase number of concurrent requests per second.
While using similar load model, we are able to identify how many requests per second each endpoint can hold with response time staying below critical threshold.
@ -15,6 +16,7 @@ While using similar load model, we are able to identify how many requests per se
Capacity API test defines 3 response time thresholds (default ones: 3000, 6000, 12000) in ms. Test results report rps (requests per second) for each threshold.
Test results are reported using EBT in the following format:
```json
{
"_index": "backing-kibana-server-scalability-metrics-000003",
@ -37,7 +39,9 @@ Test results are reported using EBT in the following format:
```
### Adding a new test
Create a new json file in `x-pack/test/scalability/apis` with required properties:
Create a new json file in `x-pack/platform/test/scalability/apis` with required properties:
- **journeyName** is a test name, e.g. `GET /internal/security/session`
- **scalabilitySetup** is used to set load model
- **testData** is used to populate Elasticsearch and Kibana wth test data
@ -47,10 +51,12 @@ Create a new json file in `x-pack/test/scalability/apis` with required propertie
Warmup phase simulates 10 concurrent requests during 30s period and is important to get consistent results in test phase.
Test phase simulates increasing concurrent requests from `minUsersCount` to `maxUsersCount` within `duration` time.
Both `maxUsersCount` and `duration` in test phase should be adjusted for individual endpoint:
- `maxUsersCount` should be reasonable and enough to reach endpoint limits
- `duration` should be long enough to ramp up requests with low pace (1-2 requests per second)
Example:
```json
{
"journeyName": "GET /internal/security/session",
@ -99,6 +105,7 @@ Example:
```
Override default response time thresholds by adding to `scalabilitySetup`:
```json
"responseTimeThreshold": {
"threshold1": 1000,
@ -108,14 +115,16 @@ Override default response time thresholds by adding to `scalabilitySetup`:
```
### Running api capacity journey locally
Clone [kibana-load-testing](https://github.com/elastic/kibana-load-testing) repo.
Use the Node script from kibana root directory:
`node scripts/run_scalability_cli.js --journey-path x-pack/test/scalability/apis/$YOUR_JOURNEY_NAME.ts`
`node scripts/run_scalability_cli.js --journey-path x-pack/platform/test/scalability/apis/$YOUR_JOURNEY_NAME.ts`
Use `--kibana-install-dir` flag to test build
### Benchmarking performance on CI
In order to keep track on performance metrics stability, api capacity tests are run on main branch with a scheduled interval.
Bare metal machine is used to produce results as stable and reproducible as possible.
@ -128,6 +137,7 @@ RAM: 128 GB
SSD: 1.92 TB Data center Gen4 NVMe
#### Track performance results
APM metrics are reported to [kibana-stats](https://kibana-stats.elastic.dev/) cluster.
You can filter transactions using labels, e.g. `labels.journeyName : "GET /internal/security/session"`

View file

@ -818,7 +818,7 @@
"@kbn/safer-lodash-set": "link:src/platform/packages/shared/kbn-safer-lodash-set",
"@kbn/saml-provider-plugin": "link:x-pack/test/security_api_integration/plugins/saml_provider",
"@kbn/sample-task-plugin": "link:x-pack/platform/test/plugin_api_integration/plugins/sample_task_plugin",
"@kbn/sample-task-plugin-update-by-query": "link:x-pack/test/task_manager_claimer_update_by_query/plugins/sample_task_plugin_mget",
"@kbn/sample-task-plugin-update-by-query": "link:x-pack/platform/test/task_manager_claimer_update_by_query/plugins/sample_task_plugin_mget",
"@kbn/saved-object-export-transforms-plugin": "link:src/platform/test/plugin_functional/plugins/saved_object_export_transforms",
"@kbn/saved-object-import-warnings-plugin": "link:src/platform/test/plugin_functional/plugins/saved_object_import_warnings",
"@kbn/saved-object-test-plugin": "link:x-pack/platform/test/saved_object_api_integration/common/plugins/saved_object_test_plugin",
@ -983,7 +983,7 @@
"@kbn/synthetics-plugin": "link:x-pack/solutions/observability/plugins/synthetics",
"@kbn/task-manager-dependencies-plugin": "link:x-pack/platform/plugins/private/task_manager_dependencies",
"@kbn/task-manager-fixture-plugin": "link:x-pack/platform/test/alerting_api_integration/common/plugins/task_manager_fixture",
"@kbn/task-manager-performance-plugin": "link:x-pack/test/plugin_api_perf/plugins/task_manager_performance",
"@kbn/task-manager-performance-plugin": "link:x-pack/platform/test/plugin_api_perf/plugins/task_manager_performance",
"@kbn/task-manager-plugin": "link:x-pack/platform/plugins/shared/task_manager",
"@kbn/telemetry": "link:src/platform/packages/shared/kbn-telemetry",
"@kbn/telemetry-collection-manager-plugin": "link:src/platform/plugins/shared/telemetry_collection_manager",

View file

@ -41,7 +41,7 @@ run(
})
: [{ name: path.parse(journeyPath).name, path: journeyPath }];
const skippedFilePath = 'x-pack/test/scalability/disabled_scalability_tests.json';
const skippedFilePath = 'x-pack/platform/test/scalability/disabled_scalability_tests.json';
const skipped: string[] = JSON.parse(
fs.readFileSync(path.resolve(REPO_ROOT, skippedFilePath), 'utf8')
).map((relativePath: string) => path.resolve(REPO_ROOT, relativePath));
@ -89,7 +89,7 @@ run(
cmd: 'node',
args: [
'scripts/functional_tests',
['--config', 'x-pack/test/scalability/config.ts'],
['--config', 'x-pack/platform/test/scalability/config.ts'],
kibanaBuildDir ? ['--kibana-install-dir', kibanaBuildDir] : [],
'--debug',
'--logToFile',

View file

@ -1604,8 +1604,8 @@
"@kbn/sample-log-parser/*": ["x-pack/platform/packages/shared/kbn-sample-parser/*"],
"@kbn/sample-task-plugin": ["x-pack/platform/test/plugin_api_integration/plugins/sample_task_plugin"],
"@kbn/sample-task-plugin/*": ["x-pack/platform/test/plugin_api_integration/plugins/sample_task_plugin/*"],
"@kbn/sample-task-plugin-update-by-query": ["x-pack/test/task_manager_claimer_update_by_query/plugins/sample_task_plugin_mget"],
"@kbn/sample-task-plugin-update-by-query/*": ["x-pack/test/task_manager_claimer_update_by_query/plugins/sample_task_plugin_mget/*"],
"@kbn/sample-task-plugin-update-by-query": ["x-pack/platform/test/task_manager_claimer_update_by_query/plugins/sample_task_plugin_mget"],
"@kbn/sample-task-plugin-update-by-query/*": ["x-pack/platform/test/task_manager_claimer_update_by_query/plugins/sample_task_plugin_mget/*"],
"@kbn/saved-object-export-transforms-plugin": ["src/platform/test/plugin_functional/plugins/saved_object_export_transforms"],
"@kbn/saved-object-export-transforms-plugin/*": ["src/platform/test/plugin_functional/plugins/saved_object_export_transforms/*"],
"@kbn/saved-object-import-warnings-plugin": ["src/platform/test/plugin_functional/plugins/saved_object_import_warnings"],
@ -1992,8 +1992,8 @@
"@kbn/task-manager-dependencies-plugin/*": ["x-pack/platform/plugins/private/task_manager_dependencies/*"],
"@kbn/task-manager-fixture-plugin": ["x-pack/platform/test/alerting_api_integration/common/plugins/task_manager_fixture"],
"@kbn/task-manager-fixture-plugin/*": ["x-pack/platform/test/alerting_api_integration/common/plugins/task_manager_fixture/*"],
"@kbn/task-manager-performance-plugin": ["x-pack/test/plugin_api_perf/plugins/task_manager_performance"],
"@kbn/task-manager-performance-plugin/*": ["x-pack/test/plugin_api_perf/plugins/task_manager_performance/*"],
"@kbn/task-manager-performance-plugin": ["x-pack/platform/test/plugin_api_perf/plugins/task_manager_performance"],
"@kbn/task-manager-performance-plugin/*": ["x-pack/platform/test/plugin_api_perf/plugins/task_manager_performance/*"],
"@kbn/task-manager-plugin": ["x-pack/platform/plugins/shared/task_manager"],
"@kbn/task-manager-plugin/*": ["x-pack/platform/plugins/shared/task_manager/*"],
"@kbn/telemetry": ["src/platform/packages/shared/kbn-telemetry"],

View file

@ -30,10 +30,10 @@ export const deleteTestSpaces = async ({ getService }: FtrProviderContext) => {
export const createData = async ({ getService }: FtrProviderContext) => {
const kibanaServer = getService('kibanaServer');
await kibanaServer.importExport.load(
'x-pack/test/ftr_apis/common/fixtures/es_archiver/base_data/default_space.json'
'x-pack/platform/test/ftr_apis/common/fixtures/es_archiver/base_data/default_space.json'
);
await kibanaServer.importExport.load(
'x-pack/test/ftr_apis/common/fixtures/es_archiver/base_data/space_1.json',
'x-pack/platform/test/ftr_apis/common/fixtures/es_archiver/base_data/space_1.json',
{ space: 'space_1' }
);
};
@ -41,10 +41,10 @@ export const createData = async ({ getService }: FtrProviderContext) => {
export const deleteData = async ({ getService }: FtrProviderContext) => {
const kibanaServer = getService('kibanaServer');
await kibanaServer.importExport.unload(
'x-pack/test/ftr_apis/common/fixtures/es_archiver/base_data/default_space.json'
'x-pack/platform/test/ftr_apis/common/fixtures/es_archiver/base_data/default_space.json'
);
await kibanaServer.importExport.unload(
'x-pack/test/ftr_apis/common/fixtures/es_archiver/base_data/space_1.json',
'x-pack/platform/test/ftr_apis/common/fixtures/es_archiver/base_data/space_1.json',
{ space: 'space_1' }
);
};

10
x-pack/platform/test/index.d.ts vendored Normal file
View file

@ -0,0 +1,10 @@
/*
* 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.
*/
declare module '@kbn/repo-info' {
export const REPO_ROOT: string;
}

View file

@ -24,7 +24,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
require.resolve('@kbn/test-suites-src/common/config')
);
const xpackFunctionalTestsConfig = await readConfigFile(
require.resolve('../functional/config.base.js')
require.resolve('../functional/config.base.ts')
);
return {

View file

@ -22,8 +22,8 @@ In the `./test_suites/task_manager/task_manager_perf_integration.ts` file you se
### running
1. Enable the test in `./test_suites/task_manager/index.ts` by removing the `.skip` from the `describe.skip`.
1. Run the test server from within the `x-pack` folder: `node scripts/functional_tests_server.js --config=test/plugin_api_perf/config.js`
1. Run the test runner from within the `x-pack` folder: `node scripts/functional_test_runner.js --config=test/plugin_api_perf/config.js`
1. Run the test server from within the `x-pack` folder: `node scripts/functional_tests_server.js --config=platform/test/plugin_api_perf/config.js`
1. Run the test runner from within the `x-pack` folder: `node scripts/functional_test_runner.js --config=platform/test/plugin_api_perf/config.js`
## The Results
After the test runs you should get the following output:
@ -68,10 +68,10 @@ Ideally we can clean this up and make it easier and less hacky in the future, bu
## Method
1. You need two cloned repos of Kibana, so clone a second Kibana of your personal form along side your existing clone. Personally I have two co-located Kibana folders (`./elastic/kibana` and `./elastic/_kibana`, where the first is my working clone and the other is never used for actual dev work, but that's just me -GM).
1. You can run the FTS in the main clone of your fork by running `node scripts/functional_tests_server.js --config=test/plugin_api_perf/config.js` in the `x-pack` folder.
1. You can run the FTS in the main clone of your fork by running `node scripts/functional_tests_server.js --config=platform/test/plugin_api_perf/config.js` in the `x-pack` folder.
1. Once you've began running the default FTS, you want your second FTS to run such that it is referencing the Elasticsearch instance started by that first FTS. You achieve this by exporting a `TEST_ES_URL` Environment variable that points at it. By default, you should be able to run this: `export TEST_ES_URL=http://elastic:changeme@localhost:9220`. Do this in a terminal window opened in your **second** clone of Kibana (in my case, the `./elastic/_kibana` folder).
1. One issue I encountered with FTS is that I can't tell it _not to start its own ES instance at all_. To achieve this, in `src/platform/packages/shared/kbn-test/src/functional_tests/tasks.js` you need to comment out the line that starts up its own ES (`const es = await runElasticsearch({ config, options: opts });` [line 85] and `await es.cleanup();` shortly after)
1. Next you want each instance of Kibana to run with its own UUID as that is used to identify each Kibana's owned tasks. In the file `x-pack/test/functional/config.base.js` simple change the uuid on the line `--server.uuid=` into any random UUID.
1. Now that you've made these changes you can kick off your second Kibana FTS by running ths following in the second clone's `x-pack` folder: `TEST_KIBANA_PORT=5621 node scripts/functional_tests_server.js --config=test/plugin_api_perf/config.js`. This runs Kibana on a different port than the first FTS (`5621` instead of `5620`).
1. With two FTS Kibana running and both pointing at the same Elasticsearch. Now, you can run the actual perf test by running `node scripts/functional_test_runner.js --config=test/plugin_api_perf/config.js` in a third terminal
1. Now that you've made these changes you can kick off your second Kibana FTS by running ths following in the second clone's `x-pack` folder: `TEST_KIBANA_PORT=5621 node scripts/functional_tests_server.js --config=platform/test/plugin_api_perf/config.js`. This runs Kibana on a different port than the first FTS (`5621` instead of `5620`).
1. With two FTS Kibana running and both pointing at the same Elasticsearch. Now, you can run the actual perf test by running `node scripts/functional_test_runner.js --config=platform/test/plugin_api_perf/config.js` in a third terminal

View file

@ -7,9 +7,10 @@
import path from 'path';
import { findTestPluginPaths } from '@kbn/test';
import { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
export default async function ({ readConfigFile }) {
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const integrationConfig = await readConfigFile(require.resolve('../api_integration/config'));
return {

View file

@ -0,0 +1,14 @@
{
"name": "@kbn/task-manager-performance-plugin",
"version": "1.0.0",
"kibana": {
"version": "kibana",
"templateVersion": "1.0.0"
},
"main": "target/platform/test/plugin_api_perf/plugins/task_manager_performance",
"scripts": {
"kbn": "node ../../../../../../scripts/kbn.js",
"build": "rm -rf './target' && ../../../../../../node_modules/.bin/tsc"
},
"license": "Elastic License 2.0"
}

View file

@ -1,5 +1,5 @@
{
"extends": "../../../../../tsconfig.base.json",
"extends": "../../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types"
},

View file

@ -20,7 +20,7 @@
},
"testData": {
"esArchives": [],
"kbnArchives": ["x-pack/test/scalability/fixtures/kbn_archiver/1600-dataviews.json"]
"kbnArchives": ["x-pack/platform/test/scalability/fixtures/kbn_archiver/1600-dataviews.json"]
},
"streams": [
{

View file

@ -25,7 +25,7 @@
},
"testData": {
"esArchives": [],
"kbnArchives": ["x-pack/test/scalability/fixtures/kbn_archiver/1600-dataviews.json"]
"kbnArchives": ["x-pack/platform/test/scalability/fixtures/kbn_archiver/1600-dataviews.json"]
},
"streams": [
{

View file

@ -0,0 +1,14 @@
{
"name": "@kbn/sample-task-plugin-update-by-query",
"version": "1.0.0",
"kibana": {
"version": "kibana",
"templateVersion": "1.0.0"
},
"main": "target/platform/test/task_manager_claimer_update_by_query/plugins/sample_task_plugin_update_by_query",
"scripts": {
"kbn": "node ../../../../../../scripts/kbn.js",
"build": "rm -rf './target' && ../../../../../../node_modules/.bin/tsc"
},
"license": "Elastic License 2.0"
}

View file

@ -1,5 +1,5 @@
{
"extends": "../../../../../tsconfig.base.json",
"extends": "../../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types"
},

View file

@ -16,6 +16,7 @@
"allowJs": false
},
"include": [
"index.d.ts",
"**/*",
"../../../typings/**/*",
"../../../src/platform/packages/shared/kbn-test/types/ftr_globals/**/*",
@ -94,5 +95,9 @@
"@kbn/stack-alerts-plugin",
"@kbn/triggers-actions-ui-plugin",
"@kbn/alerts-as-data-utils",
"@kbn/dev-proc-runner",
"@kbn/repo-info",
"@kbn/dev-cli-errors",
"@kbn/journeys",
]
}

View file

@ -1,14 +0,0 @@
{
"name": "@kbn/task-manager-performance-plugin",
"version": "1.0.0",
"kibana": {
"version": "kibana",
"templateVersion": "1.0.0"
},
"main": "target/test/plugin_api_perf/plugins/task_manager_performance",
"scripts": {
"kbn": "node ../../../../../scripts/kbn.js",
"build": "rm -rf './target' && ../../../../../node_modules/.bin/tsc"
},
"license": "Elastic License 2.0"
}

View file

@ -1,14 +0,0 @@
{
"name": "@kbn/sample-task-plugin-update-by-query",
"version": "1.0.0",
"kibana": {
"version": "kibana",
"templateVersion": "1.0.0"
},
"main": "target/test/task_manager_claimer_update_by_query/plugins/sample_task_plugin_update_by_query",
"scripts": {
"kbn": "node ../../../../../scripts/kbn.js",
"build": "rm -rf './target' && ../../../../../node_modules/.bin/tsc"
},
"license": "Elastic License 2.0"
}

View file

@ -56,10 +56,8 @@
"@kbn/repo-info",
"@kbn/tooling-log",
"@kbn/dev-utils",
"@kbn/dev-proc-runner",
"@kbn/ftr-common-functional-services",
"@kbn/expect",
"@kbn/dev-cli-errors",
"@kbn/ci-stats-reporter",
"@kbn/std",
"@kbn/apm-synthtrace",
@ -89,7 +87,6 @@
"@kbn/core-provider-plugin",
"@kbn/user-profile-components",
"@kbn/apm-synthtrace-client",
"@kbn/journeys",
"@kbn/cloud-integration-saml-provider-plugin",
"@kbn/security-api-integration-helpers",
"@kbn/alerts-as-data-utils",
@ -130,7 +127,6 @@
"@kbn/apm-data-view",
"@kbn/search-types",
"@kbn/alerting-comparators",
"@kbn/alerting-state-types",
"@kbn/reporting-server",
"@kbn/data-quality-plugin",
"@kbn/observability-synthetics-test-data",

View file

@ -6973,7 +6973,7 @@
version "0.0.0"
uid ""
"@kbn/sample-task-plugin-update-by-query@link:x-pack/test/task_manager_claimer_update_by_query/plugins/sample_task_plugin_mget":
"@kbn/sample-task-plugin-update-by-query@link:x-pack/platform/test/task_manager_claimer_update_by_query/plugins/sample_task_plugin_mget":
version "0.0.0"
uid ""
@ -7753,7 +7753,7 @@
version "0.0.0"
uid ""
"@kbn/task-manager-performance-plugin@link:x-pack/test/plugin_api_perf/plugins/task_manager_performance":
"@kbn/task-manager-performance-plugin@link:x-pack/platform/test/plugin_api_perf/plugins/task_manager_performance":
version "0.0.0"
uid ""