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))
done_states = {
'SUCCESS': 'success',
'UNSTABLE': 'failed',
'FAILURE': 'error',
'SUCCESS': {'api': 'success', 'human': 'passed'},
'UNSTABLE': {'api': 'failure', 'human': 'failed'},
'FAILURE': {'api': 'error', 'human': 'errored'},
}
state = msg['status']
if state not in done_states:
@ -57,8 +57,8 @@ def main(msg):
data = {
'username': 'All packages PR',
'status': done_states[state],
'comment': 'Package tests: %s' % (done_states[state]),
'status': done_states[state]['api'],
'comment': 'Package tests: %s' % (done_states[state]['human']),
'url': msg['build_url'],
}