65
65
TXT_RESULTS_NAME = "{}.txt.gz" .format (_BASE_NAME )
66
66
CSV_RESULTS_NAME = "{}.csv" .format (_BASE_NAME )
67
67
HTML_RESULTS_NAME = "{}.html" .format (_BASE_NAME )
68
+ LATEST_HTML_NAME = "latest.html"
68
69
69
70
HR = "" .join (['-' for _ in range (120 )])
70
71
83
84
PTRN_TEST_STATUS_INDIVIDUAL = re .compile (r"(?P<name>test[\w_]+ \(.+?\)) ... (?P<status>.+)" )
84
85
PTRN_TEST_STATUS_ERROR = re .compile (r"(?P<status>.+): (?P<name>test[\w_]+ \(.+?\))" )
85
86
86
- TEST_TYPES = ('array' ,'buffer' ,'code' ,'frame' ,'long' ,'memoryview' ,'unicode' ,'exceptions' ,
87
+ TEST_TYPES = tuple ( sorted ( ('array' ,'buffer' ,'code' ,'frame' ,'long' ,'memoryview' ,'unicode' ,'exceptions' ,
87
88
'baseexception' ,'range' ,'builtin' ,'bytes' ,'thread' ,'property' ,'class' ,'dictviews' ,
88
89
'sys' ,'imp' ,'rlcompleter' ,'types' ,'coroutines' ,'dictcomps' ,'int_literal' ,'mmap' ,
89
90
'module' ,'numeric_tower' ,'syntax' ,'traceback' ,'typechecks' ,'int' ,'keyword' ,'raise' ,
90
91
'descr' ,'generators' ,'list' ,'complex' ,'tuple' ,'enumerate' ,'super' ,'float' ,
91
- 'bool' ,'fstring' ,'dict' ,'iter' ,'string' ,'scope' ,'with' ,'set' )
92
+ 'bool' ,'fstring' ,'dict' ,'iter' ,'string' ,'scope' ,'with' ,'set' )))
92
93
93
- TEST_APP_SCRIPTING = ('test_json' ,'csv' ,'io' ,'memoryio' ,'bufio' ,'fileio' ,'file' ,'fileinput' ,'tempfile' ,
94
+ TEST_APP_SCRIPTING = tuple ( sorted ( ('test_json' ,'csv' ,'io' ,'memoryio' ,'bufio' ,'fileio' ,'file' ,'fileinput' ,'tempfile' ,
94
95
'pickle' ,'pickletester' ,'pickle' ,'picklebuffer' ,'pickletools' ,'codecs' ,'functools' ,
95
- 'itertools' ,'math' ,'operator' ,'zlib' ,'zipimport_support' ,'zipfile' ,'zipimport' ,
96
- 'zipapp' ,'gzip' ,'bz2' ,'builtin' )
96
+ 'itertools' ,'math' ,'operator' ,'zlib' ,'zipimport_support' ,'zipfile' ,'zipimport' ,'re' ,
97
+ 'zipapp' ,'gzip' ,'bz2' ,'builtin' )))
97
98
98
- TEST_SERVER_SCRIPTING_DS = ('sqlite3' ,'asyncio' ,'marshal' ,'select' ,'crypt' ,'ssl' ,'uuid' ,'multiprocessing' ,
99
+ TEST_SERVER_SCRIPTING_DS = tuple ( sorted ( ('sqlite3' ,'asyncio' ,'marshal' ,'select' ,'crypt' ,'ssl' ,'uuid' ,'multiprocessing' ,
99
100
'fork' ,'forkserver' ,'main_handling' ,'spawn' ,'socket' ,'socket' ,'socketserver' ,
100
101
'signal' ,'mmap' ,'resource' ,'thread' ,'dummy_thread' ,'threading' ,'threading_local' ,
101
- 'threadsignals' ,'dummy_threading' ,'threadedtempfile' ,'thread' ,'hashlib' ,'re' ,
102
- 'pyexpat' ,'locale' ,'_locale' ,'locale' ,'c_locale_coercion' ,'struct' ) + TEST_APP_SCRIPTING
102
+ 'threadsignals' ,'dummy_threading' ,'threadedtempfile' ,'thread' ,'hashlib' ,
103
+ 'pyexpat' ,'locale' ,'_locale' ,'locale' ,'c_locale_coercion' ,'struct' ) + TEST_APP_SCRIPTING ))
103
104
104
105
105
106
USE_CASE_GROUPS = {
@@ -773,8 +774,8 @@ def format_val(row, k):
773
774
var data = tr.data('errors');
774
775
if (data) {{
775
776
function formatEntry(entry) {{
776
- var description = entry[0][0];
777
- var text = ('' + entry[0][1]).replace(/(.{{195}} )/g, '$1<br/> '); // break long lines
777
+ var description = ('' + entry[0][0]).replace(/&/g, "&").replace(/</g, "<") ;
778
+ var text = ('' + entry[0][1]).replace(/&/g, "&").replace(/</g, "<").replace(/ (.{{195}} )/g, '$1<br/> '); // break long lines
778
779
var count = (entry[1] > 1 ? ('<font color="red"> (x ' + entry[1] + ')</font>') : '');
779
780
return description + ': ' + text + count + '<br/>';
780
781
}}
@@ -862,6 +863,15 @@ def format_val(row, k):
862
863
with open (report_name , 'w' ) as HTML :
863
864
HTML .write (report )
864
865
866
+ def generate_latest (output_name , html_report_path ):
867
+ contents = '''
868
+ <html>
869
+ <head><style type="text/css"> body { margin:0; overflow:hidden; } #fr { height:100%; left:0px; position:absolute; top:0px; width:100%; }</style></head>
870
+ <body><iframe id="fr" src="''' + html_report_path + '''" frameborder="0"></iframe></body>
871
+ </html>
872
+ '''
873
+ with open (output_name , 'w' ) as HTML :
874
+ HTML .write (contents )
865
875
866
876
# ----------------------------------------------------------------------------------------------------------------------
867
877
#
@@ -882,6 +892,7 @@ def main(prog, args):
882
892
"the only_tets option takes precedence" , default = None )
883
893
parser .add_argument ("-r" , "--regression_running_tests" , help = "Regression threshold for running tests." , type = float ,
884
894
default = None )
895
+ parser .add_argument ("--no_latest" , help = "Don't generate latest.html file." , action = "store_true" )
885
896
parser .add_argument ("-g" , "--gate" , help = "Run in gate mode (Skip cpython runs; Do not upload results; "
886
897
"Detect regressions)." , action = "store_true" )
887
898
parser .add_argument ("path" , help = "Path to store the csv output and logs to." , nargs = '?' , default = None )
@@ -960,6 +971,9 @@ def _fmt(t):
960
971
scp (txt_report_path , flags .path )
961
972
scp (csv_report_path , flags .path )
962
973
scp (html_report_path , flags .path )
974
+ if not flags .no_latest :
975
+ generate_latest (LATEST_HTML_NAME , html_report_path )
976
+ scp (LATEST_HTML_NAME , flags .path )
963
977
964
978
gate_failed = False
965
979
if flags .gate and flags .regression_running_tests :
0 commit comments