Skip to content

Commit

Permalink
Update coreclr test run scripts (#95237)
Browse files Browse the repository at this point in the history
* Update coreclr test run scripts

1. When running tests, create a new unique 'logs' directory for every run,
to avoid overwriting the results of previous runs. First, use "artifacts\log".
Then, use "log.1", "log.2", etc.
2. Add a run.py `-logs_dir` argument (run.cmd: `logsdir`; run.sh: `-logsDir`) to
allow specifying a particular logs directory name. This can be useful if you have
multiple test run results logs directory and you want to use `--analyze_results_only`
(run.cmd: `printlastresultsonly`) to analyze a run that is not the last logs directory.
3. Remove the unnecessary run.py `--skip_test_run` argument. It was added to use the logic
to precompile the libraries, but that logic is now gone.
4. Move generated repro files for failed tests to the "log\repro" directory, and name them
with a `repro_` filename prefix.
5. Print out the path of all repro files that are created.
6. Add a `setlocal` to the generated Windows repro files.
7. Misc. minor improvements.

Contributes to #95032

* Try to fix Linux repros

* Remove automatic creation of new 'log' directories

Also, fix repro creation for non-BuildAsStandalone by
bailing; we don't know how to create those repros.

Fix repro creation for BuildAsStandalone.

Improve some output messages and code comments.
  • Loading branch information
BruceForstall authored Nov 30, 2023
1 parent 84eda24 commit 5ea898e
Show file tree
Hide file tree
Showing 3 changed files with 244 additions and 201 deletions.
9 changes: 7 additions & 2 deletions src/tests/run.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ for %%i in ("%__RepoRootDir%") do set "__RepoRootDir=%%~fi"
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
set "__ProjectFilesDir=%__ProjectDir%"
set "__RootBinDir=%__RepoRootDir%\artifacts"
set "__LogsDir=%__RootBinDir%\log"
set "__MsbuildDebugLogsDir=%__LogsDir%\MsbuildDebugLogs"
set __ToolsDir=%__ProjectDir%\..\Tools
set "DotNetCli=%__RepoRootDir%\dotnet.cmd"

Expand All @@ -30,6 +28,7 @@ set __LongGCTests=
set __GCSimulatorTests=
set __IlasmRoundTrip=
set __PrintLastResultsOnly=
set LogsDirArg=
set RunInUnloadableContext=
set TieringTest=

Expand Down Expand Up @@ -60,6 +59,7 @@ if /i "%1" == "jitminopts" (set DOTNET_JITMinOpts=1
if /i "%1" == "jitforcerelocs" (set DOTNET_ForceRelocs=1&shift&goto Arg_Loop)

if /i "%1" == "printlastresultsonly" (set __PrintLastResultsOnly=1&shift&goto Arg_Loop)
if /i "%1" == "logsdir" (set LogsDirArg=%2&shift&shift&goto Arg_Loop)
if /i "%1" == "runcrossgen2tests" (set RunCrossGen2=1&shift&goto Arg_Loop)
REM This test feature is currently intentionally undocumented
if /i "%1" == "runlargeversionbubblecrossgen2tests" (set RunCrossGen2=1&set CrossgenLargeVersionBubble=1&shift&goto Arg_Loop)
Expand Down Expand Up @@ -109,6 +109,10 @@ REM Set up arguments to call run.py

set __RuntestPyArgs=-arch %__BuildArch% -build_type %__BuildType%

if defined LogsDirArg (
set __RuntestPyArgs=%__RuntestPyArgs% -logs_dir %LogsDirArg%
)

if defined DoLink (
set __RuntestPyArgs=%__RuntestPyArgs% --il_link
)
Expand Down Expand Up @@ -226,6 +230,7 @@ echo printlastresultsonly - Print the last test results without running tes
echo runincontext - Run each tests in an unloadable AssemblyLoadContext
echo timeout ^<n^> - Sets the per-test timeout in milliseconds ^(default is 10 minutes = 10 * 60 * 1000 = 600000^).
echo Note: some options override this ^(gcstresslevel, longgc, gcsimulator^).
echo logsdir ^<dir^> - Specify the logs directory ^(default: artifacts/log^)
echo msbuildargs ^<args...^> - Pass all subsequent args directly to msbuild invocations.
echo ^<CORE_ROOT^> - Path to the runtime to test ^(if specified^).
echo.
Expand Down
Loading

0 comments on commit 5ea898e

Please sign in to comment.