1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
|
<Project DefaultTargets="RunInParallelForEachScenario">
<!-- This project uses the helix SDK, documented at
https://github.com/dotnet/arcade/tree/master/src/Microsoft.DotNet.Helix/Sdk,
to send test jobs to helix. -->
<Import Sdk="Microsoft.DotNet.Helix.Sdk" Project="Sdk.props" Condition=" '$(UsesHelixSdk)' == 'true' " />
<Import Sdk="Microsoft.Build.NoTargets" Project="Sdk.props" Condition=" '$(UsesHelixSdk)' != 'true' " />
<!-- This target runs once and creates several instances of this project (one for each scenario)
that will run in parallel. -->
<Target Name="RunInParallelForEachScenario">
<PropertyGroup>
<!-- This specifies what properties are needed to be passed down as global properties to a child project. -->
<_PropertiesToPass>
TargetArchitecture=$(TargetArchitecture);
TargetOS=$(TargetOS);
Configuration=$(Configuration);
Creator=$(_Creator);
HelixAccessToken=$(_HelixAccessToken);
HelixBuild=$(_HelixBuild);
HelixSource=$(_HelixSource);
HelixTargetQueues=$(_HelixTargetQueues);
HelixType=$(_HelixType);
PublishTestResults=$(_PublishTestResults);
RunCrossGen=$(_RunCrossGen);
RunCrossGen2=$(_RunCrossGen2);
CompositeBuildMode=$(_CompositeBuildMode);
LongRunningGCTests=$(_LongRunningGCTests);
GcSimulatorTests=$(_GcSimulatorTests);
RunInUnloadableContext=$(_RunInUnloadableContext);
TimeoutPerTestCollectionInMinutes=$(_TimeoutPerTestCollectionInMinutes);
TimeoutPerTestInMinutes=$(_TimeoutPerTestInMinutes);
RuntimeVariant=$(_RuntimeVariant);
BundledNETCoreAppPackageVersion=$(BundledNETCoreAppPackageVersion);
HelixRuntimeRid=$(HelixRuntimeRid);
PALTestsDir=$(_PALTestsDir)
</_PropertiesToPass>
<_PropertiesToPass Condition="'$(TargetOS)' == 'Browser' Or '$(TargetOS)' == 'Android'">
$(_PropertiesToPass);
IncludeDotNetCli=$(IncludeDotNetCli);
DotNetCliRuntime=$(DotNetCliRuntime);
DotNetCliPackageType=$(DotNetCliPackageType);
DotNetCliVersion=$(DotNetCliVersion)
</_PropertiesToPass>
</PropertyGroup>
<Message Text="DotNetCliVersion: $(DotNetCliVersion)" Importance="High" />
<Message Text="DotNetCliPackageType: $(DotNetCliPackageType)" Importance="High" />
<Message Text="HelixRuntimeRid: $(HelixRuntimeRid)" Importance="High" />
<Error Condition="'$(_Scenarios)' == ''" Text="_Scenarios not set" />
<MSBuild Projects="$(MSBuildProjectFile)" Targets="PrepareCorrelationPayloadDirectory" />
<MSBuild Projects="$(MSBuildProjectFile)" Targets="PreparePayloadsDirectories" Properties="Scenarios=$(_Scenarios)" StopOnFirstFailure="true" />
<MSBuild Projects="$(MSBuildProjectFile)" Targets="PreparePALTestArchive" Properties="$(_PropertiesToPass)" StopOnFirstFailure="true" />
<ItemGroup>
<_Scenarios Include="$(_Scenarios.Split(','))" />
<!-- MSBuild creates a new instance of the project for each %(_Scenarios.Identity) and can build them in parallel. -->
<_ProjectsToBuild Include="$(MSBuildProjectFile)">
<AdditionalProperties>$(_PropertiesToPass);Scenario=%(_Scenarios.Identity)</AdditionalProperties>
</_ProjectsToBuild>
</ItemGroup>
<PropertyGroup>
<_BuildInParallel>false</_BuildInParallel>
<_BuildInParallel Condition=" '@(_ProjectsToBuild->Count())' > '1' ">true</_BuildInParallel>
</PropertyGroup>
<MSBuild Projects="@(_ProjectsToBuild)" Targets="Test" BuildInParallel="$(_BuildInParallel)" StopOnFirstFailure="false" Properties="UsesHelixSdk=true" />
</Target>
<!-- Choose a suitable runtime RID for Helix to restore the dotnet cli -->
<PropertyGroup Condition="'$(HelixRuntimeRid)' == ''">
<TargetOSSpec>$(TargetOS)$(TargetOSSubgroup)</TargetOSSpec>
<HelixRuntimeRid Condition="'$(TargetOSSpec)' == 'windows'">win-$(TargetArchitecture)</HelixRuntimeRid>
<HelixRuntimeRid Condition="'$(TargetOSSpec)' == 'OSX'">osx-$(TargetArchitecture)</HelixRuntimeRid>
<HelixRuntimeRid Condition="'$(TargetOSSpec)' == 'Linux'">linux-$(TargetArchitecture)</HelixRuntimeRid>
<HelixRuntimeRid Condition="'$(TargetOSSpec)' == 'Linux_musl'">linux-musl-$(TargetArchitecture)</HelixRuntimeRid>
<HelixRuntimeRid Condition="'$(TargetOSSpec)' == 'Browser'">browser-wasm</HelixRuntimeRid>
<HelixRuntimeRid Condition="'$(TargetOSSpec)' == 'Android'">android-$(TargetArchitecture)</HelixRuntimeRid>
</PropertyGroup>
<PropertyGroup>
<CoreRootDirectory>$(TestBinDir)Tests\Core_Root\</CoreRootDirectory>
<PayloadsRootDirectory>$(TestBinDir)Payloads\</PayloadsRootDirectory>
<PayloadsRootDirectory>$([MSBuild]::NormalizeDirectory($(PayloadsRootDirectory)))</PayloadsRootDirectory>
<TestEnvFileName Condition=" '$(TestWrapperTargetsWindows)' == 'true' ">SetStressModes_$(Scenario).cmd</TestEnvFileName>
<TestEnvFileName Condition=" '$(TestWrapperTargetsWindows)' != 'true' ">SetStressModes_$(Scenario).sh</TestEnvFileName>
<IncludeDotNetCli>true</IncludeDotNetCli>
<DotNetCliPackageType>runtime</DotNetCliPackageType>
<DotNetCliVersion>5.0.0</DotNetCliVersion>
<DotNetCliRuntime>$(HelixRuntimeRid)</DotNetCliRuntime>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetOS)' == 'Browser' Or '$(TargetOS)' == 'Android'">
<DotNetCliPackageType>sdk</DotNetCliPackageType>
<GlobalJsonContent>$([System.IO.File]::ReadAllText('$(RepoRoot)global.json'))</GlobalJsonContent>
<DotNetCliVersion>$([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")'))</DotNetCliVersion>
<!-- wasm and Android needs to use the host OS DotnetCliRuntime -->
<DotNetCliRuntime>linux-x64</DotNetCliRuntime>
<DotNetCliRuntime Condition=" '$(TargetArchitecture)' == 'arm64' ">win-x64</DotNetCliRuntime>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetOS)' == 'Android'">
<IncludeXHarnessCli>true</IncludeXHarnessCli>
</PropertyGroup>
<Import Project="testgrouping.proj" />
<Target Name="DiscoverAllXUnitWrappers">
<ItemGroup>
<_XUnitWrapperDll Include="%(TestGrouping.XUnitWrapperDll)" Condition="Exists('%(XUnitWrapperDll)')">
<PayloadGroup>%(TestGroup)</PayloadGroup>
</_XUnitWrapperDll>
<_XUnitWrapperDll Include="@(XUnitWrapperGrouping)" />
<!-- This adds the remaining *.XUnitWrapper.dll files in TestBinDir unless
1) they are in PayloadsRootDirectory or
2) they are grouped by XUnitWrapperGrouping. -->
<_XUnitWrapperDll Include="$(TestBinDir)**\*.XUnitWrapper.dll" Exclude="$(PayloadsRootDirectory)**\*.XUnitWrapper.dll;@(XUnitWrapperGrouping->Metadata('FullPath'))">
<!-- Set PayloadGroup to empty string, so we can update _XUnitWrapperDll items with no PayloadGroup to default value. Unfortunatelly, we can't do this right here. -->
<PayloadGroup></PayloadGroup>
</_XUnitWrapperDll>
<!-- Assign "default" value of PayloadGroup metadata. -->
<_XUnitWrapperDll Update="@(_XUnitWrapperDll)">
<PayloadGroup Condition="'%(PayloadGroup)' == ''">$([MSBuild]::ValueOrDefault(%(FileName),'').Replace('.XUnitWrapper',''))</PayloadGroup>
</_XUnitWrapperDll>
</ItemGroup>
</Target>
<Target Name="PreparePayloadDirectory" Outputs="%(_XUnitWrapperDll.FileName)%(PayloadGroup)" DependsOnTargets="DiscoverAllXUnitWrappers">
<PropertyGroup>
<_FileDirectory>%(_XUnitWrapperDll.RootDir)%(Directory)</_FileDirectory>
<_PayloadGroup>%(_XUnitWrapperDll.PayloadGroup)</_PayloadGroup>
<_XUnitWrapperDll>%(_XUnitWrapperDll.FullPath)</_XUnitWrapperDll>
</PropertyGroup>
<ItemGroup>
<_TestGroupingRelevant Include="@(TestGrouping->WithMetadataValue('XUnitWrapperDll',$(_XUnitWrapperDll))->Metadata('FullPath'))" />
</ItemGroup>
<PropertyGroup>
<_TestGroupingExists>@(_TestGroupingRelevant->AnyHaveMetadataValue('TestGroup','$(_PayloadGroup)'))</_TestGroupingExists>
</PropertyGroup>
<ItemGroup>
<!-- If no TestGrouping is defined, all the files under $(_FileDirectory) and its subdirectories goes to the PayloadDirectory. -->
<_PayloadFiles Include="$(_FileDirectory)**" Exclude="@(_TestGroupingRelevant)" Condition="'$(_TestGroupingExists)' != 'true'" />
<!-- If there is a TestGrouping, then take only the files that belong to the TestGroup == $(_PayloadGroup). -->
<_PayloadFiles Include="@(_TestGroupingRelevant->WithMetadataValue('TestGroup','$(_PayloadGroup)')->DistinctWithCase())" Condition="'$(_TestGroupingExists)' == 'true'" />
<_PayloadFiles Include="$(_FileDirectory)*" Condition="'$(_TestGroupingExists)' == 'true'" />
<_PayloadFiles Update="@(_PayloadFiles)">
<!-- Never use [MSBuild]::MakeRelative here! We have some files containing Unicode characters in their %(FullPath) and
MakeRelative function calls Escape function internally that replaces all the Unicode characters with %<xx>. -->
<FileRelativeToPayloadsRootDirectory>$(_PayloadGroup)\$([System.IO.Path]::GetRelativePath($(TestBinDir), %(FullPath)))</FileRelativeToPayloadsRootDirectory>
</_PayloadFiles>
</ItemGroup>
<ItemGroup>
<!-- Remove the managed pdbs from our payloads.
This is for performance reasons to reduce our helix payload size -->
<ReducedPayloadFiles Include="@(_PayloadFiles)" Condition=" '%(Extension)' != '.pdb' " />
<ReducedPayloadFilesFinal Include="@(ReducedPayloadFiles)" Condition=" '%(Extension)' != '.sh' and '$(TestWrapperTargetsWindows)' == 'true' "/>
<ReducedPayloadFilesFinal Include="@(ReducedPayloadFiles)" Condition=" '%(Extension)' != '.cmd' and '$(TestWrapperTargetsWindows)' != 'true' "/>
</ItemGroup>
<Copy SourceFiles="@(ReducedPayloadFilesFinal)" DestinationFiles="@(ReducedPayloadFilesFinal->'$(PayloadsRootDirectory)%(FileRelativeToPayloadsRootDirectory)')" />
</Target>
<Target Name="PrepareCorrelationPayloadDirectory">
<MSBuild Projects="$(RepoRoot)src\tests\Common\xunitconsolerunner.depproj" Targets="Restore" />
<ItemGroup>
<_XUnitConsoleRunnerFiles Include="$(NuGetPackageRoot)Microsoft.DotNet.XUnitConsoleRunner\$(MicrosoftDotNetXUnitConsoleRunnerVersion)\**\xunit.console.*" />
</ItemGroup>
<Copy SourceFiles="@(_XUnitConsoleRunnerFiles)" DestinationFolder="$(CoreRootDirectory)\xunit" />
<Copy SourceFiles="$(MSBuildThisFileDirectory)scripts\runincontext.cmd" DestinationFolder="$(CoreRootDirectory)" Condition=" '$(TestWrapperTargetsWindows)' == 'true' and '$(_RunInUnloadableContext)' == 'true'" />
<Copy SourceFiles="$(MSBuildThisFileDirectory)scripts/runincontext.sh" DestinationFolder="$(CoreRootDirectory)" Condition=" '$(TestWrapperTargetsWindows)' != 'true' and '$(_RunInUnloadableContext)' == 'true'" />
</Target>
<Target Name="CreateTestEnvFiles">
<!-- This target creates one __TestEnv file for each combination of %(_PayloadGroups.Identity) and $(Scenario). -->
<ItemGroup>
<_PayloadGroups Include="$(PayloadGroups)" />
<_ProjectsToBuild Include="testenvironment.proj">
<Properties>Scenario=$(Scenario);TestEnvFileName=$(PayloadsRootDirectory)%(_PayloadGroups.Identity)\$(TestEnvFileName);TargetsWindows=$(TestWrapperTargetsWindows)</Properties>
</_ProjectsToBuild>
</ItemGroup>
<MSBuild Projects="@(_ProjectsToBuild)" Targets="CreateTestEnvFile" StopOnFirstFailure="true" />
</Target>
<Target Name="PreparePALTestArchive">
<Exec Condition="'$(PALTestsDir)' != '' and '$(TestWrapperTargetsWindows)' != 'true'"
WorkingDirectory="$(PALTestsDir)"
Command="tar -czvf $(PayloadsRootDirectory)paltests.tar.gz `ls -A`"/>
</Target>
<Target Name="PreparePayloadsDirectories" DependsOnTargets="PreparePayloadDirectory">
<PropertyGroup>
<_PayloadGroups>@(_XUnitWrapperDll->Metadata('PayloadGroup')->DistinctWithCase())</_PayloadGroups>
</PropertyGroup>
<ItemGroup>
<_Scenario Include="$(_Scenarios.Split(','))" />
<_ProjectsToBuild Include="$(MSBuildProjectFile)">
<AdditionalProperties>Scenario=%(_Scenario.Identity);PayloadGroups=$(_PayloadGroups)</AdditionalProperties>
</_ProjectsToBuild>
</ItemGroup>
<MSBuild Projects="@(_ProjectsToBuild)" Targets="CreateTestEnvFiles" StopOnFirstFailure="true" />
</Target>
<PropertyGroup>
<EnableAzurePipelinesReporter>$(PublishTestResults)</EnableAzurePipelinesReporter>
<EnableAzurePipelinesReporter Condition=" '$(EnableAzurePipelinesReporter)' == '' ">false</EnableAzurePipelinesReporter>
<EnableXUnitReporter>true</EnableXUnitReporter>
<FailOnMissionControlTestFailure>true</FailOnMissionControlTestFailure>
<FailOnWorkItemFailure>true</FailOnWorkItemFailure>
<HelixArchitecture>$(TargetArchitecture)</HelixArchitecture>
<HelixConfiguration Condition=" '$(Scenario)' == 'normal' ">$(Configuration)</HelixConfiguration>
<HelixConfiguration Condition=" '$(Scenario)' != 'normal' ">$(Configuration)-$(Scenario)</HelixConfiguration>
<RunCrossGen Condition=" '$(RunCrossGen)' != 'true' ">false</RunCrossGen>
<RunCrossGen2 Condition=" '$(RunCrossGen2)' != 'true' ">false</RunCrossGen2>
<LongRunningGCTests Condition=" '$(LongRunningGCTests)' != 'true' ">false</LongRunningGCTests>
<GcSimulatorTests Condition=" '$(GcSimulatorTests)' != 'true' ">false</GcSimulatorTests>
<TestRunNamePrefix Condition="'$(RuntimeFlavorDisplayName)' != ''">$(RuntimeFlavorDisplayName) </TestRunNamePrefix>
<TestRunNamePrefix Condition=" '$(RunCrossGen)' == 'true' ">R2R </TestRunNamePrefix>
<TestRunNamePrefix Condition=" '$(RunCrossGen2)' == 'true' ">R2R-CG2 </TestRunNamePrefix>
<TestRunNamePrefix Condition=" '$(Scenario)' == 'normal' ">$(TestRunNamePrefix)$(TargetOS) $(TargetArchitecture) $(Configuration) @ </TestRunNamePrefix>
<TestRunNamePrefix Condition=" '$(Scenario)' != 'normal' ">$(TestRunNamePrefix)$(TargetOS) $(TargetArchitecture) $(Configuration) $(Scenario) @ </TestRunNamePrefix>
<TimeoutPerTestInMilliseconds Condition=" '$(TimeoutPerTestInMinutes)' != '' ">$([System.TimeSpan]::FromMinutes($(TimeoutPerTestInMinutes)).TotalMilliseconds)</TimeoutPerTestInMilliseconds>
<WaitForWorkItemCompletion>true</WaitForWorkItemCompletion>
<_XUnitParallelMode>collections</_XUnitParallelMode>
<_XUnitParallelMode Condition=" '$(TargetOS)' == 'Android' ">none</_XUnitParallelMode>
<_XUnitParallelMode Condition=" '$(LongRunningGCTests)' == 'true' ">none</_XUnitParallelMode>
<_XUnitParallelMode Condition=" '$(GcSimulatorTests)' == 'true' ">none</_XUnitParallelMode>
<XUnitRunnerArgs>-parallel $(_XUnitParallelMode) -nocolor -noshadow -xml testResults.xml</XUnitRunnerArgs>
</PropertyGroup>
<!-- WARNING: HelixPreCommand ItemGroup is intentionally minimal and should be kept that way. -->
<ItemGroup Condition=" '$(TestWrapperTargetsWindows)' == 'true' ">
<HelixPreCommand Include="set CORE_ROOT=%HELIX_CORRELATION_PAYLOAD%" />
<!-- Set _NT_SYMBOL_PATH so VM _ASSERTE() asserts can find the symbol files when doing stack walks -->
<HelixPreCommand Include="set _NT_SYMBOL_PATH=%HELIX_CORRELATION_PAYLOAD%\PDB" />
<HelixPreCommand Include="set RunCrossGen=1" Condition=" '$(RunCrossGen)' == 'true' " />
<HelixPreCommand Include="set RunCrossGen2=1" Condition=" '$(RunCrossGen2)' == 'true' " />
<HelixPreCommand Include="set CompositeBuildMode=1" Condition=" '$(CompositeBuildMode)' == 'true' " />
<HelixPreCommand Include="set RunningLongGCTests=1" Condition=" '$(LongRunningGCTests)' == 'true' " />
<HelixPreCommand Include="set RunningGCSimulatorTests=1" Condition=" '$(GcSimulatorTests)' == '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="set __CollectDumps=1" />
<HelixPreCommand Include="set __CrashDumpFolder=%HELIX_DUMP_FOLDER%" />
<HelixPreCommand Include="type %__TestEnv%" />
</ItemGroup>
<ItemGroup Condition=" '$(TestWrapperTargetsWindows)' != 'true' ">
<HelixPreCommand Include="export CORE_ROOT=$HELIX_CORRELATION_PAYLOAD" />
<HelixPreCommand Include="export RunCrossGen=1" Condition=" '$(RunCrossGen)' == 'true' " />
<HelixPreCommand Include="export RunCrossGen2=1" Condition=" '$(RunCrossGen2)' == 'true' " />
<HelixPreCommand Include="export CompositeBuildMode=1" Condition=" '$(CompositeBuildMode)' == 'true' " />
<HelixPreCommand Include="export RunningLongGCTests=1" Condition=" '$(LongRunningGCTests)' == 'true' " />
<HelixPreCommand Include="export RunningGCSimulatorTests=1" Condition=" '$(GcSimulatorTests)' == 'true' " />
<HelixPreCommand Include="export RunInUnloadableContext=1" Condition=" '$(RunInUnloadableContext)' == 'true' " />
<HelixPreCommand Include="export CLRCustomTestLauncher=$HELIX_CORRELATION_PAYLOAD/runincontext.sh" Condition=" '$(RunInUnloadableContext)' == 'true' " />
<HelixPreCommand Include="export __TestEnv=$HELIX_WORKITEM_PAYLOAD/$(TestEnvFileName)" />
<HelixPreCommand Include="export __TestTimeout=$(TimeoutPerTestInMilliseconds)" Condition=" '$(TimeoutPerTestInMilliseconds)' != '' " />
<HelixPreCommand Include="export __CollectDumps=1" />
<HelixPreCommand Include="export __CrashDumpFolder=$HELIX_DUMP_FOLDER" />
<HelixPreCommand Include="cat $__TestEnv" />
</ItemGroup>
<PropertyGroup>
<HelixPreCommands>@(HelixPreCommand)</HelixPreCommands>
</PropertyGroup>
<PropertyGroup Condition=" '$(TestWrapperTargetsWindows)' == 'true' ">
<XUnitRunnerDll>%CORE_ROOT%\xunit\xunit.console.dll</XUnitRunnerDll>
</PropertyGroup>
<PropertyGroup Condition=" '$(TestWrapperTargetsWindows)' != 'true' ">
<XUnitRunnerDll>$CORE_ROOT/xunit/xunit.console.dll</XUnitRunnerDll>
</PropertyGroup>
<ItemGroup Condition=" '$(UsesHelixSdk)' == 'true' ">
<HelixCorrelationPayload Include="$(CoreRootDirectory)" />
<Payloads Include="$([System.IO.Directory]::GetDirectories($(PayloadsRootDirectory)))" Condition="Exists('$(PayloadsRootDirectory)')" />
<Payloads Update="@(Payloads)">
<PayloadGroup>$([MSBuild]::MakeRelative($(PayloadsRootDirectory), %(FullPath)))</PayloadGroup>
<PayloadDirectory>%(FullPath)</PayloadDirectory>
<XUnitWrapperDlls>$([System.String]::Join(' ', $([System.IO.Directory]::GetFiles(%(FullPath), '*.XUnitWrapper.dll', SearchOption.AllDirectories))).Replace($([MSBuild]::EnsureTrailingSlash(%(FullPath))),''))</XUnitWrapperDlls>
</Payloads>
<Payloads Update="@(Payloads)">
<TestGroup>%(PayloadGroup)</TestGroup>
<!-- When Payload contains more than one *.XUnitWrapper.dll TestGroup should not be specified. -->
<TestGroup Condition=" $([MSBuild]::ValueOrDefault(%(XUnitWrapperDlls), '').IndexOf('.XUnitWrapper.dll')) != $([MSBuild]::ValueOrDefault(%(XUnitWrapperDlls), '').LastIndexOf('.XUnitWrapper.dll')) "></TestGroup>
</Payloads>
<HelixWorkItem Include="@(Payloads->Metadata('PayloadGroup'))">
<PayloadDirectory>%(PayloadDirectory)</PayloadDirectory>
<Command>dotnet $(XUnitRunnerDll) %(XUnitWrapperDlls) $(XUnitRunnerArgs)</Command>
<Command Condition=" '%(TestGroup)' != '' ">dotnet $(XUnitRunnerDll) %(XUnitWrapperDlls) $(XUnitRunnerArgs) -trait TestGroup=%(TestGroup)</Command>
<Timeout Condition=" '$(TimeoutPerTestCollectionInMinutes)' != '' ">$([System.TimeSpan]::FromMinutes($(TimeoutPerTestCollectionInMinutes)))</Timeout>
</HelixWorkItem>
<HelixWorkItem Condition="'$(PALTestsDir)' != '' and '$(TestWrapperTargetsWindows)' != 'true'" Include="PALTests">
<PayloadArchive>$(PayloadsRootDirectory)paltests.tar.gz</PayloadArchive>
<Command>./runpaltestshelix.sh</Command>
<Timeout Condition=" '$(TimeoutPerTestCollectionInMinutes)' != '' ">$([System.TimeSpan]::FromMinutes($(TimeoutPerTestCollectionInMinutes)))</Timeout>
</HelixWorkItem>
</ItemGroup>
<Import Sdk="Microsoft.DotNet.Helix.Sdk" Project="Sdk.targets" Condition=" '$(UsesHelixSdk)' == 'true' " />
<Import Sdk="Microsoft.Build.NoTargets" Project="Sdk.targets" Condition=" '$(UsesHelixSdk)' != 'true' " />
</Project>
|