From cc81252a7ad3263e4500fd1302bad13f359863f7 Mon Sep 17 00:00:00 2001 From: Dario Gieselaar Date: Thu, 8 Apr 2021 13:33:39 +0200 Subject: [PATCH] [APM] Run precommit tasks sequentially 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. --- x-pack/plugins/apm/scripts/precommit.js | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/x-pack/plugins/apm/scripts/precommit.js b/x-pack/plugins/apm/scripts/precommit.js index 695a9ba70f5d7..88d2e169dd542 100644 --- a/x-pack/plugins/apm/scripts/precommit.js +++ b/x-pack/plugins/apm/scripts/precommit.js @@ -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', @@ -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) => {