# Backport This will backport the following commits from `main` to `8.7`: - [[performance] enable journey run against cloud deployments (#156720)](https://github.com/elastic/kibana/pull/156720) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Dzmitry Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2023-05-09T03:35:43Z","message":"[performance] enable journey run against cloud deployments (#156720)\n\n## Summary\r\n\r\nThis PR adds changes and instructions how to run existing performance\r\njourneys against ESS instances.\r\n\r\nAs previously discussed with @pheyos , there are few manual steps to be\r\ndone before running the actual journey:\r\n1. Create cloud deployment and re-configure it the way APM traces are\r\nreported the monitoring cluster\r\n2. Check out the branch matching deployment version (main ->\r\n8.9.0-SNAPSHOT), create user with `superuser` role (we don't test\r\nfunctional features, only performance metrics)\r\n\r\nThen you can run the journey like a regular cloud test suite:\r\n```\r\nexport TEST_KIBANA_URL=https://<username>:<password>@<kibana_url>\r\nexport TEST_ES_URL=https://<username>:<password>@j<elasticsearch_url>:<port>\r\nexport TEST_CLOUD=1\r\nnode scripts/functional_test_runner.js --config x-pack/performance/journeys/$YOUR_JOURNEY_NAME.ts\r\n```\r\n\r\n<img width=\"1357\" alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/10977896/236499836-2738fecb-a5a9-4e58-a10b-915b962af037.png\">\r\n\r\n---------\r\n\r\nCo-authored-by: Jon <jon@budzenski.me>","sha":"e55a92eab0ae28799b51238fb76efa6026673e6e","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","wg:performance","v8.7.2","v8.9.0","v8.8.1"],"number":156720,"url":"https://github.com/elastic/kibana/pull/156720","mergeCommit":{"message":"[performance] enable journey run against cloud deployments (#156720)\n\n## Summary\r\n\r\nThis PR adds changes and instructions how to run existing performance\r\njourneys against ESS instances.\r\n\r\nAs previously discussed with @pheyos , there are few manual steps to be\r\ndone before running the actual journey:\r\n1. Create cloud deployment and re-configure it the way APM traces are\r\nreported the monitoring cluster\r\n2. Check out the branch matching deployment version (main ->\r\n8.9.0-SNAPSHOT), create user with `superuser` role (we don't test\r\nfunctional features, only performance metrics)\r\n\r\nThen you can run the journey like a regular cloud test suite:\r\n```\r\nexport TEST_KIBANA_URL=https://<username>:<password>@<kibana_url>\r\nexport TEST_ES_URL=https://<username>:<password>@j<elasticsearch_url>:<port>\r\nexport TEST_CLOUD=1\r\nnode scripts/functional_test_runner.js --config x-pack/performance/journeys/$YOUR_JOURNEY_NAME.ts\r\n```\r\n\r\n<img width=\"1357\" alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/10977896/236499836-2738fecb-a5a9-4e58-a10b-915b962af037.png\">\r\n\r\n---------\r\n\r\nCo-authored-by: Jon <jon@budzenski.me>","sha":"e55a92eab0ae28799b51238fb76efa6026673e6e"}},"sourceBranch":"main","suggestedTargetBranches":["8.7","8.8"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156720","number":156720,"mergeCommit":{"message":"[performance] enable journey run against cloud deployments (#156720)\n\n## Summary\r\n\r\nThis PR adds changes and instructions how to run existing performance\r\njourneys against ESS instances.\r\n\r\nAs previously discussed with @pheyos , there are few manual steps to be\r\ndone before running the actual journey:\r\n1. Create cloud deployment and re-configure it the way APM traces are\r\nreported the monitoring cluster\r\n2. Check out the branch matching deployment version (main ->\r\n8.9.0-SNAPSHOT), create user with `superuser` role (we don't test\r\nfunctional features, only performance metrics)\r\n\r\nThen you can run the journey like a regular cloud test suite:\r\n```\r\nexport TEST_KIBANA_URL=https://<username>:<password>@<kibana_url>\r\nexport TEST_ES_URL=https://<username>:<password>@j<elasticsearch_url>:<port>\r\nexport TEST_CLOUD=1\r\nnode scripts/functional_test_runner.js --config x-pack/performance/journeys/$YOUR_JOURNEY_NAME.ts\r\n```\r\n\r\n<img width=\"1357\" alt=\"image\"\r\nsrc=\"https://user-images.githubusercontent.com/10977896/236499836-2738fecb-a5a9-4e58-a10b-915b962af037.png\">\r\n\r\n---------\r\n\r\nCo-authored-by: Jon <jon@budzenski.me>","sha":"e55a92eab0ae28799b51238fb76efa6026673e6e"}},{"branch":"8.8","label":"v8.8.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co> |
||
---|---|---|
.. | ||
analytics | ||
content-management | ||
core | ||
home | ||
kbn-ace | ||
kbn-alerts | ||
kbn-alerts-ui-shared | ||
kbn-ambient-common-types | ||
kbn-ambient-ftr-types | ||
kbn-ambient-storybook-types | ||
kbn-ambient-ui-types | ||
kbn-analytics | ||
kbn-apm-config-loader | ||
kbn-apm-synthtrace | ||
kbn-apm-synthtrace-client | ||
kbn-apm-utils | ||
kbn-axe-config | ||
kbn-babel-plugin-package-imports | ||
kbn-babel-preset | ||
kbn-babel-register | ||
kbn-babel-transform | ||
kbn-bazel-runner | ||
kbn-cases-components | ||
kbn-cell-actions | ||
kbn-chart-icons | ||
kbn-ci-stats-core | ||
kbn-ci-stats-performance-metrics | ||
kbn-ci-stats-reporter | ||
kbn-ci-stats-shipper-cli | ||
kbn-cli-dev-mode | ||
kbn-coloring | ||
kbn-config | ||
kbn-config-mocks | ||
kbn-config-schema | ||
kbn-crypto | ||
kbn-crypto-browser | ||
kbn-cypress-config | ||
kbn-datemath | ||
kbn-dev-cli-errors | ||
kbn-dev-cli-runner | ||
kbn-dev-proc-runner | ||
kbn-dev-utils | ||
kbn-doc-links | ||
kbn-docs-utils | ||
kbn-ebt-tools | ||
kbn-ecs | ||
kbn-es | ||
kbn-es-archiver | ||
kbn-es-errors | ||
kbn-es-query | ||
kbn-es-types | ||
kbn-eslint-config | ||
kbn-eslint-plugin-disable | ||
kbn-eslint-plugin-eslint | ||
kbn-eslint-plugin-imports | ||
kbn-expect | ||
kbn-failed-test-reporter-cli | ||
kbn-field-types | ||
kbn-find-used-node-modules | ||
kbn-flot-charts | ||
kbn-ftr-common-functional-services | ||
kbn-ftr-screenshot-filename | ||
kbn-generate | ||
kbn-get-repo-files | ||
kbn-guided-onboarding | ||
kbn-handlebars | ||
kbn-hapi-mocks | ||
kbn-health-gateway-server | ||
kbn-i18n | ||
kbn-i18n-react | ||
kbn-import-locator | ||
kbn-import-resolver | ||
kbn-interpreter | ||
kbn-io-ts-utils | ||
kbn-jest-serializers | ||
kbn-journeys | ||
kbn-json-ast | ||
kbn-kibana-manifest-schema | ||
kbn-language-documentation-popover | ||
kbn-lint-packages-cli | ||
kbn-lint-ts-projects-cli | ||
kbn-logging | ||
kbn-logging-mocks | ||
kbn-managed-vscode-config | ||
kbn-managed-vscode-config-cli | ||
kbn-mapbox-gl | ||
kbn-monaco | ||
kbn-optimizer | ||
kbn-optimizer-webpack-helpers | ||
kbn-osquery-io-ts-types | ||
kbn-peggy | ||
kbn-peggy-loader | ||
kbn-performance-testing-dataset-extractor | ||
kbn-picomatcher | ||
kbn-plugin-discovery | ||
kbn-plugin-generator | ||
kbn-plugin-helpers | ||
kbn-react-field | ||
kbn-repo-file-maps | ||
kbn-repo-info | ||
kbn-repo-linter | ||
kbn-repo-packages | ||
kbn-repo-path | ||
kbn-repo-source-classifier | ||
kbn-repo-source-classifier-cli | ||
kbn-rison | ||
kbn-rule-data-utils | ||
kbn-safer-lodash-set | ||
kbn-securitysolution-autocomplete | ||
kbn-securitysolution-ecs | ||
kbn-securitysolution-es-utils | ||
kbn-securitysolution-exception-list-components | ||
kbn-securitysolution-hook-utils | ||
kbn-securitysolution-io-ts-alerting-types | ||
kbn-securitysolution-io-ts-list-types | ||
kbn-securitysolution-io-ts-types | ||
kbn-securitysolution-io-ts-utils | ||
kbn-securitysolution-list-api | ||
kbn-securitysolution-list-constants | ||
kbn-securitysolution-list-hooks | ||
kbn-securitysolution-list-utils | ||
kbn-securitysolution-rules | ||
kbn-securitysolution-t-grid | ||
kbn-securitysolution-utils | ||
kbn-server-http-tools | ||
kbn-server-route-repository | ||
kbn-set-map | ||
kbn-shared-svg | ||
kbn-shared-ux-utility | ||
kbn-slo-schema | ||
kbn-some-dev-log | ||
kbn-sort-package-json | ||
kbn-spec-to-console | ||
kbn-std | ||
kbn-stdio-dev-helpers | ||
kbn-storybook | ||
kbn-telemetry-tools | ||
kbn-test | ||
kbn-test-jest-helpers | ||
kbn-test-subj-selector | ||
kbn-timelion-grammar | ||
kbn-tinymath | ||
kbn-tooling-log | ||
kbn-ts-projects | ||
kbn-ts-type-check-cli | ||
kbn-typed-react-router-config | ||
kbn-ui-actions-browser | ||
kbn-ui-framework | ||
kbn-ui-shared-deps-npm | ||
kbn-ui-shared-deps-src | ||
kbn-ui-theme | ||
kbn-user-profile-components | ||
kbn-utility-types | ||
kbn-utility-types-jest | ||
kbn-utils | ||
kbn-web-worker-stub | ||
kbn-whereis-pkg-cli | ||
kbn-yarn-lock-validator | ||
shared-ux | ||
README.md |
Kibana-related packages
This folder contains packages that are intended for use in Kibana and Kibana plugins.
tl;dr:
- Don't publish to npm registry
- Always use the
@kbn
namespace - Always set
"private": true
inpackage.json
Using these packages
We no longer publish these packages to the npm registry. Now, instead of specifying a version when including these packages, we rely on yarn workspaces, which sets up a symlink to the package.
For example if you want to use the @kbn/i18n
package in Kibana itself, you
can specify the dependency like this:
"@kbn/i18n": "1.0.0"
However, if you want to use this from a Kibana plugin, you need to use a link:
dependency and account for the relative location of the Kibana repo, so it would
instead be:
"@kbn/i18n": "link:../../kibana/packages/kbn-i18n"
then run yarn kbn bootstrap
from the plugin directory.
Creating a new package
Run the following command from the root of the Kibana repo:
node scripts/generate package @kbn/<PACKAGE_NAME> --web --owner @elastic/<TEAM_NAME>
Unit tests for a package
Currently there is only one tool being used in order to test packages which is Jest. Below we will explain how it should be done.
Jest
A package should follow the pattern of having .test.js
files as siblings of the source code files, and these run by Jest.
A package using the .test.js
naming convention will have those tests automatically picked up by Jest and run by the unit test runner, currently mapped to the Kibana test
script in the root package.json
.
yarn test
runs all unit tests.yarn jest
runs all Jest tests in Kibana.
In order for the plugin or package to use Jest, a jest.config.js file must be present in it's root. However, there are safeguards for this in CI should a test file be added without a corresponding config file.
Each package can also specify its own test
script in the package's package.json
, for cases where you'd prefer to run the tests from the local package directory.