Skip to content

Commit 5af728a

Browse files
committed
robust approach to get runner id
1 parent 0e2112a commit 5af728a

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

lib/job.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,11 @@ Job.prototype = {
328328
branch: this.job.ref.branch,
329329
project: this.project,
330330

331-
runnerId: this.config.branchConfig.runner.id
331+
runnerId: (
332+
this.config.branchConfig
333+
&& this.config.branchConfig.runner
334+
&& this.config.branchConfig.runner.id || 'unkown'
335+
)
332336
};
333337

334338
return context;

test/test_run.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ describe('Integration', function () {
5353
}], { // config
5454
dataDir: '/tmp/',
5555
cachier: cachier,
56-
io: new EventEmitter(),
57-
branchConfig : { runner : { id : 'dummy' } }
56+
io: new EventEmitter()
5857
}, function (err) {
5958
if (err) return done(err)
6059
for (var name in called) {

0 commit comments

Comments
 (0)