kibana/packages
Brian Seeders 27d23c4184 Jenkins pipeline with parallel cigroups (#45285)
* Pipeline

* WIP some work for parallelization with ciGroups

* Fix xpack kibana install dir, and add some debugging

* Attempt to quick fix a few tests

* Revert "Revert "Revert "[ci] compress jobs for CI stability" (#44584)""

This reverts commit 078ac2897f.

* Recombine test groups, and try runbld again

* Mostly cleanup, and fix failed_tests reporting to hopefully work for both pipeline and non-pipeline

* Fix typo in shell script

* Remove some debug code

* Add support for changing es transport.port during testing via TEST_ES_TRANSPORT_PORT

* Fix test that uses hard-coded es transport port and add it back in to parallel groups

* Disable checks reporter again for now

* Set env var for TEST_ES_TRANSPORT_PORT in pipeline

* Update Jenkinsfile for shorter testrunner labels

* Fix another hard-coded transport port

* Fix a new test with hard-coded URLs

* Jenkinsfile cleanup and fix one of the groups

* Fix double slash

* Testing vault credentials on jenkins server

* Add a non-existent credential

* Revert "Add a non-existent credential"

This reverts commit 0dc234c465a5483b1a994cb510a182fef766e9cc.

* Try github-checks-reporter again

* github-checks-reporter should only run for elastic/kibana, forks won't work

* Clean up some debug code

* Changing names around to try to make BlueOcean UI a little better

* Add more stages

* Make some changes to stage structure to mirror a nested example from CloudBees

* Handle TODOs, and some cleanup in Jenkinsfile

* Pass GIT_BRANCH when started without GHPRB, fix branch check

* Fix mailer problem and add code that ensures all tests are in cigroups back in

* Test adding worker/job name to junit report paths

* Remove some duplication from ci_setup scripts

* Fix unit test that uses junit path

* Don't reinstall node every time setup_env is run

* Fix yarn install logic

* Fix another unit test that uses junit output dir

* Download latest ES snapshot after kibana builds

* Make sure junit reports are always processed

* Add two failing tests for testing purposes

* Add support to Jenkinsfile for kibana build e-mails

* Remove some debug code for email sending

* Change JOB env handling in junit paths and move it to a sub-directory

* Revert "Add two failing tests for testing purposes"

This reverts commit 5715203e26922a93483feb0ebb8bb3fdcc3daf8c.

* Fix junit report path in test

* Don't send kibana emails on build abort

* Address PR feedback, formatting and use built-in url formatting library

* Fix path formatting for functional test

* Add email sending back in to Jenkinsfile

* Fix another unit test with path problem
2019-09-11 11:58:28 -07:00
..
elastic-datemath [mocha] fix test selectors to get everything in packages (#43797) 2019-08-22 18:49:01 -07:00
eslint-config-kibana Update dependency babel-eslint to ^10.0.3 (#44029) 2019-08-27 13:57:15 -07:00
kbn-analytics [@kbn/analytics] Updates dependencies and browser entry (#44316) 2019-08-29 10:43:36 -07:00
kbn-babel-code-parser Update babel related packages (#43595) 2019-08-22 18:40:57 -07:00
kbn-babel-preset manually setup module transforms so to support async imports in webpack (#44413) 2019-08-29 14:04:12 -07:00
kbn-config-schema fix schema.nullable() to support non-strings (#42891) 2019-08-13 21:38:15 -04:00
kbn-dev-utils [ftr] support --kibana-install-dir flag (#44552) 2019-09-05 13:06:10 -07:00
kbn-elastic-idx Update babel related packages (#43595) 2019-08-22 18:40:57 -07:00
kbn-es Update dependency del to ^4.1.1 (#44806) 2019-09-04 13:15:59 -07:00
kbn-es-query Update dependency del to ^4.1.1 (#44806) 2019-09-04 13:15:59 -07:00
kbn-eslint-import-resolver-kibana Update dependency lru-cache to ^4.1.5 (#45157) 2019-09-09 13:33:31 -07:00
kbn-eslint-plugin-eslint Update dependency babel-eslint to ^10.0.3 (#44029) 2019-08-27 13:57:15 -07:00
kbn-expect
kbn-i18n Update dependency del to ^4.1.1 (#44806) 2019-09-04 13:15:59 -07:00
kbn-interpreter Update dependency del to ^4.1.1 (#44806) 2019-09-04 13:15:59 -07:00
kbn-plugin-generator [Plugin Generator] Add integration test (#43219) 2019-09-06 13:10:47 -06:00
kbn-plugin-helpers Update dependency del to ^4.1.1 (#44806) 2019-09-04 13:15:59 -07:00
kbn-pm Update dependency del to ^4.1.1 (#44806) 2019-09-04 13:15:59 -07:00
kbn-spec-to-console [Console] Update autocomplete api definition (#43651) 2019-08-22 07:35:35 +02:00
kbn-test Jenkins pipeline with parallel cigroups (#45285) 2019-09-11 11:58:28 -07:00
kbn-test-subj-selector [mocha] fix test selectors to get everything in packages (#43797) 2019-08-22 18:49:01 -07:00
kbn-ui-framework Update dependency highlight.js to v9.15.10 (#45156) 2019-09-09 13:30:08 -07:00
kbn-utility-types Utility types (#41246) 2019-08-12 15:45:32 +02:00
README.md [test] remove x-pack mocha configuration (#42979) 2019-08-15 12:21:42 -05:00

Kibana-related packages

This folder contains packages that are intended for use in Kibana and Kibana plugins.

tl;dr:

  • Don't publish to npm registry
  • Always use the @kbn namespace
  • Always set "private": true in package.json

Using these packages

We no longer publish these packages to the npm registry. Now, instead of specifying a version when including these packages, we rely on yarn workspaces, which sets up a symlink to the package.

For example if you want to use the @kbn/i18n package in Kibana itself, you can specify the dependency like this:

"@kbn/i18n": "1.0.0"

However, if you want to use this from a Kibana plugin, you need to use a link: dependency and account for the relative location of the Kibana repo, so it would instead be:

"@kbn/i18n": "link:../../kibana/packages/kbn-i18n"

How all of this works is described in more detail in the @kbn/pm docs.

Creating a new package

Create a new sub-folder. The name of the folder should mirror the name in the package's package.json. E.g. if the name is @kbn/i18n the folder name should be kbn-i18n.

All new packages should use the @kbn namespace, and should be marked with "private": true.

Unit tests for a package

Currently there are two patterns used to test packages, one using Mocha and one using Jest. These patterns emerged out of convention and we'd like to make them more similar to each other in the near future.

1. Mocha

Today a package can follow the pattern of having a __tests__ directory in each source code directory of a package which contains the tests for that module. These are usually run by Mocha.

If a package's tests should be run with Mocha, you'll have to opt-in to run them by appending the package's test file pattern(s) to Kibana's src/dev/mocha/run_mocha_cli.js file. These will then be run by the unit test runner.

  • yarn test or yarn grunt test runs all unit tests.
  • node scripts/mocha runs all Mocha tests.

2. Jest

A package can also follow the pattern of having .test.js files as siblings of the source code files, and these run by Jest.

A package using the .test.js naming convention will have those tests automatically picked up by Jest and run by the unit test runner, currently mapped to the Kibana test script in the root package.json.

  • yarn test or yarn grunt test runs all unit tests.
  • node scripts/jest runs all Jest tests in Kibana.

Each package can also specify its own test script in the package's package.json, for cases where you'd prefer to run the tests from the local package directory.