mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Enterprise Search] chore: break-up public tests (#163358)
## Summary Our public folder tests are taking 35-40+m to run in CI. To try and mitigate this we are splitting the jest tests configs to each of the application folders to allow workers to run them separately. I also added a `jest.config.dev.js` file to the `enterprise_search` plugin root which allows you to run `./jest.sh` to run all of the projects with a single command locally. On my laptop I am seeing this take a similar amount of time to run all the projects, but it can vary. before (3 projects) ``` Test Suites: 880 passed, 880 total Tests: 5513 passed, 5513 total Snapshots: 29 passed, 29 total Time: 286.798 s Ran all test suites in 3 projects. ✨ Done in 289.12s. ``` after (14 projects) ``` Test Suites: 884 passed, 884 total Tests: 5513 passed, 5513 total Snapshots: 29 passed, 29 total Time: 301.281 s Ran all test suites in 14 projects. ✨ Done in 303.59s. ``` --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
924b8e9074
commit
13a74337bd
13 changed files with 311 additions and 1 deletions
16
x-pack/plugins/enterprise_search/jest.config.dev.js
Normal file
16
x-pack/plugins/enterprise_search/jest.config.dev.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../',
|
||||
projects: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/**/jest.config.js',
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/common/**/jest.config.js',
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/server/**/jest.config.js',
|
||||
],
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../../../..',
|
||||
roots: ['<rootDir>/x-pack/plugins/enterprise_search/public/applications/analytics'],
|
||||
collectCoverage: true,
|
||||
coverageReporters: ['text', 'html'],
|
||||
collectCoverageFrom: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/**/*.{ts,tsx}',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/server/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/applications/test_helpers/**/*.{ts,tsx}',
|
||||
],
|
||||
coverageDirectory:
|
||||
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/enterprise_search/public/applications/analytics',
|
||||
modulePathIgnorePatterns: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/app_search/cypress',
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress',
|
||||
],
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../../../..',
|
||||
roots: ['<rootDir>/x-pack/plugins/enterprise_search/public/applications/app_search'],
|
||||
collectCoverage: true,
|
||||
coverageReporters: ['text', 'html'],
|
||||
collectCoverageFrom: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/**/*.{ts,tsx}',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/server/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/applications/test_helpers/**/*.{ts,tsx}',
|
||||
],
|
||||
coverageDirectory:
|
||||
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/enterprise_search/public/applications/app_search',
|
||||
modulePathIgnorePatterns: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/app_search/cypress',
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress',
|
||||
],
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../../../..',
|
||||
roots: ['<rootDir>/x-pack/plugins/enterprise_search/public/applications/applications'],
|
||||
collectCoverage: true,
|
||||
coverageReporters: ['text', 'html'],
|
||||
collectCoverageFrom: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/**/*.{ts,tsx}',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/server/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/applications/test_helpers/**/*.{ts,tsx}',
|
||||
],
|
||||
coverageDirectory:
|
||||
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/enterprise_search/public/applications/applications',
|
||||
modulePathIgnorePatterns: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/app_search/cypress',
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress',
|
||||
],
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../../../..',
|
||||
roots: ['<rootDir>/x-pack/plugins/enterprise_search/public/applications/elasticsearch'],
|
||||
collectCoverage: true,
|
||||
coverageReporters: ['text', 'html'],
|
||||
collectCoverageFrom: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/**/*.{ts,tsx}',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/server/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/applications/test_helpers/**/*.{ts,tsx}',
|
||||
],
|
||||
coverageDirectory:
|
||||
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/enterprise_search/public/applications/elasticsearch',
|
||||
modulePathIgnorePatterns: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/app_search/cypress',
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress',
|
||||
],
|
||||
};
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../../../..',
|
||||
roots: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content',
|
||||
],
|
||||
collectCoverage: true,
|
||||
coverageReporters: ['text', 'html'],
|
||||
collectCoverageFrom: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/**/*.{ts,tsx}',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/server/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/applications/test_helpers/**/*.{ts,tsx}',
|
||||
],
|
||||
coverageDirectory:
|
||||
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content',
|
||||
modulePathIgnorePatterns: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/app_search/cypress',
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress',
|
||||
],
|
||||
};
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../../../..',
|
||||
roots: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview',
|
||||
],
|
||||
collectCoverage: true,
|
||||
coverageReporters: ['text', 'html'],
|
||||
collectCoverageFrom: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/**/*.{ts,tsx}',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/server/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/applications/test_helpers/**/*.{ts,tsx}',
|
||||
],
|
||||
coverageDirectory:
|
||||
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview',
|
||||
modulePathIgnorePatterns: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/app_search/cypress',
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress',
|
||||
],
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../../../..',
|
||||
roots: ['<rootDir>/x-pack/plugins/enterprise_search/public/applications/esre'],
|
||||
collectCoverage: true,
|
||||
coverageReporters: ['text', 'html'],
|
||||
collectCoverageFrom: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/**/*.{ts,tsx}',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/server/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/applications/test_helpers/**/*.{ts,tsx}',
|
||||
],
|
||||
coverageDirectory:
|
||||
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/enterprise_search/public/applications/esre',
|
||||
modulePathIgnorePatterns: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/app_search/cypress',
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress',
|
||||
],
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../../../..',
|
||||
roots: ['<rootDir>/x-pack/plugins/enterprise_search/public/applications/search_experiences'],
|
||||
collectCoverage: true,
|
||||
coverageReporters: ['text', 'html'],
|
||||
collectCoverageFrom: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/**/*.{ts,tsx}',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/server/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/applications/test_helpers/**/*.{ts,tsx}',
|
||||
],
|
||||
coverageDirectory:
|
||||
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/enterprise_search/public/applications/search_experiences',
|
||||
modulePathIgnorePatterns: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/app_search/cypress',
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress',
|
||||
],
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../../../..',
|
||||
roots: ['<rootDir>/x-pack/plugins/enterprise_search/public/applications/shared'],
|
||||
collectCoverage: true,
|
||||
coverageReporters: ['text', 'html'],
|
||||
collectCoverageFrom: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/**/*.{ts,tsx}',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/server/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/applications/test_helpers/**/*.{ts,tsx}',
|
||||
],
|
||||
coverageDirectory:
|
||||
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/enterprise_search/public/applications/shared',
|
||||
modulePathIgnorePatterns: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/app_search/cypress',
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress',
|
||||
],
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../../../..',
|
||||
roots: ['<rootDir>/x-pack/plugins/enterprise_search/public/applications/vector_search'],
|
||||
collectCoverage: true,
|
||||
coverageReporters: ['text', 'html'],
|
||||
collectCoverageFrom: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/**/*.{ts,tsx}',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/server/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/applications/test_helpers/**/*.{ts,tsx}',
|
||||
],
|
||||
coverageDirectory:
|
||||
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/enterprise_search/public/applications/vector_search',
|
||||
modulePathIgnorePatterns: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/app_search/cypress',
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress',
|
||||
],
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../../../..',
|
||||
roots: ['<rootDir>/x-pack/plugins/enterprise_search/public/applications/workplace_search'],
|
||||
collectCoverage: true,
|
||||
coverageReporters: ['text', 'html'],
|
||||
collectCoverageFrom: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/**/*.{ts,tsx}',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/server/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/applications/test_helpers/**/*.{ts,tsx}',
|
||||
],
|
||||
coverageDirectory:
|
||||
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/enterprise_search/public/applications/workplace_search',
|
||||
modulePathIgnorePatterns: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/app_search/cypress',
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/workplace_search/cypress',
|
||||
],
|
||||
};
|
|
@ -8,11 +8,15 @@
|
|||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../..',
|
||||
/** all nested directories have their own Jest config file */
|
||||
testMatch: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/*.test.{js,mjs,ts,tsx}',
|
||||
],
|
||||
roots: ['<rootDir>/x-pack/plugins/enterprise_search/public'],
|
||||
collectCoverage: true,
|
||||
coverageReporters: ['text', 'html'],
|
||||
collectCoverageFrom: [
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/**/*.{ts,tsx}',
|
||||
'<rootDir>/x-pack/plugins/enterprise_search/public/applications/*.{ts,tsx}',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/server/*.ts',
|
||||
'!<rootDir>/x-pack/plugins/enterprise_search/public/applications/test_helpers/**/*.{ts,tsx}',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue