kibana/scripts
Tiago Costa 6e8895403a
chore(NA): tool to find plugins circular dependencies between plugins (#82867)
* chore(NA): update gitignore to include first changes from moving into a single package.json

* chore(NA): update gitignore

* chore(NA): move all the dependencies into the single package.json and apply changes to bootstrap

* chore(NA): fix types problems after the single package json

* chore(NA): include code to find the dependencies used across the code

* chore(NA): introduce pure lockfile for install dependencies on build

* chore(NA): update clean task to not delete anything from xpack node_modules

* chore(NA): update gitignore to remove development temporary rules

* chore(NA): update notice file

* chore(NA): update jest snapshots

* chore(NA): fix whitelisted licenses to include a new specify form of an already included one

* chore(NA): remove check lockfile symlinks from child projects

* chore(NA): fix eslint and add missing declared deps on single pkg json

* chore(NA): correctly update notice

* chore(NA): fix failing jest test for storyshots.test.tsx

* chore(NA): fix cypress multi reporter path

* chore(NA): fix Project tests check

* chore(NA): fix problem with logic to detect used dependes on oss build

* chore(NA): include correct x-pack plugins dep discovery

* chore(NA): discover entries under dynamic requires on vis_type_timelion

* chore(NA): remove canvas

* chore(NA): add initial code to find circular deps

* chore(NA): ground work to integrate the circular deps scripts

* chore(NA): add correct filtering to find circular dependenices feature

* chore(NA): add ci mode flag into circular deps script

* chore(NA): feature complete circular dependencies detect script

* chore(NA): merge and solve conflicts with master

* chore(NA): remove unwanted changes

* chore(NA): remove unwanted changes on kbn storybook

* chore(NA): hook find circular deps tool into ci

* chore(NA): remove previous find plugin circular deps script

* chore(NA): add type for circular dep list

* chore(NA): add type for circular dep list for allowed list

* chore(NA): allow CI to fail check

* chore(NA): update deps allowed list

* chore(NA): run search circular deps script over examples too

* docs(NA): adds cli description

* chore(NA): use plugin search paths to build entries to find circular deps

* chore(NA): update allowed list

* chore(NA): snapshot update for kbn optimizer test

* chore(NA): update dpdm version

* chore(NA): remove thirdParty flag

* chore(NA): update docs to include info about the new tool

* docs(NA): update to link PR instead of the issue

* chore(NA): update debug logs to always output allowedList

* fix(NA): correctly list found differences number

* chore(NA): remove quiet flag

* fix(NA): correctly fail the CI if circular deps are found

* chore(NA): complete list of found circular deps

* chore(NA): used named capturing group into the regex

* docs(NA): update typescript best practices docs and styleguide

* chore(NA): introduce quick filter option flag

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-30 22:19:32 +00: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 [babel/register] remove from build (take 2) (#79379) 2020-10-02 16:30:16 -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 [dev/license_checker][dev/npm] reactor, ts-ify, de-grunt (#37807) 2019-06-06 10:16:19 -07: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 [babel/register] remove from build (take 2) (#79379) 2020-10-02 16:30:16 -07:00
es_archiver.js [kbn/es-archiver] move to a package (#72318) 2020-07-22 08:02:39 -07:00
eslint.js
find_plugins_ready_to_migrate_to_ts_refs.js add a script to find ready to migrate to ts project refs plugins (#82305) 2020-11-03 08:38:57 +01:00
find_plugins_with_circular_deps.js chore(NA): tool to find plugins circular dependencies between plugins (#82867) 2020-11-30 22:19:32 +00:00
find_plugins_without_ts_refs.js Add script to identify plugin dependencies for TS project references migration (#80463) 2020-10-16 11:55:46 +02:00
functional_test_runner.js [FTR] Refactor FTR to live under KBN-TEST (#42547) 2019-08-06 15:35:16 -06:00
functional_tests.js [test/new_visualize_flow] fix config (#82441) 2020-11-04 13:05:00 +01:00
functional_tests_server.js autofix all violations 2019-12-13 23:17:13 -07:00
generate_plugin.js [babel/register] remove from build (take 2) (#79379) 2020-10-02 16:30:16 -07:00
generate_team_assignments.js [QA][Code Coverage] Coverage teams lookup w/o Additional Config (#77111) 2020-09-28 15:27:02 -06: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 [Plugin Generator] Add integration test (#43219) 2019-09-06 13:10:47 -06:00
kbn.js
kibana.js [babel/register] remove from build (take 2) (#79379) 2020-10-02 16:30:16 -07:00
kibana_encryption_keys.js [cli] Add bin/kibana-encryption-keys (#82838) 2020-11-19 12:41:48 -06:00
kibana_keystore.js [cli] migrate remaining cli scripts to /dist /dev style (#79409) 2020-10-05 15:07:12 -07:00
kibana_plugin.js [cli] migrate remaining cli scripts to /dist /dev style (#79409) 2020-10-05 15:07:12 -07:00
makelogs.js
mocha.js [FTR] Refactor mocha under @kbn/test (#42862) 2019-08-15 15:48:39 -06:00
notice.js
plugin_helpers.js [babel/register] remove from build (take 2) (#79379) 2020-10-02 16:30:16 -07:00
precommit_hook.js [kbn/optimizer] implement more efficient auto transpilation for node (#79052) 2020-10-02 18:36:25 -07:00
README.md
register_git_hook.js [babel/register] remove from build (take 2) (#79379) 2020-10-02 16:30:16 -07:00
release_notes.js [babel/register] remove from build (take 2) (#79379) 2020-10-02 16:30:16 -07:00
report_failed_tests.js refactor failed_tests_reporter to use TS, no octokit (#46993) 2019-10-08 13:56:07 -07:00
sasslint.js
spec_to_console.js autofix all violations 2019-12-13 23:17:13 -07:00
storybook.js 📕 Storybook for everyone (take 2) (#43529) 2020-01-15 12:30:59 -08:00
telemetry_check.js [babel/register] remove from build (take 2) (#79379) 2020-10-02 16:30:16 -07:00
telemetry_extract.js [babel/register] remove from build (take 2) (#79379) 2020-10-02 16:30:16 -07:00
test_hardening.js apply prettier styles 2020-05-22 09:08:58 +02:00
type_check.js
update_prs.js [scripts/update_prs] implement script to merge base branch into prs (#38302) 2019-06-06 18:31:08 -07:00

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.