Update PgoData to release-20180530-0051 (#18194)
[platform/upstream/coreclr.git] / tests / helixpublish.proj
1 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2
3   <PropertyGroup>
4     <__BuildArch>$(Platform)</__BuildArch>
5   </PropertyGroup>
6   
7   <Import Project="..\dir.props" />
8   <!-- CoreClr-Specific Helix test submission project. -->
9
10   <PropertyGroup>
11     <!-- Workaround for dealing with building on Linux/OSX.  
12          It doesn't seem possible to pass a connection string on the command line, as it contains ';' characters. 
13          Checking for the existence of a connection string will happen inside CloudTest.Helix.targets -->
14     <CloudDropConnectionString    Condition="'$(CloudDropConnectionString)'==''"   >DefaultEndpointsProtocol=https;AccountName=$(CloudDropAccountName);AccountKey=$(CloudDropAccessToken);EndpointSuffix=core.windows.net</CloudDropConnectionString>
15     <CloudResultsConnectionString Condition="'$(CloudResultsConnectionString)'==''">DefaultEndpointsProtocol=https;AccountName=$(CloudResultsAccountName);AccountKey=$(CloudResultsAccessToken);EndpointSuffix=core.windows.net</CloudResultsConnectionString>    
16
17     <!-- Finally, these archives represent the zips of tests that are OSPlatform specific 
18          This is used by CloudTest.Helix.Targets to generate relative blob paths for archives. -->
19     <ArchivesRoot>$(TestWorkingDir)/archive/</ArchivesRoot>
20     <TestArchivesRoot>$(ArchivesRoot)tests</TestArchivesRoot> 
21
22     <RunnerScript Condition="'$(RunnerScript)' == ''">$(TestRunnerScript)</RunnerScript>
23     <SupplementalPayloadDir Condition="'$(SupplementalPayloadDir)' == ''">$(TestWorkingDir)SupplementalPayload/</SupplementalPayloadDir>
24
25     <!-- The old CloudTest.targets forced a single timeout value onto every test -->
26     <!-- Possible TODO: With the CloudTest.Helix.targets refactor, we have the ability to specify variable timeout-->
27     <TimeoutInSeconds Condition="'$(TimeoutInSeconds)' == ''">1000</TimeoutInSeconds>
28
29     <!-- Set required properties for Helix Submission -->
30     <IsOfficial Condition="'$(OfficialBuildId)'!=''">true</IsOfficial>
31     <CurrentDate>$([System.DateTime]::Now.ToString(yyyyMMdd.mmss))</CurrentDate>
32
33     <HelixJobType Condition="'$(HelixJobType)'==''">test/functional/cli/</HelixJobType>
34
35     <!-- Detect whether we are on a product construction build via ProductBuildId. If so, set source appropriately -->
36     <HelixSource Condition="'$(HelixSource)'=='' And '$(IsOfficial)'!='' And '$(TestProduct)'!='' And '$(Branch)'!='' And '$(ProductBuildId)'!=''">prodcon/$(TestProduct)/$(Branch)/</HelixSource>
37     <HelixSource Condition="'$(HelixSource)'=='' And '$(IsOfficial)'!='' And '$(TestProduct)'!='' And '$(Branch)'!=''">official/$(TestProduct)/$(Branch)/</HelixSource>
38     <HelixSource Condition="'$(HelixSource)'=='' And '$(IsOfficial)'=='' And '$(TestProduct)'!='' And '$(Branch)'!=''">pr/$(TestProduct)/$(Branch)/</HelixSource>
39     <HelixSource Condition="'$(HelixSource)'==''">pr/unknown/</HelixSource>
40
41     <!-- Local path for storing submission-related files -->
42     <HelixLogFolder>$(ArchivesRoot)</HelixLogFolder>
43
44     <!-- Properties used for submission by CloudTest.Helix.Targets-->
45     <BuildMoniker>$(CurrentDate)</BuildMoniker>
46     <BuildMoniker Condition="'$(IsOfficial)'=='true' And '$(ProductBuildId)'==''">$(OfficialBuildId)</BuildMoniker>
47     <BuildMoniker Condition="'$(IsOfficial)'=='true' And '$(ProductBuildId)'!=''">$(ProductBuildId)</BuildMoniker>
48     <HelixArchLabel>$(Platform)</HelixArchLabel>
49     <HelixConfigLabel>$(BuildType)</HelixConfigLabel>
50     <TestListFilename>$(Rid)-$(BuildType)-TestList.json</TestListFilename>
51   </PropertyGroup>
52
53   <!-- Set Helix environment vars based on target platform -->
54   <!-- This is only used in the case where property 'UseScriptRunner' is true.-->
55   <PropertyGroup Condition="'$(TargetsWindows)' == 'true'">
56     <HelixPythonPath>%HELIX_PYTHONPATH%</HelixPythonPath>
57     <RunnerScript>%HELIX_CORRELATION_PAYLOAD%\RunnerScripts\scriptrunner\scriptrunner.py</RunnerScript>
58   </PropertyGroup>
59
60   <PropertyGroup Condition="'$(TargetsWindows)' != 'true'">
61     <HelixPythonPath>$HELIX_PYTHONPATH</HelixPythonPath>
62     <RunnerScript>$HELIX_CORRELATION_PAYLOAD/RunnerScripts/scriptrunner/scriptrunner.py</RunnerScript>
63   </PropertyGroup>
64
65   <Target Name="CoreClrPreCloudBuild" >
66     <!-- Put anything you want to do before submitting the general purpose helix job here.
67          Helix requires properly formatted work items and accessible zip files / others to upload, which we'll construct here. -->
68     
69     <!-- Gather the test archives for this build 
70          If you change binplacing behavior and official runs break, 
71          this is a good place to check.-->
72     <ItemGroup>
73       <HelixWorkItem Include="$(TestArchivesRoot)/*.zip" /> 
74     </ItemGroup>
75     <Message Text="Full test archive collection : @(HelixWorkItem)" Importance="Low" />
76
77     <!-- Verify the test archives exist.  
78          NOTE: It may be better to make this an error, but in the past we chose not to as this causes a build break when triggered, versus just no tests run. -->
79     <Warning Condition="'@(HelixWorkItem->Count())' == '0'" Text="Didn't find any test archives in supplied folders!!! Review logs to see where test archive(s) were placed and fix." />
80
81     <ItemGroup>      
82       <HelixCorrelationPayloadFile Include="$(ArchivesRoot)Core_Root*/*.zip">
83         <RelativeBlobPath>$(Platform)$(BuildType)/%(Identity)</RelativeBlobPath>
84       </HelixCorrelationPayloadFile>
85       <HelixWorkItem>
86         <Command Condition="'$(TargetsWindows)' == 'true'">$(HelixPythonPath) $(RunnerScript) --script %HELIX_WORKITEM_PAYLOAD%\runtests.cmd</Command>
87         <Command Condition="'$(TargetsWindows)' != 'true'">chmod +x $HELIX_WORKITEM_PAYLOAD/runtests.sh &amp;&amp; $(HelixPythonPath) $(RunnerScript) --script $HELIX_WORKITEM_PAYLOAD/runtests.sh</Command>
88         <PayloadFile>%(Identity)</PayloadFile>
89         <WorkItemId>%(Filename)</WorkItemId>
90         <TimeoutInSeconds>$(TimeoutInSeconds)</TimeoutInSeconds>
91         <RelativeBlobPath>$(Platform)-$(BuildType)-$(Rid)/Tests/$([System.String]::Copy('%(RecursiveDir)').Replace('\', '/'))%(Filename)%(Extension)</RelativeBlobPath>
92       </HelixWorkItem>      
93     </ItemGroup>
94   </Target>
95
96   <!-- Import this at the end so that it can compose properties as needed -->
97   <Import Project="$(ToolsDir)CloudTest.Helix.targets" />
98
99   <!-- main Entrypoint -->
100   <Target Name="Build">
101     <Message Text="CoreClr-specific Helix test upload project, beginning submission to Helix" />
102     <Message Condition="'$(EnableCloudTest)' == 'false'" Text="... skipping upload / submission due to property 'EnableCloudTest' being set to 'false'" />
103     <CallTarget Condition="'$(EnableCloudTest)' != 'false'" Targets="CoreClrPreCloudBuild;HelixCloudBuild" />
104   </Target>
105   
106 </Project>