Browse Source

Report buildset result in MQTT reporter

Change-Id: I9682caf98af870677e92a17fc822e0c570cea8df
changes/38/702838/3
Simon Westphahl 2 years ago
parent
commit
8d5025809c
  1. 4
      doc/source/reference/drivers/mqtt.rst
  2. 2
      tests/unit/test_connection.py
  3. 1
      zuul/driver/mqtt/mqttreporter.py

4
doc/source/reference/drivers/mqtt.rst

@ -66,6 +66,10 @@ An MQTT report uses this schema:
The buildset global uuid.
.. attr:: result
The buildset result
.. attr:: builds
The list of builds.

2
tests/unit/test_connection.py

@ -472,6 +472,7 @@ class TestMQTTConnection(ZuulTestCase):
mqtt_payload = start_event['msg']
self.assertEquals(mqtt_payload['project'], 'org/project')
self.assertEquals(mqtt_payload['branch'], 'master')
self.assertEquals(mqtt_payload['buildset']['result'], None)
self.assertEquals(mqtt_payload['buildset']['builds'][0]['job_name'],
'test')
self.assertNotIn('result', mqtt_payload['buildset']['builds'][0])
@ -481,6 +482,7 @@ class TestMQTTConnection(ZuulTestCase):
mqtt_payload = success_event['msg']
self.assertEquals(mqtt_payload['project'], 'org/project')
self.assertEquals(mqtt_payload['branch'], 'master')
self.assertEquals(mqtt_payload['buildset']['result'], 'SUCCESS')
builds = mqtt_payload['buildset']['builds']
test_job = [b for b in builds if b['job_name'] == 'test'][0]
dependent_test_job = [

1
zuul/driver/mqtt/mqttreporter.py

@ -47,6 +47,7 @@ class MQTTReporter(BaseReporter):
'enqueue_time': item.enqueue_time,
'buildset': {
'uuid': item.current_build_set.uuid,
'result': item.current_build_set.result,
'builds': []
},
'zuul_event_id': item.event.zuul_event_id,

Loading…
Cancel
Save