-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[test] merge x-pack jest config into root #41718
Conversation
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
There may be one lingering path related canvas test here, but the bulk of it is ready for review. Will get that fixed shortly. |
Pinging @elastic/kibana-operations |
💔 Build Failed |
@@ -372,7 +372,7 @@ The following table outlines possible test file locations and how to invoke them | |||
|
|||
| Test runner | Test location | Runner command (working directory is kibana root) | | |||
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | | |||
| Jest | `src/**/*.test.js`<br>`src/**/*.test.ts` | `node scripts/jest -t regexp [test path]` | | |||
| Jest | `src/**/*.test.{js,ts}`<br>`x-pack(\/legacy)?/plugins/*.test.{js,ts}` | `node scripts/jest -t regexp [test path]` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should avoid the specificity of the (\/legacy)?/plugins
bit, since it's already outdated based on the roots. We should probably just select all .test.{js,ts}
files in x-pack
@@ -37,6 +37,9 @@ export default { | |||
'<rootDir>/packages', | |||
'<rootDir>/src/test_utils', | |||
'<rootDir>/test/functional/services/remote', | |||
'<rootDir>/x-pack/plugins', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we can't just list <rootDir>/x-pack/
?
'^plugins/([^\/.]*)(.*)': '<rootDir>/src/legacy/core_plugins/$1/public$2', | ||
'^ui/(.*)': '<rootDir>/src/legacy/ui/public/$1', | ||
'^uiExports/(.*)': '<rootDir>/src/dev/jest/mocks/file_mock.js', | ||
'^test_utils/(.*)': '<rootDir>/src/test_utils/public/$1', | ||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/src/dev/jest/mocks/file_mock.js', | ||
'\\.(css|less|scss)$': '<rootDir>/src/dev/jest/mocks/style_mock.js', | ||
|
||
'^legacy/plugins/xpack_main/(.*);': '<rootDir>/x-pack/legacy/plugins/xpack_main/public/$1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this only match import x from 'legacy/plugins/xpack_main/...'
? I don't think we have any of those.
x-pack/package.json
Outdated
@@ -13,7 +13,6 @@ | |||
"test": "gulp test", | |||
"test:browser:dev": "gulp testbrowser-dev", | |||
"test:browser": "gulp testbrowser", | |||
"test:jest": "node scripts/jest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should keep this? node scripts/jest x-pack
?
x-pack/scripts/jest.js
Outdated
@@ -4,5 +4,4 @@ | |||
* you may not use this file except in compliance with the Elastic License. | |||
*/ | |||
|
|||
require('@kbn/plugin-helpers').babelRegister(); | |||
require('../dev-tools/jest').runJest(); | |||
require('../../scripts/jest'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we extend process.argv
to include x-pack
so that tests are filtered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is still in active development but the infra changes look fine to me.
Alrighty then, new PR. sorry for the notifications :) |
💔 Build FailedTo update your PR or re-run it, just comment with: |
This merges the jest config in x-pack with the core config at
src/dev
, and removes any duplicated code. All jest tests are (+x-pack) run withnode scripts/jest
.x-pack/scripts/jest
remains for backwards compatibility.Closes #19019
Closes #41129