mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
remote_runner: Simplify finished test check
This commit is contained in:
parent
b0e367a982
commit
4ec02a9af9
1 changed files with 4 additions and 12 deletions
|
@ -28,6 +28,8 @@ const log = (msg, pfx = '') => {
|
||||||
console.log(`${pfx}${msg.replace(colorRegex, (m, p1) => colorSubst[p1])}`);
|
console.log(`${pfx}${msg.replace(colorRegex, (m, p1) => colorSubst[p1])}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const finishedRegex = /FINISHED.*[0-9]+ tests passed, ([0-9]+) tests failed/;
|
||||||
|
|
||||||
const sauceTestWorker = async.queue((testSettings, callback) => {
|
const sauceTestWorker = async.queue((testSettings, callback) => {
|
||||||
const name = `${testSettings.browserName} ${testSettings.version}, ${testSettings.platform}`;
|
const name = `${testSettings.browserName} ${testSettings.version}, ${testSettings.platform}`;
|
||||||
const pfx = `[${name}] `;
|
const pfx = `[${name}] `;
|
||||||
|
@ -80,18 +82,8 @@ 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;
|
||||||
if (consoleText.indexOf('FINISHED') > 0) {
|
const [finished, nFailedStr] = consoleText.match(finishedRegex) || [];
|
||||||
const match = consoleText.match(
|
if (finished) stopSauce(nFailedStr === '0');
|
||||||
/FINISHED.*([0-9]+) tests passed, ([0-9]+) tests failed/);
|
|
||||||
// finished without failures
|
|
||||||
if (match[2] && match[2] === '0') {
|
|
||||||
stopSauce(true);
|
|
||||||
|
|
||||||
// finished but some tests did not return or some tests failed
|
|
||||||
} else {
|
|
||||||
stopSauce(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}, 5000);
|
}, 5000);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue