kibana/scripts
Mikhail Shustov e9e0ca3782
Introduce TS incremental builds & move src/test_utils to TS project (#76082)
* move test_helpers to the core

* create base tsconfig

* all tsconfigs use the base one

* use test_helpers exposed from the src/core

* move getFieldFormatsRegistry to data plugin

* add test_utils project

* compile types after checkout

* add a stub for platform tsconfig.json

* fix broken import

* fix broken path to the base config

* set tsBuildInfoFile for project without outDir

* do not commit tsbuildinfo file

* do not check output d.ts files

* fix type error

* use separate config to build types

* rollback changes to include paths

* mute import zone error

* rename files to avoid references to tsd

* do not use tsd for type tests

* include all ts files in project

* run buildRefs before type check to ensure the latest version

* store tsbuildinfo locally

* update paths to base config

* comment out core/tsconfig.json

* remove ui path

* fix wrong tsbuildinfo path
2020-09-03 14:20:04 +02:00
..
backport.js Bump backport to 5.5.1 (#71408) 2020-07-13 13:59:13 +02:00
build.js
build_kibana_platform_plugins.js build immutable bundles for new platform plugins (#53976) 2020-02-12 19:42:42 -07:00
build_plugin_list_docs.js Add plugin list to docs that is generated from the repo (#71731) 2020-07-16 12:17:39 -07:00
build_ts_refs.js Introduce TS incremental builds & move src/test_utils to TS project (#76082) 2020-09-03 14:20:04 +02:00
check_file_casing.js
check_licenses.js
check_lockfile_symlinks.js Add lockfile symlinks (#55440) 2020-01-27 11:38:20 -05:00
check_published_api_changes.js Generate docs from data plugin (#56955) 2020-03-10 11:34:06 +02:00
check_ts_projects.js
docs.js
es.js apply prettier styles 2020-05-22 09:08:58 +02:00
es_archiver.js [kbn/es-archiver] move to a package (#72318) 2020-07-22 08:02:39 -07:00
eslint.js
functional_test_runner.js
functional_tests.js [KP] Expose new es client (#73651) 2020-07-30 19:12:37 +02:00
functional_tests_server.js
generate_plugin.js [kbn/plugin-generator] remove sao, modernize (#75465) 2020-08-20 18:50:36 -07:00
i18n_check.js
i18n_extract.js
i18n_integrate.js
ingest_coverage.js Ingest code coverage (#62336) 2020-05-13 15:09:42 -06:00
jest.js
jest_integration.js
kbn.js
kibana.js Revert "Integration of a static filesystem for the node_modules (#47998)" (#67124) 2020-05-20 12:11:02 -07:00
kibana_keystore.js
kibana_plugin.js
load_team_assignment.js [QA][Code Coverage] Upload a new Team Assignment on every ci run (#71175) 2020-07-16 10:34:52 -06:00
makelogs.js
mocha.js
notice.js
plugin_helpers.js [plugin-helpers] improve 3rd party KP plugin support (#75019) 2020-08-27 14:56:48 -07:00
precommit_hook.js
README.md
register_git_hook.js [pre-commit script] refactor for speed (#65202) 2020-05-05 16:13:48 -07:00
release_notes.js [release-notes] add script to generate release notes from PRs (#68816) 2020-06-15 16:27:56 -07:00
report_failed_tests.js
sasslint.js
spec_to_console.js
storybook.js
telemetry_check.js [Telemetry] Collector Schema (#64942) 2020-06-27 02:52:26 +03:00
telemetry_extract.js [Telemetry] Collector Schema (#64942) 2020-06-27 02:52:26 +03:00
test_hardening.js apply prettier styles 2020-05-22 09:08:58 +02:00
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 or packages 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.