diff --git a/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj b/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj index d01d2acf573c35..cb0702d762d63d 100644 --- a/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj +++ b/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj @@ -68,58 +68,55 @@ - - - <_DebuggeeJsonArray>@(_Debuggee->'{"name":"%(Identity)","dumpDir":"%(DumpDir)","r2rDir":"%(R2RDir)"}', ',') - - - - - <_DumpGenCommands>@(_Debuggee->'mkdir %HELIX_WORKITEM_PAYLOAD%\dumps\local\%(DumpDir)\%(R2RDir)\%(Identity) & set "DOTNET_DbgMiniDumpType=%(MiniDumpType)" & set "DOTNET_DbgMiniDumpName=%HELIX_WORKITEM_PAYLOAD%\dumps\local\%(DumpDir)\%(R2RDir)\%(Identity)\%(Identity).dmp" & set "DOTNET_ReadyToRun=%(R2RValue)" & %HELIX_CORRELATION_PAYLOAD%\dotnet.exe exec %HELIX_WORKITEM_PAYLOAD%\debuggees\%(Identity)\%(Identity).dll', ' & ') - <_DumpInfoCommand>echo {"os":"$(TargetOS)","arch":"$(TargetArchitecture)","debuggees":[$(_DebuggeeJsonArray)]}> %HELIX_WORKITEM_PAYLOAD%\dumps\local\dump-info.json - - - - - <_TestCommand>%HELIX_CORRELATION_PAYLOAD%\dotnet.exe exec --runtimeconfig %HELIX_WORKITEM_PAYLOAD%\tests\Microsoft.Diagnostics.DataContractReader.DumpTests.runtimeconfig.json --depsfile %HELIX_WORKITEM_PAYLOAD%\tests\Microsoft.Diagnostics.DataContractReader.DumpTests.deps.json %HELIX_WORKITEM_PAYLOAD%\tests\xunit.console.dll %HELIX_WORKITEM_PAYLOAD%\tests\Microsoft.Diagnostics.DataContractReader.DumpTests.dll -xml testResults.xml -nologo - <_TarCommand>tar -czf %HELIX_WORKITEM_UPLOAD_ROOT%\dumps.tar.gz -C %HELIX_WORKITEM_PAYLOAD%\dumps . - <_FullCommand>$(_DumpGenCommands) & $(_DumpInfoCommand) & $(_TestCommand) & if errorlevel 1 set _FAIL=1 & $(_TarCommand) & if defined _FAIL exit /b 1 - - - - - <_TarCommand>tar -czf %HELIX_WORKITEM_UPLOAD_ROOT%\dumps.tar.gz -C %HELIX_WORKITEM_PAYLOAD%\dumps . - <_FullCommand>$(_DumpGenCommands) & $(_DumpInfoCommand) & $(_TarCommand) - - - - - <_DumpGenCommands>@(_Debuggee->'mkdir -p $HELIX_WORKITEM_PAYLOAD/dumps/local/%(DumpDir)/%(R2RDir)/%(Identity) && DOTNET_DbgMiniDumpType=%(MiniDumpType) DOTNET_DbgMiniDumpName=$HELIX_WORKITEM_PAYLOAD/dumps/local/%(DumpDir)/%(R2RDir)/%(Identity)/%(Identity).dmp DOTNET_ReadyToRun=%(R2RValue) $HELIX_CORRELATION_PAYLOAD/dotnet exec $HELIX_WORKITEM_PAYLOAD/debuggees/%(Identity)/%(Identity).dll || true', ' && ') - <_DumpInfoCommand>echo '{"os":"$(TargetOS)","arch":"$(TargetArchitecture)","debuggees":[$(_DebuggeeJsonArray)]}' > $HELIX_WORKITEM_PAYLOAD/dumps/local/dump-info.json - - - - - <_TestCommand>$HELIX_CORRELATION_PAYLOAD/dotnet exec --runtimeconfig $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.DumpTests.runtimeconfig.json --depsfile $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.DumpTests.deps.json $HELIX_WORKITEM_PAYLOAD/tests/xunit.console.dll $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.DumpTests.dll -xml testResults.xml -nologo - <_TarCommand>tar -czf $HELIX_WORKITEM_UPLOAD_ROOT/dumps.tar.gz -C $HELIX_WORKITEM_PAYLOAD/dumps . - <_FullCommand>$(_DumpGenCommands) && $(_DumpInfoCommand) && $(_TestCommand); _rc=$?; $(_TarCommand); exit $_rc + + <_HelixCommandFile>$(DumpTestsPayload)/HelixCommand.txt - - - <_TarCommand>tar -czf $HELIX_WORKITEM_UPLOAD_ROOT/dumps.tar.gz -C $HELIX_WORKITEM_PAYLOAD/dumps . - <_FullCommand>$(_DumpGenCommands) && $(_DumpInfoCommand) && $(_TarCommand) - + + + + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" Include="echo === Generating crash dumps ===" /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" Include="echo '=== Generating crash dumps ==='" /> + + + + + + + + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="mkdir %25HELIX_WORKITEM_PAYLOAD%25\dumps\local\%(_Debuggee.DumpDir)\%(_Debuggee.R2RDir)\%(_Debuggee.Identity)" /> + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="echo Generating dump for %(_Debuggee.Identity) (%(_Debuggee.DumpDir)\%(_Debuggee.R2RDir))..." /> + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="set "DOTNET_DbgMiniDumpType=%(_Debuggee.MiniDumpType)"" /> + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="set "DOTNET_DbgMiniDumpName=%25HELIX_WORKITEM_PAYLOAD%25\dumps\local\%(_Debuggee.DumpDir)\%(_Debuggee.R2RDir)\%(_Debuggee.Identity)\%(_Debuggee.Identity).dmp"" /> + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="set "DOTNET_ReadyToRun=%(_Debuggee.R2RValue)"" /> + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="%25HELIX_CORRELATION_PAYLOAD%25\dotnet.exe exec %25HELIX_WORKITEM_PAYLOAD%25\debuggees\%(_Debuggee.Identity)\%(_Debuggee.Identity).dll" /> + + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="mkdir -p $HELIX_WORKITEM_PAYLOAD/dumps/local/%(_Debuggee.DumpDir)/%(_Debuggee.R2RDir)/%(_Debuggee.Identity)" /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="echo " Generating dump for %(_Debuggee.Identity) (%(_Debuggee.DumpDir)/%(_Debuggee.R2RDir))..."" /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="DOTNET_DbgMiniDumpType=%(_Debuggee.MiniDumpType) DOTNET_DbgMiniDumpName=$HELIX_WORKITEM_PAYLOAD/dumps/local/%(_Debuggee.DumpDir)/%(_Debuggee.R2RDir)/%(_Debuggee.Identity)/%(_Debuggee.Identity).dmp DOTNET_ReadyToRun=%(_Debuggee.R2RValue) $HELIX_CORRELATION_PAYLOAD/dotnet exec $HELIX_WORKITEM_PAYLOAD/debuggees/%(_Debuggee.Identity)/%(_Debuggee.Identity).dll || true" /> + + @@ -146,24 +143,79 @@ @(HelixPreCommand) - - - - $(DumpTestsPayload) - $(_FullCommand) - $(WorkItemTimeout) - dumps.tar.gz - - - - - - - $(DumpTestsPayload) - $(_FullCommand) - $(WorkItemTimeout) - dumps.tar.gz - - + + + + + + + + + + + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="echo {"os":"$(TargetOS)","arch":"$(TargetArchitecture)","debuggees":[$(_EvalDebuggeeJsonArray)]}> %25HELIX_WORKITEM_PAYLOAD%25\dumps\local\dump-info.json" /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="echo '{"os":"$(TargetOS)","arch":"$(TargetArchitecture)","debuggees":[$(_EvalDebuggeeJsonArray)]}' > $HELIX_WORKITEM_PAYLOAD/dumps/local/dump-info.json" /> + + + + + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="%25HELIX_CORRELATION_PAYLOAD%25\dotnet.exe exec --runtimeconfig %25HELIX_WORKITEM_PAYLOAD%25\tests\Microsoft.Diagnostics.DataContractReader.DumpTests.runtimeconfig.json --depsfile %25HELIX_WORKITEM_PAYLOAD%25\tests\Microsoft.Diagnostics.DataContractReader.DumpTests.deps.json %25HELIX_WORKITEM_PAYLOAD%25\tests\xunit.console.dll %25HELIX_WORKITEM_PAYLOAD%25\tests\Microsoft.Diagnostics.DataContractReader.DumpTests.dll -xml testResults.xml -nologo" /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="$HELIX_CORRELATION_PAYLOAD/dotnet exec --runtimeconfig $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.DumpTests.runtimeconfig.json --depsfile $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.DumpTests.deps.json $HELIX_WORKITEM_PAYLOAD/tests/xunit.console.dll $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.DumpTests.dll -xml testResults.xml -nologo" /> + + + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="set test_exit_code=%25ERRORLEVEL%25" /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="test_exit_code=$?" /> + + + + + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="tar -czf %25HELIX_WORKITEM_UPLOAD_ROOT%25\dumps.tar.gz -C %25HELIX_WORKITEM_PAYLOAD%25\dumps ." /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="tar -czf $HELIX_WORKITEM_UPLOAD_ROOT/dumps.tar.gz -C $HELIX_WORKITEM_PAYLOAD/dumps ." /> + + + + + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="%25ComSpec%25 /C exit %25test_exit_code%25" /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="set_return() { return $1%3B }" /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="set_return $test_exit_code" /> + + + + + + + $(DumpTestsPayload) + $([System.IO.File]::ReadAllText('$(_HelixCommandFile)')) + $(WorkItemTimeout) + dumps.tar.gz + + + + + + $(DumpTestsPayload) + $([System.IO.File]::ReadAllText('$(_HelixCommandFile)')) + $(WorkItemTimeout) + dumps.tar.gz + + + diff --git a/src/native/managed/cdac/tests/DumpTests/cdac-dump-xplat-test-helix.proj b/src/native/managed/cdac/tests/DumpTests/cdac-dump-xplat-test-helix.proj index bdad241b5054d3..a38f88f00f7795 100644 --- a/src/native/managed/cdac/tests/DumpTests/cdac-dump-xplat-test-helix.proj +++ b/src/native/managed/cdac/tests/DumpTests/cdac-dump-xplat-test-helix.proj @@ -9,8 +9,9 @@ dumps/{source_platform}/ — Extracted dumps from each source platform local/{dumpType}/{r2rMode}/{name}/{name}.dmp - A single Helix work item runs xunit once per source platform, each time - with CDAC_DUMP_ROOT pointing to that platform's dump subdirectory. + One Helix work item is created per source platform, each running xunit with + CDAC_DUMP_ROOT pointing to that platform's dump subdirectory. This gives each + platform independent exit code tracking and test result reporting. Properties (set by pipeline): HelixTargetQueues — Helix queue(s) to run on @@ -52,20 +53,11 @@ - - <_TestCommands>@(_SourcePlatform->'set "CDAC_DUMP_ROOT=%HELIX_WORKITEM_PAYLOAD%\dumps\%(Identity)" & %HELIX_CORRELATION_PAYLOAD%\dotnet.exe exec --runtimeconfig %HELIX_WORKITEM_PAYLOAD%\tests\Microsoft.Diagnostics.DataContractReader.DumpTests.runtimeconfig.json --depsfile %HELIX_WORKITEM_PAYLOAD%\tests\Microsoft.Diagnostics.DataContractReader.DumpTests.deps.json %HELIX_WORKITEM_PAYLOAD%\tests\xunit.console.dll %HELIX_WORKITEM_PAYLOAD%\tests\Microsoft.Diagnostics.DataContractReader.DumpTests.dll -xml testResults_%(Identity).xml -nologo', ' & ') - - - - <_TestCommands>@(_SourcePlatform->'CDAC_DUMP_ROOT=$HELIX_WORKITEM_PAYLOAD/dumps/%(Identity) $HELIX_CORRELATION_PAYLOAD/dotnet exec --runtimeconfig $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.DumpTests.runtimeconfig.json --depsfile $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.DumpTests.deps.json $HELIX_WORKITEM_PAYLOAD/tests/xunit.console.dll $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.DumpTests.dll -xml testResults_%(Identity).xml -nologo', ' %3B ') - @@ -76,13 +68,41 @@ @(HelixPreCommand) - - - - $(DumpTestsPayload) - $(_TestCommands) - $(WorkItemTimeout) - - + + + + <_HelixCommandFile>$(DumpTestsPayload)/HelixCommand_%(_SourcePlatform.Identity).txt + + + + <_HelixCommandLines Remove="@(_HelixCommandLines)" /> + + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="set "CDAC_DUMP_ROOT=%25HELIX_WORKITEM_PAYLOAD%25\dumps\%(_SourcePlatform.Identity)"" /> + <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" + Include="%25HELIX_CORRELATION_PAYLOAD%25\dotnet.exe exec --runtimeconfig %25HELIX_WORKITEM_PAYLOAD%25\tests\Microsoft.Diagnostics.DataContractReader.DumpTests.runtimeconfig.json --depsfile %25HELIX_WORKITEM_PAYLOAD%25\tests\Microsoft.Diagnostics.DataContractReader.DumpTests.deps.json %25HELIX_WORKITEM_PAYLOAD%25\tests\xunit.console.dll %25HELIX_WORKITEM_PAYLOAD%25\tests\Microsoft.Diagnostics.DataContractReader.DumpTests.dll -xml testResults.xml -nologo" /> + + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="export CDAC_DUMP_ROOT=$HELIX_WORKITEM_PAYLOAD/dumps/%(_SourcePlatform.Identity)" /> + <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" + Include="$HELIX_CORRELATION_PAYLOAD/dotnet exec --runtimeconfig $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.DumpTests.runtimeconfig.json --depsfile $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.DumpTests.deps.json $HELIX_WORKITEM_PAYLOAD/tests/xunit.console.dll $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.DumpTests.dll -xml testResults.xml -nologo" /> + + + + + + + $(DumpTestsPayload) + $([System.IO.File]::ReadAllText('$(_HelixCommandFile)')) + $(WorkItemTimeout) + + +