From 5a60919f3d1cf56892a879222afb40f1bd489b09 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 9 Nov 2018 14:54:55 -0500 Subject: [PATCH] Fix lerna concurrency=1 when testing on Windows scripts/lerna.js and the "test:theia" script in package.json do not agree on the format of the --concurrency flag. scripts/lerna.js has "--concurrency==1", while package.json has "--concurrency 1". When testing on Windows, we end up with both on the lerna command line, because scripts/lerna.js doesn't recognize that the flag is already present. Also, I don't think "--concurrency==1" is valid. "--concurrency 1" and "--concurrency=1" are valid. Funnily enough, when you pass the flag twice, it is not applied: $ npx lerna run test --concurrency=1 --concurrency=1 lerna info version 2.11.0 @theia/ext-scripts: yarn run v1.10.1 @theia/ext-scripts: $ echo 'skip' @theia/ext-scripts: skip @theia/ext-scripts: Done in 0.07s. @theia/plugin: yarn run v1.10.1 @theia/application-package: yarn run v1.10.1 @theia/tslint: yarn run v1.10.1 @theia/plugin: $ theiaext test @theia/tslint: $ theiaext test @theia/application-package: $ theiaext test ... Change both files to use "--concurrency=1". Change-Id: I64c1cb27a603fbb951ca07cea43f44cd104d4b60 Signed-off-by: Simon Marchi --- package.json | 2 +- scripts/lerna.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index a76af509ed3e8..b0aaba2f81b25 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "build:clean": "run prepare", "docs": "run docs \"@theia/!(example-)*\"", "test": "yarn test:theia && yarn test:electron && yarn test:browser", - "test:theia": "run test \"@theia/!(example-)*\" --stream --concurrency 1", + "test:theia": "run test \"@theia/!(example-)*\" --stream --concurrency=1", "test:browser": "yarn rebuild:browser && run test \"@theia/example-browser\"", "test:electron": "yarn rebuild:electron && run test \"@theia/example-electron\"", "rebuild:clean": "rimraf .browser_modules", diff --git a/scripts/lerna.js b/scripts/lerna.js index 0bf533e2156ea..714f02fc4a1ec 100644 --- a/scripts/lerna.js +++ b/scripts/lerna.js @@ -19,9 +19,9 @@ const path = require('path'); const lernaPath = path.resolve(__dirname, '..', 'node_modules', 'lerna', 'bin', 'lerna'); if (process.platform === 'win32') { - console.log('Parallel lerna execution is disabled on Windows. Falling back to sequential execution with the \'--concurrency==1\' flag.'); - if (process.argv.indexOf('--concurrency==1') === -1) { - process.argv.push('--concurrency==1'); + console.log('Parallel lerna execution is disabled on Windows. Falling back to sequential execution with the \'--concurrency=1\' flag.'); + if (process.argv.indexOf('--concurrency=1') === -1) { + process.argv.push('--concurrency=1'); } const parallelIndex = process.argv.indexOf('--parallel'); if (parallelIndex !== -1) { @@ -29,4 +29,4 @@ if (process.platform === 'win32') { } console.log('Running lerna as: ' + process.argv.join(' ')); } -require(lernaPath); \ No newline at end of file +require(lernaPath);