Set context properly for reporter

This commit is contained in:
Marvin Pohl 2018-09-27 20:57:39 +02:00
parent d7f34fc6dd
commit df5fa87d2d
2 changed files with 7 additions and 7 deletions

View File

@ -76,7 +76,7 @@ class GiteaStatusPush(http.HttpStatusPushBase):
payload['target_url'] = target_url
if context is not None:
payload['name'] = context
payload['context'] = context
return self._http.post(
'/api/v1/repos/{owner}/{repository}/statuses/{sha}'.format(

View File

@ -66,19 +66,19 @@ class TestGiteaStatusPush(
'/api/v1/repos/buildbot/buildbot/statuses/d34db33fd43db33f',
json={'state': 'pending',
'target_url': 'http://localhost:8080/#builders/79/builds/0',
'description': 'Build started.', 'name': 'buildbot/Builder0'})
'description': 'Build started.', 'context': 'buildbot/Builder0'})
self._http.expect(
'post',
'/api/v1/repos/buildbot/buildbot/statuses/d34db33fd43db33f',
json={'state': 'success',
'target_url': 'http://localhost:8080/#builders/79/builds/0',
'description': 'Build done.', 'name': 'buildbot/Builder0'})
'description': 'Build done.', 'context': 'buildbot/Builder0'})
self._http.expect(
'post',
'/api/v1/repos/buildbot/buildbot/statuses/d34db33fd43db33f',
json={'state': 'failure',
'target_url': 'http://localhost:8080/#builders/79/builds/0',
'description': 'Build done.', 'name': 'buildbot/Builder0'})
'description': 'Build done.', 'context': 'buildbot/Builder0'})
build['complete'] = False
self.sp.buildStarted(("build", 20, "started"), build)
@ -98,7 +98,7 @@ class TestGiteaStatusPush(
'/api/v1/repos/buildbot/buildbot/statuses/d34db33fd43db33f',
json={'state': 'pending',
'target_url': 'http://localhost:8080/#builders/79/builds/0',
'description': 'Build started.', 'name': 'buildbot/Builder0'})
'description': 'Build started.', 'context': 'buildbot/Builder0'})
build['complete'] = False
self.sp.buildStarted(("build", 20, "started"), build)
@ -112,7 +112,7 @@ class TestGiteaStatusPush(
'/api/v1/repos/buildbot/buildbot/statuses/d34db33fd43db33f',
json={'state': 'pending',
'target_url': 'http://localhost:8080/#builders/79/builds/0',
'description': 'Build started.', 'name': 'buildbot/Builder0'})
'description': 'Build started.', 'context': 'buildbot/Builder0'})
build['complete'] = False
self.sp.buildStarted(("build", 20, "started"), build)
@ -153,7 +153,7 @@ class TestGiteaStatusPush(
'/api/v1/repos/buildbot/buildbot/statuses/d34db33fd43db33f',
json={'state': 'pending',
'target_url': 'http://localhost:8080/#builders/79/builds/0',
'description': 'Build started.', 'name': 'buildbot/Builder0'},
'description': 'Build started.', 'context': 'buildbot/Builder0'},
content_json={'message': 'sha1 not found for branch master'},
code=404)
build['complete'] = False