## Summary Closes #146546 This PR replaces bash script with node-based runner script. Script can take relative path to directory with scalability journey files or relative path to individual journey json file. `node scripts/run_scalability.js --journey-config-path scalability_traces/server` `node scripts/run_scalability.js --journey-config-path scalability_traces/server/api.core.capabilities.json` ### Checklist Delete any items that are not applicable to this PR. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### Risk Matrix Delete this section if it is not applicable to this PR. Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release. When forming the risk matrix, consider some of the following examples and how they may potentially impact the change: | Risk | Probability | Severity | Mitigation/Notes | |---------------------------|-------------|----------|-------------------------| | Multiple Spaces—unexpected behavior in non-default Kibana Space. | Low | High | Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces. | | Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. | High | Low | Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure. | | Code should gracefully handle cases when feature X or plugin Y are disabled. | Medium | High | Unit tests will verify that any feature flag or plugin combination still results in our service operational. | | [See more potential risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) | ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) |
||
---|---|---|
.. | ||
archive_migration_functions.sh | ||
backport.js | ||
build.js | ||
build_api_docs.js | ||
build_kibana_platform_plugins.js | ||
build_plugin_list_docs.js | ||
check_file_casing.js | ||
check_ftr_configs.js | ||
check_jest_configs.js | ||
check_licenses.js | ||
check_ts_projects.js | ||
chromium_version.js | ||
classify_source.js | ||
dev_docs.sh | ||
docs.js | ||
download_pr_list.js | ||
enabled_ftr_configs.js | ||
es.js | ||
es_archiver.js | ||
eslint.js | ||
eslint_with_types.js | ||
extract_performance_testing_dataset.js | ||
find_babel_runtime_helpers_in_use.js | ||
find_node_libs_browser_polyfills_in_use.js | ||
find_plugins_ready_to_migrate_to_ts_refs.js | ||
find_plugins_with_circular_deps.js | ||
find_plugins_without_ts_refs.js | ||
find_target_node_imports_in_bundles.js | ||
functional_test_runner.js | ||
functional_tests.js | ||
functional_tests_server.js | ||
generate.js | ||
generate_plugin.js | ||
generate_team_assignments.js | ||
i18n_check.js | ||
i18n_extract.js | ||
i18n_integrate.js | ||
ingest_coverage.js | ||
jest.js | ||
jest_integration.js | ||
kbn.js | ||
kbn_archiver.js | ||
kibana.js | ||
kibana_encryption_keys.js | ||
kibana_keystore.js | ||
kibana_plugin.js | ||
kibana_setup.js | ||
kibana_verification_code.js | ||
licenses_csv_report.js | ||
makelogs.js | ||
notice.js | ||
plugin_helpers.js | ||
precommit_hook.js | ||
read_jest_help.mjs | ||
README.md | ||
register_git_hook.js | ||
report_failed_tests.js | ||
report_performance_metrics.js | ||
run_performance.js | ||
run_scalability.js | ||
saved_objs_info.js | ||
ship_ci_stats.js | ||
spec_to_console.js | ||
storybook.js | ||
stylelint.js | ||
synthtrace.js | ||
telemetry_check.js | ||
telemetry_extract.js | ||
test_hardening.js | ||
type_check.js | ||
type_summarizer.js | ||
update_prs.js | ||
update_vscode_config.js |
Kibana Dev Scripts
This directory contains scripts useful for interacting with Kibana tools in development. Use the node executable and --help
flag to learn about how they work:
node scripts/{{script name}} --help
For Developers
This directory is excluded from the build and tools within it should help users discover their capabilities. Each script in this directory must:
- require
src/setup_node_env
to bootstrap NodeJS environment - call out to source code in the
src
orpackages
directories - react to the
--help
flag - run everywhere OR check and fail fast when a required OS or toolchain is not available
Functional Test Scripts
node scripts/functional_tests [--config test/functional/config.base.js --config test/api_integration/config.js]
Runs all the functional tests: selenium tests and api integration tests. List configs with multiple --config
arguments. Uses the @kbn/test library to run Elasticsearch and Kibana servers and tests against those servers, for multiple server+test setups. In particular, calls out to runTests()
. Can be run on a single config.
node scripts/functional_tests_server [--config test/functional/config.base.js]
Starts just the Elasticsearch and Kibana servers given a single config, i.e. via --config test/functional/config.base.js
or --config test/api_integration/config
. Allows the user to start just the servers with this script, and keep them running while running tests against these servers. The idea is that the same config file configures both Elasticsearch and Kibana servers. Uses the startServers()
method from @kbn/test library.
Example. Start servers and run tests, separately, but using the same config:
# Just the servers
node scripts/functional_tests_server --config path/to/config
In another terminal:
# Just the tests--against the running servers
node scripts/functional_test_runner --config path/to/config
For details on how the internal methods work, read this readme.
ES archiver
Loading data
If you wish to load up specific es archived data for your test, you can do so via:
node scripts/es_archiver.js load <archive> [--es-url=http://username:password@localhost:9200] [--kibana-url=http://username:password@localhost:5601/{basepath?}]
That will load the specified archive located in the archive directory specified by the default functional config file, located in test/functional/config.base.js
. To load archives from other function config files you can pass --config path/to/config.js
.
Note: The --es-url
and --kibana-url
options may or may not be neccessary depending on your current Kibana configuration settings, and their values
may also change based on those settings (for example if you are not running with security you will not need the username:password
portion).
Saving data
You can save existing data into an archive by using the save
command:
node scripts/es_archiver.js save <archive name for kibana data> [space separated list of index patterns to include]
You may want to store the .kibana index separate from data. Since adding a lot of data will bloat our repo size, we have many tests that reuse the same
data indices but use their own .kibana
index.