From 5b4e964ae8afebe71997da0e00a0723e590a6670 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Wed, 25 May 2016 00:06:47 -0700 Subject: [PATCH 1/2] do not swallow test execution errors --- Jakefile.js | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/Jakefile.js b/Jakefile.js index 55113f986bcfd..7cf6e67bb066a 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -726,24 +726,39 @@ function runConsoleTests(defaultReporter, defaultSubsets) { subsetRegexes = subsets.map(function (sub) { return "^" + sub + ".*$"; }); subsetRegexes.push("^(?!" + subsets.join("|") + ").*$"); } + var counter = subsetRegexes.length; + var errorStatus; subsetRegexes.forEach(function (subsetRegex, i) { tests = subsetRegex ? ' -g "' + subsetRegex + '"' : ''; var cmd = "mocha" + (debug ? " --debug-brk" : "") + " -R " + reporter + tests + colors + ' -t ' + testTimeout + ' ' + run; console.log(cmd); - function finish() { + function finish(status) { + counter--; + // save first error status + if (status !== undefined && errorStatus === undefined) { + errorStatus = status; + } + deleteTemporaryProjectOutput(); - complete(); + if (counter !== 0 || errorStatus === undefined) { + if (lintFlag) { + var lint = jake.Task['lint']; + lint.addListener('complete', function () { + complete(); + }); + lint.invoke(); + } + complete(); + } + else { + fail("Process exited with code " + status); + } } exec(cmd, function () { - if (lintFlag && i === 0) { - var lint = jake.Task['lint']; - lint.addListener('complete', function () { - complete(); - }); - lint.invoke(); - } finish(); - }, finish); + }, function(e, status) { + finish(status); + }); }); } From c4b517ce450b72ee3bfcbe67dd46740079f689fe Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Wed, 25 May 2016 09:42:59 -0700 Subject: [PATCH 2/2] run linter once after last worker is finished in case if there are no errors --- Jakefile.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jakefile.js b/Jakefile.js index 7cf6e67bb066a..59d9b69021085 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -741,7 +741,8 @@ function runConsoleTests(defaultReporter, defaultSubsets) { deleteTemporaryProjectOutput(); if (counter !== 0 || errorStatus === undefined) { - if (lintFlag) { + // run linter when last worker is finished + if (lintFlag && counter === 0) { var lint = jake.Task['lint']; lint.addListener('complete', function () { complete();