Skip to content

Commit

Permalink
[APM] Run precommit tasks sequentially
Browse files Browse the repository at this point in the history
Jest seems to panic when running in parallel with the other tasks, possibly due to resource issues. Running the tasks sequentially looks to be more reliable.
  • Loading branch information
dgieselaar committed Apr 8, 2021
1 parent 7984745 commit cc81252
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions x-pack/plugins/apm/scripts/precommit.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,8 @@ const testTsconfig = resolve(root, 'x-pack/test/tsconfig.json');
const tasks = new Listr(
[
{
title: 'Jest',
task: () =>
execa(
'node',
[
resolve(__dirname, './jest.js'),
'--reporters',
resolve(__dirname, '../../../../node_modules/jest-silent-reporter'),
'--collect-coverage',
'false',
],
execaOpts
),
title: 'Lint',
task: () => execa('node', [resolve(__dirname, 'eslint.js')], execaOpts),
},
{
title: 'Typescript',
Expand Down Expand Up @@ -72,11 +61,22 @@ const tasks = new Listr(
),
},
{
title: 'Lint',
task: () => execa('node', [resolve(__dirname, 'eslint.js')], execaOpts),
title: 'Jest',
task: () =>
execa(
'node',
[
resolve(__dirname, './jest.js'),
'--reporters',
resolve(__dirname, '../../../../node_modules/jest-silent-reporter'),
'--collect-coverage',
'false',
],
execaOpts
),
},
],
{ exitOnError: true, concurrent: true }
{ exitOnError: true, concurrent: false }
);

tasks.run().catch((error) => {
Expand Down

0 comments on commit cc81252

Please sign in to comment.