Commit 6e3f755a authored by Johan Helsing's avatar Johan Helsing

Add support for custom images in health check

parent 648e4307
......@@ -37,6 +37,7 @@ function saveTests() {
function startDockerTest(test, callback) {
test.title = test.title || test.containerName;
test.image = test.image || 'docker-qt-tests';
const { qtWaylandRev, qt5Rev, containerName, title, config } = test;
const environment = {
QT_DOCKERTEST_QTWAYLAND_REV: qtWaylandRev,
......@@ -45,7 +46,7 @@ function startDockerTest(test, callback) {
const envArgs = reduce(environment, (args, value, key) => args.concat(['-e', `${key}=${value}`]), []);
const ccacheArgs = ccacheVolume ? ['-v', 'ccache:/home/build/.ccache'] : [];
const configArgs = config ? ['-v', `${__dirname}/configs/${config}.opt:/etc/qt/config.opt`] : [];
const args = [].concat(['run', '--name', containerName], configArgs, ccacheArgs, envArgs, ['docker-qt-tests']);
const args = [].concat(['run', '--name', containerName], configArgs, ccacheArgs, envArgs, [image]);
console.log('docker ' + args.join(' '));
const testProcess = spawn('docker', args);
test.status = 'running';
......@@ -178,7 +179,7 @@ function testsPage(tests) {
${test.title} -
Qt: ${test.qt5Rev} -
QtWayland: ${test.qtWaylandRev} -
${test.status} -
${test.status} -
${test.url ? `<a href="${test.url}">${test.url}</a> - ` : ''}
<a href="logs/${test.containerName}.txt">log</a>
</li>
......@@ -197,11 +198,14 @@ function serveLogs() {
server.listen(8056);
}
function healthCheck(rev, config) {
config = config || 'standard';
function healthCheck(opts) {
opts = opts || {};
const { image } = opts;
const config = opts.config || 'standard';
const rev = opts.rev || 'dev';
const containerName = `gerrit-watcher-health-check-${rev}-${config}-${unixTimeStamp()}`
const title = `Health check (${config}) ${rev} ${new Date().toISOString()}`;
startDockerTest({qtWaylandRev: rev, qt5Rev: rev, containerName, title, config });
startDockerTest({qtWaylandRev: rev, qt5Rev: rev, containerName, title, config, image });
}
if (!fs.existsSync('logs')){
......@@ -212,16 +216,17 @@ restoreTests();
listenForGerritChanges();
scheduleJob({hour: 0, minute: 0}, () => {
console.log('Running daily health check for dev');
healthCheck('dev');
healthCheck();
});
scheduleJob({hour: 23, minute: 0}, () => {
console.log('Running daily health check for 5.11');
healthCheck('5.11');
healthCheck({rev: '5.11'});
});
// Run initial tests
//healthCheck('5.11');
//healthCheck('dev');
//healthCheck('dev', 'static');
//healthCheck();
//healthCheck({rev: '5.11'});
//healthCheck({config: 'static'});
healthCheck({config: 'old-libwayland', image:'docker-qt-tests-old-libwayland'});
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