mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-109566, regrtest: Add --fast-ci and --slow-ci options (#109570)
* Add --fast-ci and --slow-ci options to libregrtest: * --fast-ci uses a default timeout of 10 minutes and "-u all,-cpu" (skip slowest tests). * --slow-ci uses a default timeout of 20 minues and "-u all" (run all tests). * regrtest header now lists test resources. * Makefile changes: * "make test", "make hostrunnertest" and "make coverage-report" now use --fast-ci option and TESTTIMEOUT variable. * "make buildbottest" now uses "--slow-ci". Remove options which became redundant with "--slow-ci". * "make testall" and "make testuniversal" now use --slow-ci option and TESTTIMEOUT variable. * "make testall" now uses "find -exec rm ..." instead of "find ... -print|xargs rm ...", same as "make clean". * GitHub Actions workflow: * Ubuntu and Address Sanitizer jobs now use "make test". Remove options which became redundant with "--fast-ci". * Windows jobs now use --fast-ci option. * Use -j0 to detect the number of CPUs. * Set Makefile TESTTIMEOUT default to an empty string, since --slow-ci and --fast-ci use different default timeout. It's now accepted to pass "--timeout=" to regrtest: treated as not timeout. * Tools/scripts/run_tests.py now uses --fast-ci option. * Tools/buildbot/test.bat now uses --slow-ci option. Remove --timeout=1200 option, redundant with --slow-ci.
This commit is contained in:
parent
19bf398695
commit
859618c8cd
11 changed files with 161 additions and 51 deletions
|
@ -5,7 +5,7 @@ setlocal
|
|||
set PATH=%PATH%;%SystemRoot%\SysNative\OpenSSH;%SystemRoot%\System32\OpenSSH
|
||||
set here=%~dp0
|
||||
set rt_opts=-q -d
|
||||
set regrtest_args=-j1
|
||||
set regrtest_args=
|
||||
set arm32_ssh=
|
||||
|
||||
:CheckOpts
|
||||
|
@ -23,7 +23,7 @@ if "%PROCESSOR_ARCHITECTURE%"=="ARM" if "%arm32_ssh%"=="true" goto NativeExecuti
|
|||
if "%arm32_ssh%"=="true" goto :Arm32Ssh
|
||||
|
||||
:NativeExecution
|
||||
call "%here%..\..\PCbuild\rt.bat" %rt_opts% -uall -rwW --slowest --timeout=1200 %regrtest_args%
|
||||
call "%here%..\..\PCbuild\rt.bat" %rt_opts% --slow-ci %regrtest_args%
|
||||
exit /b %ERRORLEVEL%
|
||||
|
||||
:Arm32Ssh
|
||||
|
@ -35,7 +35,7 @@ if NOT "%REMOTE_PYTHON_DIR:~-1,1%"=="\" (set REMOTE_PYTHON_DIR=%REMOTE_PYTHON_DI
|
|||
|
||||
set TEMP_ARGS=--temp %REMOTE_PYTHON_DIR%temp
|
||||
|
||||
set rt_args=%rt_opts% %dashU% -rwW --slowest --timeout=1200 %regrtest_args% %TEMP_ARGS%
|
||||
set rt_args=%rt_opts% --slow-ci %dashU% %regrtest_args% %TEMP_ARGS%
|
||||
ssh %SSH_SERVER% "set TEMP=%REMOTE_PYTHON_DIR%temp& cd %REMOTE_PYTHON_DIR% & %REMOTE_PYTHON_DIR%PCbuild\rt.bat" %rt_args%
|
||||
set ERR=%ERRORLEVEL%
|
||||
scp %SSH_SERVER%:"%REMOTE_PYTHON_DIR%test-results.xml" "%PYTHON_SOURCE%\test-results.xml"
|
||||
|
|
|
@ -18,9 +18,6 @@ def is_multiprocess_flag(arg):
|
|||
return arg.startswith('-j') or arg.startswith('--multiprocess')
|
||||
|
||||
|
||||
def is_resource_use_flag(arg):
|
||||
return arg.startswith('-u') or arg.startswith('--use')
|
||||
|
||||
def is_python_flag(arg):
|
||||
return arg.startswith('-p') or arg.startswith('--python')
|
||||
|
||||
|
@ -56,20 +53,13 @@ def main(regrtest_args):
|
|||
args.extend(test.support.args_from_interpreter_flags())
|
||||
|
||||
args.extend(['-m', 'test', # Run the test suite
|
||||
'-r', # Randomize test order
|
||||
'-w', # Re-run failed tests in verbose mode
|
||||
'--fast-ci', # Fast Continuous Integration mode
|
||||
])
|
||||
if sys.platform == 'win32':
|
||||
args.append('-n') # Silence alerts under Windows
|
||||
if not any(is_multiprocess_flag(arg) for arg in regrtest_args):
|
||||
if cross_compile and hostrunner:
|
||||
# For now use only two cores for cross-compiled builds;
|
||||
# hostrunner can be expensive.
|
||||
args.extend(['-j', '2'])
|
||||
else:
|
||||
args.extend(['-j', '0']) # Use all CPU cores
|
||||
if not any(is_resource_use_flag(arg) for arg in regrtest_args):
|
||||
args.extend(['-u', 'all,-largefile,-audio,-gui'])
|
||||
|
||||
if cross_compile and hostrunner:
|
||||
# If HOSTRUNNER is set and -p/--python option is not given, then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue