Merge "Add role information to task in zuul_json callback"

This commit is contained in:
Zuul
2018-06-01 21:08:11 +00:00
committed by Gerrit Code Review
5 changed files with 32 additions and 1 deletions

View File

@@ -81,6 +81,19 @@ class TestZuulJSON(AnsibleZuulTestCase):
self.assertIn('rosebud', text)
self.assertNotIn('setec', text)
def test_json_role_log(self):
job = self._run_job('json-role')
with self.jobLog(job):
build = self.history[-1]
self.assertEqual(build.result, 'SUCCESS')
text = self._get_json_as_text(build)
self.assertIn('json-role', text)
json_result = json.loads(text)
role_name = json_result[0]['plays'][0]['tasks'][0]['role']['name']
self.assertEqual('json-role', role_name)
def test_json_time_log(self):
job = self._run_job('no-log')
with self.jobLog(job):