Better cope with the different state returned by the CI pipeline

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2018-08-17 14:25:51 +02:00
parent 1447416794
commit 7e999006bb

View file

@ -38,9 +38,9 @@ def main(msg):
'https://', requests.adapters.HTTPAdapter(max_retries=retry_conf)) 'https://', requests.adapters.HTTPAdapter(max_retries=retry_conf))
done_states = { done_states = {
'SUCCESS': 'success', 'SUCCESS': {'api': 'success', 'human': 'passed'},
'UNSTABLE': 'failed', 'UNSTABLE': {'api': 'failure', 'human': 'failed'},
'FAILURE': 'error', 'FAILURE': {'api': 'error', 'human': 'errored'},
} }
state = msg['status'] state = msg['status']
if state not in done_states: if state not in done_states:
@ -57,8 +57,8 @@ def main(msg):
data = { data = {
'username': 'All packages PR', 'username': 'All packages PR',
'status': done_states[state], 'status': done_states[state]['api'],
'comment': 'Package tests: %s' % (done_states[state]), 'comment': 'Package tests: %s' % (done_states[state]['human']),
'url': msg['build_url'], 'url': msg['build_url'],
} }