55import platform
66import shutil
77import sys
8+ import time
89from pathlib import Path
910
1011import robot
1617OS = platform .system ()
1718PY = "" .join (map (str , sys .version_info [:2 ]))
1819
20+ OS_PY_ARGS = {
21+ # notebook and ipykernel releases do not yet support python 3.8 on windows
22+ ("Windows" , "38" ): ["--include" , "not-supported" , "--runemptysuite" ]
23+ }
24+
25+
26+ def get_stem (attempt , extra_args ):
27+ stem = "_" .join ([OS , PY , str (attempt )]).replace ("." , "_" ).lower ()
28+
29+ if "--dryrun" in extra_args :
30+ stem = f"dry_run_{ stem } "
31+
32+ return stem
33+
1934
2035def atest (attempt , extra_args ):
2136 """ perform a single attempt of the acceptance tests
2237 """
23- stem = "_" .join ([OS , PY , str (attempt )]).replace ("." , "_" ).lower ()
38+ extra_args += OS_PY_ARGS .get ((OS , PY ), [])
39+
40+ stem = get_stem (attempt , extra_args )
41+
42+ if attempt != 1 :
43+ previous = OUT / f"{ get_stem (attempt - 1 , extra_args )} .robot.xml"
44+ if previous .exists ():
45+ extra_args += ["--rerunfailed" , str (previous )]
46+
2447 out_dir = OUT / stem
2548
2649 args = [
@@ -40,6 +63,8 @@ def atest(attempt, extra_args):
4063 f"OS:{ OS } " ,
4164 "--variable" ,
4265 f"PY:{ PY } " ,
66+ "--randomize" ,
67+ "all" ,
4368 * (extra_args or []),
4469 ATEST ,
4570 ]
@@ -71,7 +96,9 @@ def attempt_atest_with_retries(*extra_args):
7196 while error_count != 0 and attempt <= retries :
7297 attempt += 1
7398 print ("attempt {} of {}..." .format (attempt , retries + 1 ))
74- error_count = atest (attempt = attempt , extra_args = extra_args )
99+ start_time = time .time ()
100+ error_count = atest (attempt = attempt , extra_args = list (extra_args ))
101+ print (error_count , "errors in" , int (time .time () - start_time ), "seconds" )
75102
76103 return error_count
77104
0 commit comments