-
Notifications
You must be signed in to change notification settings - Fork 352
/
Microsoft.DotNet.Helix.Sdk.MonoQueue.targets
94 lines (83 loc) · 4.38 KB
/
Microsoft.DotNet.Helix.Sdk.MonoQueue.targets
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
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<EnableXUnitReporter Condition=" '$(EnableXUnitReporter)' != 'true' ">false</EnableXUnitReporter>
</PropertyGroup>
<PropertyGroup Condition=" '$(HelixTestConfigurationFilePath)' == '' ">
<HelixTestConfigurationFilePath Condition=" '$(RepositoryEngineeringDir)' != '' ">$(RepositoryEngineeringDir)/test-configuration.json</HelixTestConfigurationFilePath>
</PropertyGroup>
<Choose>
<When Condition="$(HelixTargetQueue.ToLowerInvariant().Contains('windows'))">
<PropertyGroup>
<IsPosixShell>false</IsPosixShell>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<IsPosixShell>true</IsPosixShell>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="$(_HelixMonoQueueTargets)" Condition="'$(_HelixMonoQueueTargets)' != ''"/>
<Target Name="AddXUnitReporter" Condition="$(EnableXUnitReporter)" BeforeTargets="CoreTest">
<ItemGroup>
<HelixCorrelationPayload Include="$(MSBuildThisFileDirectory)xunit-reporter"/>
</ItemGroup>
<PropertyGroup>
<HelixPostCommands Condition="$(IsPosixShell)">$(HelixPostCommands);$HELIX_PYTHONPATH -B $HELIX_CORRELATION_PAYLOAD/xunit-reporter.py</HelixPostCommands>
<HelixPostCommands Condition="!$(IsPosixShell)">$(HelixPostCommands);%HELIX_PYTHONPATH% -B %HELIX_CORRELATION_PAYLOAD%\xunit-reporter.py</HelixPostCommands>
<MaxRetryCount Condition="'$(MaxRetryCount)' == ''">0</MaxRetryCount>
</PropertyGroup>
</Target>
<ItemGroup>
<HelixProperties Condition="'$(HelixConfiguration)' != ''" Include="configuration" Value="$(HelixConfiguration)" />
<HelixProperties Condition="'$(HelixArchitecture)' != ''" Include="architecture" Value="$(HelixArchitecture)" />
<HelixProperties Include="operatingSystem" Value="$(HelixTargetQueue)" />
</ItemGroup>
<ItemGroup Condition="Exists('$(HelixTestConfigurationFilePath)')">
<HelixCorrelationPayload Include="$(HelixTestConfigurationFilePath)" AsArchive="false" />
</ItemGroup>
<Target Name="CoreBuild">
</Target>
<Target Name="CoreTest">
<PropertyGroup Condition="$(IsPosixShell)">
<HelixPreCommands>set -x;$(HelixPreCommands)</HelixPreCommands>
</PropertyGroup>
<SendHelixJob Type="$(HelixType)"
TargetQueue="$(HelixTargetQueue)"
IsPosixShell="$(IsPosixShell)"
Creator="$(Creator)"
BaseUri="$(HelixBaseUri)"
AccessToken="$(HelixAccessToken)"
MaxRetryCount="$(MaxRetryCount)"
PreCommands="$(HelixPreCommands)"
PostCommands="$(HelixPostCommands)"
CorrelationPayloads="@(HelixCorrelationPayload)"
WorkItems="@(HelixWorkItem)"
HelixProperties="@(HelixProperties)">
<Output TaskParameter="JobCorrelationId" PropertyName="HelixJobId"/>
<Output TaskParameter="JobCancellationToken" PropertyName="HelixJobCancellationToken"/>
<Output TaskParameter="ResultsContainerUri" PropertyName="HelixResultsContainer"/>
<Output TaskParameter="ResultsContainerReadSAS" PropertyName="HelixResultsContainerReadSAS"/>
</SendHelixJob>
<ItemGroup>
<SentJob Include="$(HelixJobId)">
<WorkItemCount>@(HelixWorkItem->Count())</WorkItemCount>
<HelixTargetQueue>$(HelixTargetQueue)</HelixTargetQueue>
<ResultsContainerUri>$(HelixResultsContainer)</ResultsContainerUri>
<ResultsContainerReadSAS>$(HelixResultsContainerReadSAS)</ResultsContainerReadSAS>
<HelixJobCancellationToken>$(HelixJobCancellationToken)</HelixJobCancellationToken>
</SentJob>
</ItemGroup>
<PropertyGroup>
<_AccessTokenSuffix />
<_AccessTokenSuffix Condition=" '$(HelixAccessToken)' != '' ">&access_token={Get this from helix.dot.net}</_AccessTokenSuffix>
</PropertyGroup>
<Message Condition=" '$(HelixBaseUri)' == '' " Text="Sent Helix Job; see work items at https://helix.dot.net/api/jobs/$(HelixJobId)/workitems?api-version=2019-06-17$(_AccessTokenSuffix)" Importance="High" />
<Message Condition=" '$(HelixBaseUri)' != '' " Text="Sent Helix Job; see work items at $(HelixBaseUri)/api/jobs/$(HelixJobId)/workitems?api-version=2019-06-17$(_AccessTokenSuffix)" Importance="High" />
</Target>
<Target Name="Test"
DependsOnTargets="$(TestDependsOn)"
Returns="@(SentJob)">
</Target>
</Project>