kibana/scripts
Spencer 5a4a38148d
[docs] rewrite docs cli to show logs and use modern apis (#117767)
Co-authored-by: spalger <spalger@users.noreply.github.com>
2021-11-06 20:31:22 -05:00
..
README.md
backport.js
build.js
build_api_docs.js
build_kibana_platform_plugins.js [kbn/optimizer] import source-map-support in script to avoid breaking jest snapshots (#96011) 2021-03-31 18:36:52 -07:00
build_plugin_list_docs.js
build_ts_refs.js
check_file_casing.js
check_jest_configs.js
check_licenses.js
check_published_api_changes.js
check_ts_projects.js
chromium_version.js [Reporting/Build Chromium] Add a developer script to find the Chromium commit (#94033) 2021-03-10 10:57:29 -07:00
convert_ts_projects.js [build_ts_refs] improve caches, allow building a subset of projects (#107981) 2021-08-10 22:12:45 -07:00
docs.js [docs] rewrite docs cli to show logs and use modern apis (#117767) 2021-11-06 20:31:22 -05:00
ensure_all_tests_in_ci_group.js [ftr] rework ciGroup validation to remove JOBS.yml and avoid duplication (#109149) 2021-08-19 11:40:23 -05:00
es.js
es_archiver.js
eslint.js
eslint_with_types.js [eslint] enable type-specific lint rules (#114184) 2021-11-03 16:56:17 -06:00
find_babel_runtime_helpers_in_use.js [kbn/optimizer] dll @babel/runtime modules used by entry bundles (#113453) 2021-10-29 18:08:20 -05:00
find_plugins_ready_to_migrate_to_ts_refs.js
find_plugins_with_circular_deps.js
find_plugins_without_ts_refs.js
functional_test_runner.js
functional_tests.js Interactive setup functional tests (#115274) 2021-10-26 19:03:00 +01:00
functional_tests_server.js
generate_plugin.js
generate_team_assignments.js
i18n_check.js
i18n_extract.js
i18n_integrate.js
ingest_coverage.js
jest.js chore(NA): ensure scripts run with --preserve-symlinks (#94046) 2021-03-15 16:17:54 -04:00
jest_integration.js chore(NA): ensure scripts run with --preserve-symlinks (#94046) 2021-03-15 16:17:54 -04:00
kbn.js chore(NA): ensure scripts run with --preserve-symlinks (#94046) 2021-03-15 16:17:54 -04:00
kbn_archiver.js
kibana.js
kibana_encryption_keys.js
kibana_keystore.js
kibana_plugin.js
kibana_setup.js Add interactive setup CLI (#114493) 2021-10-20 22:17:45 +01:00
kibana_verification_code.js Verification code CLI (#111707) 2021-09-14 21:58:25 +01:00
licenses_csv_report.js
makelogs.js
notice.js
plugin_helpers.js
precommit_hook.js chore(NA): ensure scripts run with --preserve-symlinks (#94046) 2021-03-15 16:17:54 -04:00
register_git_hook.js chore(NA): moving @kbn/dev-utils to babel transpiler (#107245) 2021-07-30 16:03:42 -04:00
report_failed_tests.js
saved_objs_info.js [QA][SO INFO SVC] Add cli (#108353) 2021-08-16 13:36:22 +01:00
ship_ci_stats.js
spec_to_console.js chore(NA): moving @kbn/spec-to-console into bazel (#103470) 2021-06-28 15:58:41 +01:00
storybook.js
stylelint.js
telemetry_check.js
telemetry_extract.js
test_hardening.js chore(NA): ensure scripts run with --preserve-symlinks (#94046) 2021-03-15 16:17:54 -04:00
type_check.js
update_prs.js
update_vscode_config.js add script to update VSCode config with proper excludes (#110161) 2021-08-30 16:43:28 -07:00

README.md

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.