Skip to content

Commit

Permalink
Revert "[ci] Run Jest tests in parallel (#115687)"
Browse files Browse the repository at this point in the history
This reverts commit 237d68d.
  • Loading branch information
Tyler Smalley committed Nov 2, 2021
1 parent 5d55753 commit 98de5f6
Show file tree
Hide file tree
Showing 14 changed files with 93 additions and 66 deletions.
15 changes: 7 additions & 8 deletions .buildkite/pipelines/hourly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,6 @@ steps:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/test/jest.sh
label: 'Jest Tests'
parallelism: 6
agents:
queue: n2-4
timeout_in_minutes: 90
key: jest

- command: .buildkite/scripts/steps/test/jest_integration.sh
label: 'Jest Integration Tests'
agents:
Expand All @@ -141,6 +133,13 @@ steps:
timeout_in_minutes: 120
key: api-integration

- command: .buildkite/scripts/steps/test/jest.sh
label: 'Jest Tests'
agents:
queue: c2-16
timeout_in_minutes: 120
key: jest

- command: .buildkite/scripts/steps/lint.sh
label: 'Linting'
agents:
Expand Down
15 changes: 7 additions & 8 deletions .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,6 @@ steps:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/test/jest.sh
label: 'Jest Tests'
parallelism: 6
agents:
queue: n2-4
timeout_in_minutes: 90
key: jest

- command: .buildkite/scripts/steps/test/jest_integration.sh
label: 'Jest Integration Tests'
agents:
Expand All @@ -139,6 +131,13 @@ steps:
timeout_in_minutes: 120
key: api-integration

- command: .buildkite/scripts/steps/test/jest.sh
label: 'Jest Tests'
agents:
queue: c2-16
timeout_in_minutes: 120
key: jest

- command: .buildkite/scripts/steps/lint.sh
label: 'Linting'
agents:
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/test/jest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ is_test_execution_step
.buildkite/scripts/bootstrap.sh

echo '--- Jest'
checks-reporter-with-killswitch "Jest Unit Tests $((BUILDKITE_PARALLEL_JOB+1))" \
.buildkite/scripts/steps/test/jest_parallel.sh
checks-reporter-with-killswitch "Jest Unit Tests" \
node scripts/jest --ci --verbose --maxWorkers=10
28 changes: 0 additions & 28 deletions .buildkite/scripts/steps/test/jest_parallel.sh

This file was deleted.

6 changes: 2 additions & 4 deletions packages/kbn-cli-dev-mode/src/dev_server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ expect.addSnapshotSerializer(extendedEnvSerializer);
beforeEach(() => {
jest.clearAllMocks();
log.messages.length = 0;
process.execArgv = ['--inheritted', '--exec', '--argv'];
currentProc = undefined;
});

Expand Down Expand Up @@ -139,9 +138,8 @@ describe('#run$', () => {
"isDevCliChild": "true",
},
"nodeOptions": Array [
"--inheritted",
"--exec",
"--argv",
"--preserve-symlinks-main",
"--preserve-symlinks",
],
"stdio": "pipe",
},
Expand Down
13 changes: 13 additions & 0 deletions packages/kbn-rule-data-utils/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-rule-data-utils'],
};
13 changes: 13 additions & 0 deletions packages/kbn-securitysolution-list-constants/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-securitysolution-list-constants'],
};
13 changes: 13 additions & 0 deletions packages/kbn-securitysolution-t-grid/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-securitysolution-t-grid'],
};
10 changes: 1 addition & 9 deletions packages/kbn-test/jest-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,7 @@ module.exports = {
modulePathIgnorePatterns: ['__fixtures__/', 'target/'],

// Use this configuration option to add custom reporters to Jest
reporters: [
'default',
[
'@kbn/test/target_node/jest/junit_reporter',
{
rootDirectory: '.',
},
],
],
reporters: ['default', '@kbn/test/target_node/jest/junit_reporter'],

// The paths to modules that run some code to configure or set up the testing environment before each test
setupFiles: [
Expand Down
5 changes: 2 additions & 3 deletions packages/kbn-test/src/jest/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,11 @@ export function runJest(configName = 'jest.config.js') {

const runStartTime = Date.now();
const reportTime = getTimeReporter(log, 'scripts/jest');

let cwd: string;
let testFiles: string[];

const cwd: string = process.env.INIT_CWD || process.cwd();

if (!argv.config) {
cwd = process.env.INIT_CWD || process.cwd();
testFiles = argv._.splice(2).map((p) => resolve(cwd, p));
const commonTestFiles = commonBasePath(testFiles);
const testFilesProvided = testFiles.length > 0;
Expand Down
16 changes: 16 additions & 0 deletions src/plugins/expression_error/jest.config.js
Original file line number Diff line number Diff line change
@@ -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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../../..',
roots: ['<rootDir>/src/plugins/expression_error'],
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/src/plugins/expression_error',
coverageReporters: ['text', 'html'],
collectCoverageFrom: ['<rootDir>/src/plugins/expression_error/{common,public}/**/*.{ts,tsx}'],
};
15 changes: 15 additions & 0 deletions x-pack/plugins/metrics_entities/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* 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 = {
collectCoverageFrom: ['<rootDir>/x-pack/plugins/metrics_entities/{common,server}/**/*.{ts,tsx}'],
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/metrics_entities',
coverageReporters: ['text', 'html'],
preset: '@kbn/test',
rootDir: '../../..',
roots: ['<rootDir>/x-pack/plugins/metrics_entities'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import { LevelLogger } from '../../lib';
jest.mock('./checksum');
jest.mock('./download');

// https://github.com/elastic/kibana/issues/115881
describe.skip('ensureBrowserDownloaded', () => {
describe('ensureBrowserDownloaded', () => {
let logger: jest.Mocked<LevelLogger>;

beforeEach(() => {
Expand Down
3 changes: 1 addition & 2 deletions x-pack/plugins/reporting/server/routes/deprecations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ import { registerDeprecationsRoutes } from './deprecations';

type SetupServerReturn = UnwrapPromise<ReturnType<typeof setupServer>>;

// https://github.com/elastic/kibana/issues/115881
describe.skip(`GET ${API_GET_ILM_POLICY_STATUS}`, () => {
describe(`GET ${API_GET_ILM_POLICY_STATUS}`, () => {
const reportingSymbol = Symbol('reporting');
let server: SetupServerReturn['server'];
let httpSetup: SetupServerReturn['httpSetup'];
Expand Down

0 comments on commit 98de5f6

Please sign in to comment.