diff --git a/testrunner/client-simple-node/client.js b/testrunner/client-simple-node/client.js index e6446888..3effd2ea 100644 --- a/testrunner/client-simple-node/client.js +++ b/testrunner/client-simple-node/client.js @@ -55,7 +55,7 @@ function getBasicAuthHeader() { } function getUserAgent() { - return 'testrunner-client'; + return 'testrunner-client ' + clientConfig.clientName; } function serverAuthCheck(res) { @@ -73,7 +73,7 @@ function postJson(path, request, cb) { 'User-Agent': getUserAgent(), 'Authorization': getBasicAuthHeader(), 'Content-Type': 'application/json', - 'Content-Length': requestData.length, + 'Content-Length': requestData.length }; var options = { host: clientConfig.serverHost, @@ -291,6 +291,7 @@ function processSimpleScriptJob(rep) { // XXX: indicate possibly transient nature of error postJson('/finish-commit-simple', { + client_name: clientConfig.clientName, repo: assert(repo), repo_full: assert(repoFull), repo_clone_url: assert(repoCloneUrl), @@ -321,6 +322,7 @@ function requestAndExecute() { } postJson('/get-commit-simple', { + client_name: clientConfig.clientName, contexts: contexts }).then(function (rep) { console.log(rep); diff --git a/testrunner/client-simple-node/config.yaml.template b/testrunner/client-simple-node/config.yaml.template index b3fffd56..a2e2ed47 100644 --- a/testrunner/client-simple-node/config.yaml.template +++ b/testrunner/client-simple-node/config.yaml.template @@ -12,6 +12,9 @@ serverAuthPassword: 'foobarx' clientAuthUsername: 'foouser' clientAuthPassword: 'foopass' +# Client name (human readable), should be User-Agent compatible. +clientName: 'test-client' + # Sleeps between successful/failed jobs. sleepJobSuccess: 10000 sleepJobFailure: 60000 diff --git a/testrunner/server-node/githubutil.js b/testrunner/server-node/githubutil.js index a8198a05..53c3f757 100644 --- a/testrunner/server-node/githubutil.js +++ b/testrunner/server-node/githubutil.js @@ -241,7 +241,7 @@ function handleGetCommitRequests(state) { context: assert(ctx), state: 'pending', target_url: 'http://duktape.org/', // XXX: useful temporary URI? web UI job status? - description: 'Running...' + description: 'Running... (' + (client.client_name || 'no client name') + ')' }); // XXX: error recovery / restart; check for start_time @@ -362,7 +362,8 @@ function makeGetCommitSimpleHandler(state) { getCommitRequests.push({ time: Date.now(), res: res, - contexts: assert(body.contexts) + contexts: assert(body.contexts), + client_name: body.client_name }); handleGetCommitRequests(state); };