mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
remote_runner: Use Error objects to convey pass/fail
This commit is contained in:
parent
4ec02a9af9
commit
7f57b17b2e
1 changed files with 8 additions and 6 deletions
|
@ -47,14 +47,14 @@ const sauceTestWorker = async.queue((testSettings, callback) => {
|
||||||
log(`Remote sauce test started! ${url}`, pfx);
|
log(`Remote sauce test started! ${url}`, pfx);
|
||||||
|
|
||||||
// tear down the test excecution
|
// tear down the test excecution
|
||||||
const stopSauce = (success, timesup) => {
|
const stopSauce = (err) => {
|
||||||
clearInterval(getStatusInterval);
|
clearInterval(getStatusInterval);
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
|
|
||||||
browser.quit(() => {
|
browser.quit(() => {
|
||||||
if (!success) process.exitCode = 1;
|
if (err) {
|
||||||
if (timesup) {
|
log(`[red]FAILED[clear] ${err}`, pfx);
|
||||||
log('[red]FAILED[clear] allowed test duration exceeded', pfx);
|
process.exitCode = 1;
|
||||||
}
|
}
|
||||||
log(`Remote sauce test finished! ${url}`, pfx);
|
log(`Remote sauce test finished! ${url}`, pfx);
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ const sauceTestWorker = async.queue((testSettings, callback) => {
|
||||||
* https://wiki.saucelabs.com/display/DOCS/Test+Configuration+Options#TestConfigurationOptions-Timeouts
|
* https://wiki.saucelabs.com/display/DOCS/Test+Configuration+Options#TestConfigurationOptions-Timeouts
|
||||||
*/
|
*/
|
||||||
const timeout = setTimeout(() => {
|
const timeout = setTimeout(() => {
|
||||||
stopSauce(false, true);
|
stopSauce(new Error('allowed test duration exceeded'));
|
||||||
}, 870000); // travis timeout is 15 minutes, set this to a slightly lower value
|
}, 870000); // travis timeout is 15 minutes, set this to a slightly lower value
|
||||||
|
|
||||||
// how many characters of the log have been sent to travis
|
// how many characters of the log have been sent to travis
|
||||||
|
@ -83,7 +83,9 @@ const sauceTestWorker = async.queue((testSettings, callback) => {
|
||||||
consoleText.substring(logIndex).split('\\n').forEach((line) => log(line, pfx));
|
consoleText.substring(logIndex).split('\\n').forEach((line) => log(line, pfx));
|
||||||
logIndex = consoleText.length;
|
logIndex = consoleText.length;
|
||||||
const [finished, nFailedStr] = consoleText.match(finishedRegex) || [];
|
const [finished, nFailedStr] = consoleText.match(finishedRegex) || [];
|
||||||
if (finished) stopSauce(nFailedStr === '0');
|
if (finished) {
|
||||||
|
stopSauce(nFailedStr === '0' ? null : new Error(`${nFailedStr} tests failed`));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}, 5000);
|
}, 5000);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue