Update dependencies from https://github.com/dotnet/corefx build 20190414.16 (#23989)
[platform/upstream/coreclr.git] / eng / test-job.yml
1 parameters:
2   buildConfig: ''
3   archType: ''
4   osGroup: ''
5   osIdentifier: ''
6   testGroup: ''
7   readyToRun: false
8   helixQueues: ''
9   crossrootfsDir: ''
10
11 ### Test job
12
13 ### Each test job depends on a corresponding build job with the same
14 ### buildConfig and archType.
15
16 jobs:
17 - template: xplat-job.yml
18   parameters:
19     buildConfig: ${{ parameters.buildConfig }}
20     archType: ${{ parameters.archType }}
21     osGroup: ${{ parameters.osGroup }}
22     osIdentifier: ${{ parameters.osIdentifier }}
23
24     # Compute job name from template parameters
25     ${{ if and(eq(parameters.testGroup, 'innerloop'), eq(parameters.readyToRun, false)) }}:
26       name: ${{ format('testbuild_pri0_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
27       displayName: ${{ format('Test Pri0 {0} {1} {2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
28     ${{ if and(eq(parameters.testGroup, 'innerloop'), eq(parameters.readyToRun, true)) }}:
29       name: ${{ format('testbuild_pri0_r2r_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
30       displayName: ${{ format('Test Pri0 R2R {0} {1} {2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
31
32     ${{ if and(ne(parameters.testGroup, 'innerloop'), eq(parameters.readyToRun, false)) }}:
33       name: ${{ format('testbuild_pri1_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
34       displayName: ${{ format('Test Pri1 {0} {1} {2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
35     ${{ if and(ne(parameters.testGroup, 'innerloop'), eq(parameters.readyToRun, true)) }}:
36       name: ${{ format('testbuild_pri1_r2r_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
37       displayName: ${{ format('Test Pri1 R2R {0} {1} {2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
38
39     crossrootfsDir: ${{ parameters.crossrootfsDir }}
40
41     variables:
42     - ${{ if eq(variables['System.TeamProject'], 'internal') }}:
43       - group: DotNet-HelixApi-Access
44     # Map template parameters to command line arguments
45     - name: priorityArg
46       value: ''
47     - ${{ if ne(parameters.testGroup, 'innerloop') }}:
48       - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
49         - name: priorityArg
50           value: 'priority1'
51       - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
52         - name: priorityArg
53           value: '-priority=1'
54
55     - name: crossgenArg
56       value: ''
57     - ${{ if eq(parameters.readyToRun, true) }}:
58       - name: crossgenArg
59         value: 'crossgen'
60
61     - name: clangArg
62       value: ''
63     # Our FreeBSD doesn't yet detect available clang versions, so pass it explicitly.
64     - ${{ if eq(parameters.osGroup, 'FreeBSD') }}:
65       - name: clangArg
66         value: '-clang6.0'
67     - ${{ if and(eq(parameters.osIdentifier, 'Linux_musl'), eq(parameters.archType, 'arm64')) }}:
68       - name: clangArg
69         value: '-clang5.0'
70
71     # FreeBSD test jobs are disabled since we don't have any FreeBSD helix queues.
72     ${{ if eq(parameters.osGroup, 'FreeBSD') }}:
73       condition: false
74
75     # Test job depends on the corresponding build job
76     dependsOn: ${{ format('build_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
77
78     # Run all steps in the container.
79     # Note that the containers are resources defined in azure-pipelines.yml
80     containerName: ${{ parameters.containerName }}
81
82     # "Total" means building tests, waiting for a queue in Helix to become available, and running the tests.
83     # In case test-job.yml gets split into two separate jobs (e.g. build-test-job.yml and run-test.yml)
84     # this number should be adjusted accordingly.
85     ${{ if eq(parameters.testGroup, 'innerloop') }}:
86       timeoutInMinutes: 240
87     ${{ if eq(parameters.testGroup, 'outerloop') }}:
88       timeoutInMinutes: 360
89     ${{ if in(parameters.testGroup, 'outerloop-jitminopts-jitstress1-jitstress2', 'outerloop-jitstressregs', 'outerloop-jitstress2-jitstressregs', 'outerloop-gcstress0x3-gcstress0xc') }}:
90       timeoutInMinutes: 480
91
92     steps:
93
94     # Install test build dependencies
95     - ${{ if eq(parameters.osGroup, 'OSX') }}:
96       - script: sh eng/install-native-dependencies.sh $(osGroup)
97         displayName: Install native dependencies
98
99
100     # Download product build from pipeline artifact storage
101     - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
102       - task: DownloadPipelineArtifact@0
103         displayName: Download product build pipeline artifact
104         inputs:
105           artifactName: ${{ format('{0}_{1}_{2}_build', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
106           targetPath: $(Build.SourcesDirectory)/bin/Product/$(osGroup).$(archType).$(buildConfigUpper)
107     - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
108       - task: DownloadPipelineArtifact@0
109         displayName: Download product build pipeline artifact
110         inputs:
111           artifactName: ${{ format('{0}_{1}_{2}_build', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
112           targetPath: $(Build.SourcesDirectory)\bin\Product\Windows_NT.$(archType).$(buildConfigUpper)
113
114
115     # Build tests
116     # TODO: enable crossgen in build-test.sh
117     - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
118       - script: ./build-test.sh $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(crossgenArg) $(clangArg)
119         displayName: Build tests
120     - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
121       - script: build-test.cmd $(buildConfig) $(archType) $(priorityArg) $(crossgenArg)
122         displayName: Build tests
123
124
125     # Send tests to Helix
126     - template: /eng/send-to-helix-step.yml
127       parameters:
128         displayName: Send tests to Helix
129         buildConfig: ${{ parameters.buildConfig }}
130         archType: ${{ parameters.archType }}
131         osGroup: ${{ parameters.osGroup }}
132
133         ${{ if eq(variables['System.TeamProject'], 'public') }}:
134           creator: $(Build.DefinitionName)
135
136         helixBuild: $(Build.BuildNumber)
137
138         ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
139           helixSource: official/dotnet/coreclr/$(Build.SourceBranch)
140         ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}:
141           helixSource: pr/dotnet/coreclr/$(Build.SourceBranch)
142         ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}:
143           helixSource: ci/dotnet/coreclr/$(Build.SourceBranch)
144
145         ${{ if eq(parameters.readyToRun, false) }}:
146           helixType: 'test/functional/cli/'
147         ${{ if eq(parameters.readyToRun, true) }}:
148           helixType: 'test/functional/r2r/cli/'
149
150         helixQueues: ${{ parameters.helixQueues }}
151
152         # This tests whether an array is empty
153         ${{ if eq(join('', parameters.helixQueues), '') }}:
154           condition: false
155
156         publishTestResults: true
157
158         ${{ if eq(parameters.testGroup, 'innerloop') }}:
159           # "PerCollection" is time needed for the "biggest" xUnit test collection to complete.
160           # In case xUnit test wrappers get refactored this number should also be adjusted.
161           timeoutPerTestCollectionInMinutes: 30
162           # "PerTest" corresponds to individual test running time (i.e. __TestTimeout).
163           timeoutPerTestInMinutes: 10
164         ${{ if eq(parameters.testGroup, 'outerloop') }}:
165           timeoutPerTestCollectionInMinutes: 60
166           timeoutPerTestInMinutes: 10
167         ${{ if in(parameters.testGroup, 'outerloop-jitminopts-jitstress1-jitstress2', 'outerloop-jitstressregs', 'outerloop-jitstress2-jitstressregs') }}:
168           timeoutPerTestCollectionInMinutes: 120
169           timeoutPerTestInMinutes: 30
170         ${{ if in(parameters.testGroup, 'outerloop-gcstress0x3-gcstress0xc') }}:
171           timeoutPerTestCollectionInMinutes: 240
172           timeoutPerTestInMinutes: 60
173
174         runCrossGen: ${{ parameters.readyToRun }}
175
176         ${{ if eq(variables['System.TeamProject'], 'internal') }}:
177           # Access token variable for internal project from the
178           # DotNet-HelixApi-Access variable group
179           helixAccessToken: $(HelixApiAccessToken)
180
181         ${{ if in(parameters.testGroup, 'innerloop', 'outerloop') }}:
182           scenarios:
183           - normal
184           - no_tiered_compilation
185         ${{ if eq(parameters.testGroup, 'outerloop-jitminopts-jitstress1-jitstress2') }}:
186           scenarios:
187           - jitminopts
188           - jitstress1
189           - jitstress1_tiered
190           - jitstress2
191           - jitstress2_tiered
192         ${{ if eq(parameters.testGroup, 'outerloop-jitstressregs') }}:
193           scenarios:
194           - jitstressregs1
195           - jitstressregs2
196           - jitstressregs3
197           - jitstressregs4
198           - jitstressregs8
199           - jitstressregs0x10
200           - jitstressregs0x80
201           - jitstressregs0x1000
202         ${{ if eq(parameters.testGroup, 'outerloop-jitstress2-jitstressregs') }}:
203           scenarios:
204           - jitstress2_jitstressregs1
205           - jitstress2_jitstressregs2
206           - jitstress2_jitstressregs3
207           - jitstress2_jitstressregs4
208           - jitstress2_jitstressregs8
209           - jitstress2_jitstressregs0x10
210           - jitstress2_jitstressregs0x80
211           - jitstress2_jitstressregs0x1000
212         ${{ if eq(parameters.testGroup, 'outerloop-gcstress0x3-gcstress0xc') }}:
213           scenarios:
214           - gcstress0x3
215           - gcstress0xc
216
217     # Publish Logs
218     - task: PublishPipelineArtifact@0
219       displayName: Publish Logs
220       inputs:
221         ${{ if eq(parameters.readyToRun, false) }}:
222           artifactName: ${{ format('testbuild_{0}_{1}_{2}_{3}_Logs', parameters.osIdentifier, parameters.archType, parameters.buildConfig, parameters.testGroup) }}
223         ${{ if  eq(parameters.readyToRun, true) }}:
224           artifactName: ${{ format('testbuild_{0}_{1}_{2}_{3}_r2r_Logs', parameters.osIdentifier, parameters.archType, parameters.buildConfig, parameters.testGroup) }}
225         targetPath: $(Build.SourcesDirectory)/bin/Logs
226       continueOnError: true
227       condition: always()