Skip to content

Commit

Permalink
Address suggestion:
Browse files Browse the repository at this point in the history
- Avoid using yml extraHelixArguments.
- Add the new embedded SetCommands optional section in runner scripts.
- Set __IsXUnitLogCheckerSupported in tests.targets as SetScriptCommand items instead of directly in sendtohelixhelp.proj.
  • Loading branch information
carlossanlop committed Nov 28, 2023
1 parent bd0b435 commit a147fd5
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 23 deletions.
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,9 @@
<UseMonoRuntime Condition="'$(UseMonoRuntime)' == '' and '$(RuntimeFlavor)' == 'Mono'">true</UseMonoRuntime>

<!-- For enabling the use of XUnitLogChecker in coreclr and libraries test runs. -->
<!-- TODO: Enable XUnitLogChecker for NativeAOT tests https://github.com/dotnet/runtime/issues/94722 -->
<IsXUnitLogCheckerSupported Condition="'$(IsXUnitLogCheckerSupported)' == ''">false</IsXUnitLogCheckerSupported>
<IsXUnitLogCheckerSupported Condition="'$(RuntimeFlavor)' == 'CoreCLR' and '$(TestNativeAot)' != 'true' and '$(RunNativeAotTestApps)' != 'true' and '$(TargetOS)' != 'browser' and '$(TargetOS)' != 'wasi' and '$(TargetOS)' != 'ios' and '$(TargetOS)' != 'iossimulator' and '$(TargetOS)' != 'tvos' and '$(TargetOS)' != 'tvossimulator' and '$(TargetOS)' != 'maccatalyst' and '$(TargetOS)' != 'android'">true</IsXUnitLogCheckerSupported>
<IsXUnitLogCheckerSupported Condition="'$(RuntimeFlavor)' == 'CoreCLR' and '$(TestNativeAot)' != 'true' and '$(RunNativeAotTestApps)' != 'true' and '$(TestSingleFile)' != 'true' and '$(TargetOS)' != 'browser' and '$(TargetOS)' != 'wasi' and '$(TargetOS)' != 'ios' and '$(TargetOS)' != 'iossimulator' and '$(TargetOS)' != 'tvos' and '$(TargetOS)' != 'tvossimulator' and '$(TargetOS)' != 'maccatalyst' and '$(TargetOS)' != 'android'">true</IsXUnitLogCheckerSupported>
<XUnitLogCheckerLibrariesOutDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'XUnitLogChecker'))</XUnitLogCheckerLibrariesOutDir>
</PropertyGroup>

Expand Down
5 changes: 0 additions & 5 deletions eng/pipelines/coreclr/runtime-nativeaot-outerloop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ extends:
parameters:
creator: dotnet-bot
testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig)
extraHelixArguments: /p:IsXUnitLogCheckerSupported=false

#
# CoreCLR NativeAOT release build (checked runtime) and libraries tests
Expand All @@ -100,7 +99,6 @@ extends:
parameters:
creator: dotnet-bot
testRunNamePrefixSuffix: NativeAOT_Checked_$(_BuildConfig)
extraHelixArguments: /p:IsXUnitLogCheckerSupported=false

#
# CoreCLR NativeAOT release build (checked runtime) - SizeOpt and libraries tests
Expand All @@ -126,7 +124,6 @@ extends:
parameters:
creator: dotnet-bot
testRunNamePrefixSuffix: NativeAOT_Checked_SizeOpt_$(_BuildConfig)
extraHelixArguments: /p:IsXUnitLogCheckerSupported=false

#
# CoreCLR NativeAOT release build (checked runtime) - SpeedOpt and libraries tests
Expand All @@ -152,7 +149,6 @@ extends:
parameters:
creator: dotnet-bot
testRunNamePrefixSuffix: NativeAOT_Checked_SpeedOpt_$(_BuildConfig)
extraHelixArguments: /p:IsXUnitLogCheckerSupported=false

#
# CoreCLR NativeAOT checked build and Pri0 tests
Expand Down Expand Up @@ -187,4 +183,3 @@ extends:
parameters:
testGroup: innerloop
liveLibrariesBuildConfig: Release
extraHelixArguments: /p:IsXUnitLogCheckerSupported=false
1 change: 0 additions & 1 deletion eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ extends:
parameters:
creator: dotnet-bot
testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig)
extraHelixArguments: /p:IsXUnitLogCheckerSupported=false
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
Expand Down
5 changes: 5 additions & 0 deletions eng/testing/RunnerTemplate.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ echo DOTNET_EnableExtraSuperPmiQueries=%DOTNET_EnableExtraSuperPmiQueries%
echo DOTNET_JitPath=%DOTNET_JitPath%
:skip_spmi_enable_collection

echo ========================= Begin custom configuration settings ==============================
[[SetCommandsEcho]]
[[SetCommands]]
echo ========================== End custom configuration settings ===============================

:: ========================= BEGIN Test Execution =============================
echo ----- start %DATE% %TIME% =============== To repro directly: =====================================================
echo pushd %EXECUTION_DIR%
Expand Down
5 changes: 5 additions & 0 deletions eng/testing/RunnerTemplate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ if [ ! -z $spmi_enable_collection ]; then
fi
# ========================= END support for SuperPMI collection ==============================

echo ========================= Begin custom configuration settings ==============================
[[SetCommandsEcho]]
[[SetCommands]]
echo ========================== End custom configuration settings ===============================

# ========================= BEGIN Test Execution =============================
echo ----- start $(date) =============== To repro directly: =====================================================
echo pushd $EXECUTION_DIR
Expand Down
5 changes: 5 additions & 0 deletions eng/testing/tests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@
<ArchiveTestsAfterTargets Condition="'$(TargetOS)' == 'browser' or '$(TargetOS)' == 'wasi' or '$(TestSingleFile)' == 'true'" />
</PropertyGroup>

<ItemGroup Condition="'$(IsXUnitLogCheckerSupported)' == 'true' and '$(BuildTargetFramework)' == '$(NetCoreAppCurrent)'">
<SetScriptCommands Condition="'$(TargetOS)' == 'windows'" Include="set __TestArchitecture=$(TargetArchitecture);set __IsXUnitLogCheckerSupported=1" />
<SetScriptCommands Condition="'$(TargetOS)' != 'windows'" Include="export __TestArchitecture=$(TargetArchitecture);export __IsXUnitLogCheckerSupported=1"/>
</ItemGroup>

<!-- Archive test binaries. -->
<Target Name="ArchiveTests"
Condition="'$(ArchiveTests)' == 'true' and '$(IgnoreForCI)' != 'true' and ('$(TargetsMobile)' != 'true' or '$(TargetOS)' == 'browser' or '$(TargetOS)' == 'wasi' or '$(BuildTestsOnHelix)' == 'true')"
Expand Down
18 changes: 2 additions & 16 deletions src/libraries/sendtohelixhelp.proj
Original file line number Diff line number Diff line change
Expand Up @@ -232,22 +232,8 @@
</ItemGroup>
</Target>

<PropertyGroup Condition="'$(IsXUnitLogCheckerSupported)' == 'true' and '$(BuildTargetFramework)' == '$(NetCoreAppCurrent)'">
<_ShouldSetXUnitLogCheckerEnvVar>1</_ShouldSetXUnitLogCheckerEnvVar>
<HelixPreCommands Condition="'$(TargetOS)' == 'windows'">
$(HelixPreCommands);
set __TestArchitecture=$(TargetArchitecture);
set __IsXUnitLogCheckerSupported=$(_ShouldSetXUnitLogCheckerEnvVar)
</HelixPreCommands>
<HelixPreCommands Condition="'$(TargetOS)' != 'windows'">
$(HelixPreCommands);
export __TestArchitecture=$(TargetArchitecture);
export __IsXUnitLogCheckerSupported=$(_ShouldSetXUnitLogCheckerEnvVar)
</HelixPreCommands>
</PropertyGroup>

<ItemGroup Condition="'$(_ShouldSetXUnitLogCheckerEnvVar)' == '1'">
<HelixCorrelationPayload Include="$(XUnitLogCheckerLibrariesOutDir)" />
<ItemGroup Condition="'$(IsXUnitLogCheckerSupported)' == 'true' and '$(BuildTargetFramework)' == '$(NetCoreAppCurrent)'">
<HelixCorrelationPayload Include="$(XUnitLogCheckerLibrariesOutDir)" />
</ItemGroup>

<!--
Expand Down

0 comments on commit a147fd5

Please sign in to comment.