Commit 8af550df authored by Johan Helsing's avatar Johan Helsing

Don't run the health checks at the same time

parent 6abcd02d
...@@ -113,14 +113,15 @@ function listenForGerritChanges() { ...@@ -113,14 +113,15 @@ function listenForGerritChanges() {
testProcess.on('close', code => { testProcess.on('close', code => {
const failed = code != 0; const failed = code != 0;
const commit = `${change.number},${patchSet.number}`; const commit = `${change.number},${patchSet.number}`;
var message = 'Experimental QtWayland Bot: ' + var message = 'Experimental QtWayland Bot: Running headless tests for change ' +
`Running headless tests ${commit} ${failed ? 'failed' : 'succeeded'}`; `${change.number}, patch set #${patchSet.number} ${failed ? 'failed' : 'succeeded'}`;
if (failed) { if (failed) {
const codeReview = '-1'; const codeReview = '-1';
readLastLines.read(`logs/${containerName}.txt`, 10).then(lines => { const tailLines = 30;
const messageWithLogTail = message + lines; readLastLines.read(`logs/${containerName}.txt`, tailLines).then(lines => {
console.log(messageWithLogTail); const indentedLogTail = lines.replace(/^/mg, ' ');
//postGerritComment(commit, messageWithLogTail, codeReview); message = `${message}\n\nLast ${tailLines} lines of log:\n\n${indentedLogTail}`;
console.log(message);
postGerritComment(commit, message, codeReview); postGerritComment(commit, message, codeReview);
}).catch(reason => console.log('Couldn\'t get last lines of log file', reason)); }).catch(reason => console.log('Couldn\'t get last lines of log file', reason));
} else { } else {
...@@ -190,13 +191,16 @@ if (!fs.existsSync('logs')){ ...@@ -190,13 +191,16 @@ if (!fs.existsSync('logs')){
restoreTests(); restoreTests();
listenForGerritChanges(); listenForGerritChanges();
scheduleJob({hour: 12, minute: 0}, () => { scheduleJob({hour: 12, minute: 0}, () => {
console.log('Running daily checks'); console.log('Running daily health check for dev');
healthCheck('5.11');
healthCheck('dev'); healthCheck('dev');
}); });
scheduleJob({hour: 11, minute: 0}, () => {
console.log('Running daily health check for 5.11');
healthCheck('5.11');
});
// Run initial tests // Run initial tests
healthCheck('5.11'); //healthCheck('5.11');
healthCheck('dev'); //healthCheck('dev');
serveLogs(); serveLogs();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment