Skip to content

Commit

Permalink
Fix lerna concurrency=1 when testing on Windows
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Simon Marchi authored and kittaakos committed Nov 12, 2018
1 parent 18dfb32 commit 5a60919
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions scripts/lerna.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ 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) {
process.argv[parallelIndex] = '--stream';
}
console.log('Running lerna as: ' + process.argv.join(' '));
}
require(lernaPath);
require(lernaPath);

0 comments on commit 5a60919

Please sign in to comment.