Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 52 additions & 14 deletions src/native/managed/cdac/tests/StressTests/cdac-stress-helix.proj
Original file line number Diff line number Diff line change
Expand Up @@ -50,31 +50,69 @@
</PropertyGroup>

<!--
Single work item: run the stress test xunit assembly using dotnet exec.
Single work item: run the stress test xunit assembly using dotnet exec, then
on failure dump the per-debuggee verification logs to the work item's console
log so the cDAC-vs-runtime results are readable from the test's Helix
console-log link (the harness also uploads them to HELIX_WORKITEM_UPLOAD_ROOT).

Testhost layout: dotnet.exe at the root, CoreCLR + corerun + mscordaccore_universal
under shared/Microsoft.NETCore.App/<version>/. CORE_ROOT must point at the inner
version directory so the test harness finds corerun.exe as a sibling of coreclr.dll
(matches what CdacStressTestBase.GetCoreRunPath expects).

The command is built as a list of lines written to a command file (following
cdac-dump-helix.proj). xUnit's exit code is captured before the (always-
succeeding) log dump and re-applied afterwards, so dumping logs can't mask — or
fabricate — a test failure. Encoding: %25 = literal %, %24 = literal $,
%3B = literal ;.
-->
<PropertyGroup>
<_HelixCommandFile>$(StressTestsPayload)/HelixCommand.txt</_HelixCommandFile>
</PropertyGroup>

<Target Name="_CreateHelixWorkItems" BeforeTargets="CoreTest">
<!--
Run the xUnit suite directly. CdacStressTestBase.GetCoreRoot discovers
shared/Microsoft.NETCore.App/<version>/ from HELIX_CORRELATION_PAYLOAD
and the harness ensures corerun is executable, so no env-var setup or
framework-version loop is needed here.
-->
<PropertyGroup Condition="'$(TargetOS)' == 'windows'">
<_StressTestCommand>%25HELIX_CORRELATION_PAYLOAD%25\dotnet.exe exec --runtimeconfig %25HELIX_WORKITEM_PAYLOAD%25\tests\Microsoft.Diagnostics.DataContractReader.StressTests.runtimeconfig.json --depsfile %25HELIX_WORKITEM_PAYLOAD%25\tests\Microsoft.Diagnostics.DataContractReader.StressTests.deps.json %25HELIX_WORKITEM_PAYLOAD%25\tests\xunit.console.dll %25HELIX_WORKITEM_PAYLOAD%25\tests\Microsoft.Diagnostics.DataContractReader.StressTests.dll -xml testResults.xml -nologo</_StressTestCommand>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetOS)' != 'windows'">
<_StressTestCommand>$HELIX_CORRELATION_PAYLOAD/dotnet exec --runtimeconfig $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.StressTests.runtimeconfig.json --depsfile $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.StressTests.deps.json $HELIX_WORKITEM_PAYLOAD/tests/xunit.console.dll $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.StressTests.dll -xml testResults.xml -nologo</_StressTestCommand>
</PropertyGroup>
<ItemGroup>
<!--
Run the xUnit suite directly. CdacStressTestBase.GetCoreRoot discovers
shared/Microsoft.NETCore.App/<version>/ from HELIX_CORRELATION_PAYLOAD and
the harness ensures corerun is executable, so no env-var setup or
framework-version loop is needed here.
-->
<_HelixCommandLines Condition="'$(TargetOS)' == 'windows'"
Include="%25HELIX_CORRELATION_PAYLOAD%25\dotnet.exe exec --runtimeconfig %25HELIX_WORKITEM_PAYLOAD%25\tests\Microsoft.Diagnostics.DataContractReader.StressTests.runtimeconfig.json --depsfile %25HELIX_WORKITEM_PAYLOAD%25\tests\Microsoft.Diagnostics.DataContractReader.StressTests.deps.json %25HELIX_WORKITEM_PAYLOAD%25\tests\xunit.console.dll %25HELIX_WORKITEM_PAYLOAD%25\tests\Microsoft.Diagnostics.DataContractReader.StressTests.dll -xml testResults.xml -nologo" />
<_HelixCommandLines Condition="'$(TargetOS)' != 'windows'"
Include="$HELIX_CORRELATION_PAYLOAD/dotnet exec --runtimeconfig $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.StressTests.runtimeconfig.json --depsfile $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.StressTests.deps.json $HELIX_WORKITEM_PAYLOAD/tests/xunit.console.dll $HELIX_WORKITEM_PAYLOAD/tests/Microsoft.Diagnostics.DataContractReader.StressTests.dll -xml testResults.xml -nologo" />

<!-- Capture the test exit code before dumping logs (which always succeeds). -->
<_HelixCommandLines Condition="'$(TargetOS)' == 'windows'"
Include="set test_exit_code=%25ERRORLEVEL%25" />
<_HelixCommandLines Condition="'$(TargetOS)' != 'windows'"
Include="test_exit_code=%24%3F" />

<!-- On failure, echo the per-debuggee verification logs to the console log. -->
<_HelixCommandLines Condition="'$(TargetOS)' == 'windows'"
Include="if %25test_exit_code%25 NEQ 0 echo ===== cDAC stress verification logs =====" />
<_HelixCommandLines Condition="'$(TargetOS)' == 'windows'"
Include="if %25test_exit_code%25 NEQ 0 type %25HELIX_WORKITEM_UPLOAD_ROOT%25\cdac-gcstress-*.txt" />
Comment on lines +95 to +96
<_HelixCommandLines Condition="'$(TargetOS)' != 'windows'"
Include="if [ %24test_exit_code -ne 0 ]%3B then echo '===== cDAC stress verification logs ====='%3B for f in %24HELIX_WORKITEM_UPLOAD_ROOT/cdac-gcstress-*.txt%3B do echo &quot;--- %24f ---&quot;%3B cat &quot;%24f&quot;%3B done%3B fi" />
Comment on lines +97 to +98

<!-- Re-apply the test exit code (on Unix the command file is sourced, so a
function + return sets the script's exit code; see GH #126196). -->
<_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 %24test_exit_code" />
</ItemGroup>

<WriteLinesToFile File="$(_HelixCommandFile)" Lines="@(_HelixCommandLines)" Overwrite="true" />

<ItemGroup>
<HelixWorkItem Include="CdacStressTests">
<PayloadDirectory>$(StressTestsPayload)</PayloadDirectory>
<Command>$(_StressTestCommand)</Command>
<Command>$([System.IO.File]::ReadAllText('$(_HelixCommandFile)'))</Command>
<Timeout>$(WorkItemTimeout)</Timeout>
</HelixWorkItem>
Comment on lines 113 to 117
</ItemGroup>
Expand Down
Loading