#NEWLINE# def _generate_remarkup_table_for_tests( build , tests ) : #NEWLINE# #INDENT# num_failures = len ( tests ) #NEWLINE# did_truncate = False #NEWLINE# max_shown = current_app . config . get ( 'MAX_SHOWN_ITEMS_PER_BUILD_PHABRICATOR' , 10 ) #NEWLINE# if ( num_failures > max_shown ) : #NEWLINE# #INDENT# tests = tests [ : max_shown ] #NEWLINE# did_truncate = True #NEWLINE# #UNINDENT# table = [ '|Test Name | Package|' , '|--|--|' ] #NEWLINE# for test in tests : #NEWLINE# #INDENT# pkg = test . package #NEWLINE# name = test . name #NEWLINE# if ( pkg and name . startswith ( pkg ) ) : #NEWLINE# #INDENT# name = name [ ( len ( pkg ) + 1 ) : ] #NEWLINE# #UNINDENT# test_link = build_uri ( '/build_test/{0}/{1}/' . format ( build . id . hex , test . id . hex ) ) #NEWLINE# table = ( table + [ ( '|[%s](%s)|%s|' % ( name , test_link , pkg ) ) ] ) #NEWLINE# #UNINDENT# if did_truncate : #NEWLINE# #INDENT# table += [ '|...more...|...|' ] #NEWLINE# #UNINDENT# return '\n' . join ( table )