-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Jest muti-project runner instead of a global config #72569
Comments
Pinging @elastic/kibana-operations (Team:Operations) |
I don't think I think ultimately it would be ideal to schedule the jest suites using CI tasks rather than jest projects, mostly so we can execute them on multiple workers. That said we don't have CI tasks yet but it shouldn't be long. Additionally though, CI tasks are defined in groovy and we probably need to make sure that we're validating that all jest configs are included in some manifest that the pipeline code can rely on being up to date... |
|
Jest tests are currently organized into main configuration files (src/dev/jest/config.js and x-pack/dev-tools/jest/create_jest_config.js). Both of these are similar, but very slightly due to previously being in separate repositories. This change consolidates the scripts referenced in those configs and moves them to the `@kbn/test` project. OSS contained an alias for `test_utils`. Those aliases have been removed in favor of importing these utilities from `@kbn/test/jest` Blocker to elastic#72569 Signed-off-by: Tyler Smalley <[email protected]>
Jest tests are currently organized into main configuration files (src/dev/jest/config.js and x-pack/dev-tools/jest/create_jest_config.js). Both of these are similar, but very slightly due to previously being in separate repositories. This change consolidates the scripts referenced in those configs and moves them to the `@kbn/test` project. OSS contained an alias for `test_utils`. Those aliases have been removed in favor of importing these utilities from `@kbn/test/jest` Blocker to #72569 Signed-off-by: Tyler Smalley <[email protected]>
Jest tests are currently organized into main configuration files (src/dev/jest/config.js and x-pack/dev-tools/jest/create_jest_config.js). Both of these are similar, but very slightly due to previously being in separate repositories. This change consolidates the scripts referenced in those configs and moves them to the `@kbn/test` project. OSS contained an alias for `test_utils`. Those aliases have been removed in favor of importing these utilities from `@kbn/test/jest` Blocker to elastic#72569 Signed-off-by: Tyler Smalley <[email protected]>
Jest tests are currently organized into main configuration files (src/dev/jest/config.js and x-pack/dev-tools/jest/create_jest_config.js). Both of these are similar, but very slightly due to previously being in separate repositories. This change consolidates the scripts referenced in those configs and moves them to the `@kbn/test` project. OSS contained an alias for `test_utils`. Those aliases have been removed in favor of importing these utilities from `@kbn/test/jest` Blocker to #72569 Signed-off-by: Tyler Smalley <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
Jest tests are currently split into a few non-standard configurations injected through Node CLI scripts:
scripts/jest.js
:x-pack/scripts/jest.js
:There are a few reasons this is not ideal. Mainly, it has led to confusion to how Jest works for those otherwise familiar with it. In addition, we loose any benefits to tooling available which requires running Jest directly or referencing a configuration file.
Another issue we have is these configurations cover a vast amount of tests across large portions of the repository. Currently, the X-Pack Jest tests take an hour to complete on CI. This results in contributors temporarily using
.only
within their tests, or specifying--testPathPattern
. This really starts to break down when you would like to run all the tests for your plugin as you have to rely on naming convention which might change plugin-to-plugin.I propose we move to a having a base Jest configuration file which each plugin could extend, and a core jest.config.js file which defines a pattern for projects to cover those configuration files.
This will still allow for the entire suite of tests to be ran for CI while allowing contributors to run the unit tests of their plugin in isolation.
TODO:
The text was updated successfully, but these errors were encountered: