#NEWLINE# def process_run_result( self , result , context ) : #NEWLINE# #INDENT# counter = Counter ( ) #NEWLINE# for ir in result . iteration_results : #NEWLINE# #INDENT# counter [ ir . status ] += 1 #NEWLINE# #UNINDENT# outfile = os . path . join ( context . run_output_directory , 'status.txt' ) #NEWLINE# self . logger . info ( 'Status available in {}' . format ( outfile ) ) #NEWLINE# with open ( outfile , 'w' ) as wfh : #NEWLINE# #INDENT# wfh . write ( 'Run name: {}\n' . format ( context . run_info . run_name ) ) #NEWLINE# wfh . write ( 'Run status: {}\n' . format ( context . run_result . status ) ) #NEWLINE# wfh . write ( 'Date: {}\n' . format ( time . strftime ( '%c' ) ) ) #NEWLINE# wfh . write ( '{}/{} iterations completed without error\n' . format ( counter [ 'OK' ] , len ( result . iteration_results ) ) ) #NEWLINE# wfh . write ( '\n' ) #NEWLINE# status_lines = [ map ( str , [ ir . id , ir . spec . label , ir . iteration , ir . status , ( ( ir . events and ir . events [ 0 ] . message . split ( '\n' ) [ 0 ] ) or '' ) ] ) for ir in result . iteration_results ] #NEWLINE# write_table ( status_lines , wfh , align = '<<>><' ) #NEWLINE# #UNINDENT# context . add_artifact ( 'run_status_summary' , 'status.txt' , 'export' )