Skip to content

Commit 1400711

Browse files
committed
Fix for retrieving test results
1 parent 494c8a4 commit 1400711

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ function loadTestRecords(id) {
8686
srv.get('/github/:id', function (req, res) {
8787
console.log('Request for test results for commit ' + req.params.id.substring(0,6))
8888
const record = loadTestRecords(req.params.id);
89-
res.send(record['results']);
89+
if (typeof record == 'undefined') {
90+
res.statusCode = 404;
91+
res.send(`Record for commit ${req.params.id} not found`);
92+
} else {
93+
res.send(record['results']);
94+
}
9095
});
9196

9297
// Serve the coverage results
@@ -241,7 +246,7 @@ queue.on('finish', job => { // On job end post result to API
241246
accept: "application/vnd.github.machine-man-preview+json"},
242247
sha: job.data['sha'],
243248
state: job.data['status'],
244-
target_url: `${process.env.WEBHOOK_PROXY_URL}/events/${job.data.sha}`, // FIXME replace url
249+
target_url: `${process.env.WEBHOOK_PROXY_URL}/github/${job.data.sha}`, // FIXME replace url
245250
description: job.data['context'],
246251
context: 'continuous-integration/ZTEST'
247252
});

runAllTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function runAllTests(id, repo)
1010
%% Initialize enviroment
1111
dbPath = 'C:\Users\Experiment\db.json';
1212
fprintf('Running tests\n')
13-
fprintf('Repo = %s\n', repo)
13+
fprintf('Repo = %s, sha = %s\n', repo, id)
1414
origDir = pwd;
1515
cleanup = onCleanup(@() cd(origDir));
1616
cd(fullfile(fileparts(which('addRigboxPaths')),'tests'))

0 commit comments

Comments
 (0)