_HelixTargetQueues: ${{ join(',', parameters.helixQueues) }}
_HelixType: ${{ parameters.helixType }}
_RunCrossGen: ${{ parameters.runCrossGen }}
+ _RunInUnloadableContext: ${{ parameters.runInUnloadableContext }}
_Scenarios: ${{ join(',', parameters.scenarios) }}
_TimeoutPerTestCollectionInMinutes: ${{ parameters.timeoutPerTestCollectionInMinutes }}
_TimeoutPerTestInMinutes: ${{ parameters.timeoutPerTestInMinutes }}
_HelixTargetQueues: ${{ join(',', parameters.helixQueues) }}
_HelixType: ${{ parameters.helixType }}
_RunCrossGen: ${{ parameters.runCrossGen }}
+ _RunInUnloadableContext: ${{ parameters.runInUnloadableContext }}
_Scenarios: ${{ join(',', parameters.scenarios) }}
_TimeoutPerTestCollectionInMinutes: ${{ parameters.timeoutPerTestCollectionInMinutes }}
_TimeoutPerTestInMinutes: ${{ parameters.timeoutPerTestInMinutes }}
HelixType=$(_HelixType);
PublishTestResults=$(_PublishTestResults);
RunCrossGen=$(_RunCrossGen);
+ RunInUnloadableContext=$(_RunInUnloadableContext);
TimeoutPerTestCollectionInMinutes=$(_TimeoutPerTestCollectionInMinutes);
TimeoutPerTestInMinutes=$(_TimeoutPerTestInMinutes)
</_PropertiesToPass>
</ItemGroup>
<Copy SourceFiles="@(_XUnitConsoleRunnerFiles)" DestinationFolder="$(CoreRootDirectory)" />
+ <Copy SourceFiles="$(MSBuildThisFileDirectory)\scripts\runincontext.cmd" DestinationFolder="$(CoreRootDirectory)" Condition=" '$(TargetsWindows)' == 'true' and '$(RunInUnloadableContext)' == 'true'" />
+ <Copy SourceFiles="$(MSBuildThisFileDirectory)/scripts/runincontext.sh" DestinationFolder="$(CoreRootDirectory)" Condition=" '$(TargetsWindows)' != 'true' and '$(RunInUnloadableContext)' == 'true'" />
</Target>
<Target Name="CreateTestEnvFiles">
<ItemGroup Condition=" '$(TargetsWindows)' == 'true' ">
<HelixPreCommand Include="set CORE_ROOT=%HELIX_CORRELATION_PAYLOAD%" />
<HelixPreCommand Include="set RunCrossGen=1" Condition=" '$(RunCrossGen)' == 'true' " />
+ <HelixPreCommand Include="set RunInUnloadableContext=1" Condition=" '$(RunInUnloadableContext)' == 'true' " />
+ <HelixPreCommand Include="set CLRCustomTestLauncher=%HELIX_CORRELATION_PAYLOAD%\runincontext.cmd" Condition=" '$(RunInUnloadableContext)' == 'true' " />
<HelixPreCommand Include="set __TestEnv=%HELIX_WORKITEM_PAYLOAD%\$(TestEnvFileName)" />
<HelixPreCommand Include="set __TestTimeout=$(TimeoutPerTestInMilliseconds)" Condition=" '$(TimeoutPerTestInMilliseconds)' != '' " />
<HelixPreCommand Include="type %__TestEnv%" />
<ItemGroup Condition=" '$(TargetsWindows)' != 'true' ">
<HelixPreCommand Include="export CORE_ROOT=$HELIX_CORRELATION_PAYLOAD" />
<HelixPreCommand Include="export RunCrossGen=1" Condition=" '$(RunCrossGen)' == 'true' " />
+ <HelixPreCommand Include="export RunInUnloadableContext=1" Condition=" '$(RunInUnloadableContext)' == 'true' " />
+ <HelixPreCommand Include="export CLRCustomTestLauncher=$HELIX_WORKITEM_PAYLOAD/runincontext.sh" Condition=" '$(RunInUnloadableContext)' == 'true' " />
<HelixPreCommand Include="export __TestEnv=$HELIX_WORKITEM_PAYLOAD/$(TestEnvFileName)" />
<HelixPreCommand Include="export __TestTimeout=$(TimeoutPerTestInMilliseconds)" Condition=" '$(TimeoutPerTestInMilliseconds)' != '' " />
<HelixPreCommand Include="cat $__TestEnv" />
set __SkipGenerateLayout=
set __BuildXUnitWrappers=
set __PrintLastResultsOnly=
-set __RunInUnloadableContext=
+set RunInUnloadableContext=
:Arg_Loop
if "%1" == "" goto ArgsDone
if /i "%1" == "gcstresslevel" (set COMPlus_GCStress=%2&set __TestTimeout=1800000&shift&shift&goto Arg_Loop)
if /i "%1" == "collectdumps" (set __CollectDumps=true&shift&goto Arg_Loop)
-if /i "%1" == "runincontext" (set __RunInUnloadableContext=1&shift&goto Arg_Loop)
+if /i "%1" == "runincontext" (set RunInUnloadableContext=1&shift&goto Arg_Loop)
if /i not "%1" == "msbuildargs" goto SkipMsbuildArgs
:: All the rest of the args will be collected and passed directly to msbuild.
set __RuntestPyArgs=%__RuntestPyArgs% -altjit_arch %__AltJitArch%
)
-if defined __RunInUnloadableContext (
+if defined RunInUnloadableContext (
set __RuntestPyArgs=%__RuntestPyArgs% --run_in_context
)
if run_in_context:
print("Running test in an unloadable AssemblyLoadContext")
os.environ["CLRCustomTestLauncher"] = os.path.join(coreclr_repo_location, "tests", "scripts", "runincontext%s" % (".cmd" if host_os == "Windows_NT" else ".sh"))
- os.environ["__RunInUnloadableContext"] = "1";
+ os.environ["RunInUnloadableContext"] = "1";
per_test_timeout = 20*60*1000
# Set __TestTimeout environment variable, which is the per-test timeout in milliseconds.
]]></BashCLRTestEnvironmentCompatibilityCheck>
<BashCLRTestEnvironmentCompatibilityCheck Condition="'$(UnloadabilityIncompatible)' == 'true'"><![CDATA[
$(BashCLRTestEnvironmentCompatibilityCheck)
-if [ ! -z "$__RunInUnloadableContext" ]
+if [ ! -z "$RunInUnloadableContext" ]
then
echo SKIPPING EXECUTION BECAUSE the test is incompatible with unloadability
exit $(GCBashScriptExitCode)
]]></BatchCLRTestEnvironmentCompatibilityCheck>
<BatchCLRTestEnvironmentCompatibilityCheck Condition="'$(UnloadabilityIncompatible)' == 'true'"><![CDATA[
$(BatchCLRTestEnvironmentCompatibilityCheck)
-IF NOT "%__RunInUnloadableContext%"=="" (
+IF NOT "%RunInUnloadableContext%"=="" (
ECHO SKIPPING EXECUTION BECAUSE the test is incompatible with unloadability
popd
Exit /b 0