@ -20,6 +20,7 @@
from __future__ import ( absolute_import , division , print_function )
from __future__ import ( absolute_import , division , print_function )
__metaclass__ = type
__metaclass__ = type
from ansible . utils . color import stringc
import requests
import requests
import sys
import sys
@ -53,11 +54,32 @@ def get_coverage_runs():
def pretty_coverage_runs ( runs ) :
def pretty_coverage_runs ( runs ) :
for run in sorted ( runs , key = lambda x : x [ ' endedAt ' ] ) :
ended = [ ]
in_progress = [ ]
for run in runs :
if run . get ( ' endedAt ' ) :
ended . append ( run )
else :
in_progress . append ( run )
for run in sorted ( ended , key = lambda x : x [ ' endedAt ' ] ) :
if run [ ' statusCode ' ] == 30 :
if run [ ' statusCode ' ] == 30 :
print ( ' 🙂 [PASS] https://app.shippable.com/github/ansible/ansible/runs/ %s ( %s ) ' % ( run [ ' runNumber ' ] , run [ ' endedAt ' ] ) )
print ( ' 🙂 [ %s ] https://app.shippable.com/github/ansible/ansible/runs/ %s ( %s ) ' % (
stringc ( ' PASS ' , ' green ' ) ,
run [ ' runNumber ' ] ,
run [ ' endedAt ' ] ) )
else :
else :
print ( ' 😢 [FAIL] https://app.shippable.com/github/ansible/ansible/runs/ %s ( %s ) ' % ( run [ ' runNumber ' ] , run [ ' endedAt ' ] ) )
print ( ' 😢 [ %s ] https://app.shippable.com/github/ansible/ansible/runs/ %s ( %s ) ' % (
stringc ( ' FAIL ' , ' red ' ) ,
run [ ' runNumber ' ] ,
run [ ' endedAt ' ] ) )
if in_progress :
print ( ' The following runs are ongoing: ' )
for run in in_progress :
print ( ' 🤔 [ %s ] https://app.shippable.com/github/ansible/ansible/runs/ %s ' % (
stringc ( ' FATE ' , ' yellow ' ) ,
run [ ' runNumber ' ] ) )
def main ( ) :
def main ( ) :