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