95e5edd9c4
Instruments Kibana with Elastic APM by adding the Node.js agent to the source code. The agent is not turned on by default but can be enabled by setting the environment variable `ELASTIC_APM_ACTIVE=true` or by creating an apm config file called `config/apm.dev.js` and setting `active: true` inside of it. This implementation is not meant to be used by end-users of Kibana as it lacks integration with the regular Kibana config file. For now, this is meant as a useful internal tool for Elastic employees when developing Kibana. By default, it's pre-configured with a `serverUrl` pointing to an APM Server hosted on Elastic Cloud. The data is stored in an ES cluster accessible only by Elastic employees. These defaults can easily be overwritten using environment variables or via the custom config file. |
||
---|---|---|
.. | ||
backport.js | ||
build.js | ||
build_renovate_config.js | ||
build_sass.js | ||
check_core_api_changes.js | ||
check_file_casing.js | ||
check_licenses.js | ||
check_ts_projects.js | ||
docs.js | ||
es.js | ||
es_archiver.js | ||
eslint.js | ||
functional_test_runner.js | ||
functional_tests.js | ||
functional_tests_server.js | ||
generate_plugin.js | ||
i18n_check.js | ||
i18n_extract.js | ||
i18n_integrate.js | ||
jest.js | ||
jest_integration.js | ||
kbn.js | ||
kibana.js | ||
kibana_keystore.js | ||
kibana_plugin.js | ||
makelogs.js | ||
mocha.js | ||
notice.js | ||
precommit_hook.js | ||
README.md | ||
register_git_hook.js | ||
report_failed_tests.js | ||
sasslint.js | ||
spec_to_console.js | ||
type_check.js | ||
update_prs.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.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.js]
Starts just the Elasticsearch and Kibana servers given a single config, i.e. via --config test/functional/config.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.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.