[Tizen] Unify dnetmemoryenumlib terms to match the codebase (#291)
[platform/upstream/coreclr.git] / eng / test-job.yml
1 parameters:
2   buildConfig: ''
3   archType: ''
4   osGroup: ''
5   osIdentifier: ''
6   container: ''
7   testGroup: ''
8   readyToRun: false
9   helixQueues: ''
10   crossrootfsDir: ''
11   # If true, run the corefx tests instead of the coreclr ones
12   corefxTests: false
13   displayNameArgs: ''
14   runInUnloadableContext: false
15   ignoreDependencyOnBuildJobs: false
16
17 ### Test job
18
19 ### Each test job depends on a corresponding build job with the same
20 ### buildConfig and archType.
21
22 jobs:
23 - template: xplat-job.yml
24   parameters:
25     buildConfig: ${{ parameters.buildConfig }}
26     archType: ${{ parameters.archType }}
27     osGroup: ${{ parameters.osGroup }}
28     osIdentifier: ${{ parameters.osIdentifier }}
29     helixType: 'build/tests/'
30
31     # Test jobs should continue on error for internal builds
32     ${{ if eq(variables['System.TeamProject'], 'internal') }}:
33       continueOnError: true
34
35     # Compute job name from template parameters
36     ${{ if and(eq(parameters.testGroup, 'innerloop'), eq(parameters.displayNameArgs, '')) }}:
37       name: ${{ format('test_{0}_{1}_{2}_{3}', 'p0', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
38       displayName: ${{ format('Test {0} {1} {2} {3}', 'Pri0', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
39
40     ${{ if and(ne(parameters.testGroup, 'innerloop'), eq(parameters.displayNameArgs, '')) }}:
41       name: ${{ format('test_{0}_{1}_{2}_{3}', 'p1', parameters.displayNameArgs, parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
42       displayName: ${{ format('Test {0} {1} {2} {3}', 'Pri1', parameters.displayNameArgs, parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
43
44     ${{ if and(eq(parameters.testGroup, 'innerloop'), ne(parameters.displayNameArgs, '')) }}:
45       name: ${{ format('test_{0}_{1}_{2}_{3}_{4}', 'p0', parameters.displayNameArgs, parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
46       displayName: ${{ format('Test {0} {1} {2} {3} {4}', 'Pri0', parameters.displayNameArgs, parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
47
48     ${{ if and(ne(parameters.testGroup, 'innerloop'), ne(parameters.displayNameArgs, '')) }}:
49       name: ${{ format('test_{0}_{1}_{2}_{3}_{4}', 'p1', parameters.displayNameArgs, parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
50       displayName: ${{ format('Test {0} {1} {2} {3} {4}', 'Pri1', parameters.displayNameArgs, parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
51
52     crossrootfsDir: ${{ parameters.crossrootfsDir }}
53
54     variables:
55     - ${{ if eq(variables['System.TeamProject'], 'internal') }}:
56       - group: DotNet-HelixApi-Access
57
58     # Map template parameters to command line arguments
59     - name: priorityArg
60       value: ''
61     - ${{ if ne(parameters.testGroup, 'innerloop') }}:
62       - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
63         - name: priorityArg
64           value: 'priority1'
65       - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
66         - name: priorityArg
67           value: '-priority=1'
68
69     - name: crossgenArg
70       value: ''
71     - ${{ if eq(parameters.readyToRun, true) }}:
72       - name: crossgenArg
73         value: 'crossgen'
74
75     - name: clangArg
76       value: ''
77     # Our FreeBSD doesn't yet detect available clang versions, so pass it explicitly.
78     - ${{ if eq(parameters.osGroup, 'FreeBSD') }}:
79       - name: clangArg
80         value: '-clang6.0'
81     - ${{ if eq(parameters.archType, 'arm64') }}:
82       - name: clangArg
83         value: '-clang5.0'
84
85     - name: testhostArg
86       value: ''
87     - ${{ if eq(parameters.corefxTests, true) }}:
88       - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
89         - name: testhostArg
90           value: 'generatetesthostonly'
91       - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
92         - name: testhostArg
93           value: 'buildtesthostonly'
94
95     # FreeBSD test jobs are disabled since we don't have any FreeBSD helix queues.
96     ${{ if eq(parameters.osGroup, 'FreeBSD') }}:
97       condition: false
98
99     # Test job depends on the corresponding build job
100     ${{ if ne(parameters.ignoreDependencyOnBuildJobs, true) }}:
101       dependsOn: ${{ format('build_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
102
103     # Run all steps in the container.
104     # Note that the containers are defined in platform-matrix.yml
105     container: ${{ parameters.container }}
106
107     # "Total" means building tests, waiting for a queue in Helix to become available, and running the tests.
108     # In case test-job.yml gets split into two separate jobs (e.g. build-test-job.yml and run-test.yml)
109     # this number should be adjusted accordingly.
110     ${{ if eq(parameters.testGroup, 'innerloop') }}:
111       timeoutInMinutes: 240
112     ${{ if in(parameters.testGroup, 'outerloop') }}:
113       timeoutInMinutes: 360
114     ${{ if in(parameters.testGroup, 'jitstress', 'jitstress-isas-arm', 'jitstressregs-x86', 'jitstressregs', 'jitstress2-jitstressregs', 'gcstress0x3-gcstress0xc') }}:
115       timeoutInMinutes: 480
116     ${{ if in(parameters.testGroup, 'jitstress-isas-x86', 'gcstress-extra', 'r2r-extra') }}:
117       timeoutInMinutes: 600
118
119     steps:
120
121     # Install test build dependencies
122     - ${{ if eq(parameters.osGroup, 'OSX') }}:
123       - script: sh eng/install-native-dependencies.sh $(osGroup)
124         displayName: Install native dependencies
125
126
127     # Download product binaries directory
128     - task: DownloadBuildArtifacts@0
129       displayName: Download product build
130       inputs:
131         buildType: current
132         downloadType: single
133         artifactName: ${{ format('BinDir_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
134         downloadPath: $(System.ArtifactsDirectory)
135
136
137     # Populate Product directory
138     - task: CopyFiles@2
139       displayName: Populate Product directory
140       inputs:
141         sourceFolder: $(System.ArtifactsDirectory)/${{ format('BinDir_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
142         contents: '**'
143         targetFolder: $(Build.SourcesDirectory)/bin/Product/$(osGroup).$(archType).$(buildConfigUpper)
144
145
146     # Build tests
147     - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
148       - script: ./build-test.sh $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(crossgenArg) $(clangArg) $(testhostArg)
149         displayName: Build tests
150     - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
151       - script: build-test.cmd $(buildConfig) $(archType) $(priorityArg) $(crossgenArg) $(testhostArg)
152         displayName: Build tests
153
154
155     # Send tests to Helix
156     - template: /eng/send-to-helix-step.yml
157       parameters:
158         displayName: Send tests to Helix
159         buildConfig: $(buildConfigUpper)
160         archType: ${{ parameters.archType }}
161         osGroup: ${{ parameters.osGroup }}
162
163         ${{ if eq(variables['System.TeamProject'], 'public') }}:
164           creator: $(Build.DefinitionName)
165
166         helixBuild: $(Build.BuildNumber)
167         helixSource: $(_HelixSource)
168
169         # REVIEW: not sure why "cli" is part of the names here. Leave it for the ones that already had it,
170         # but don't add it to new ones.
171         ${{ if and(eq(parameters.corefxTests, true), eq(parameters.readyToRun, true)) }}:
172           helixType: 'test/functional/r2r_corefx/'
173         ${{ if and(eq(parameters.corefxTests, true), ne(parameters.readyToRun, true)) }}:
174           helixType: 'test/functional/corefx/'
175         ${{ if and(ne(parameters.corefxTests, true), eq(parameters.readyToRun, true)) }}:
176           helixType: 'test/functional/r2r/cli/'
177         ${{ if and(ne(parameters.corefxTests, true), ne(parameters.readyToRun, true)) }}:
178           helixType: 'test/functional/cli/'
179
180         helixQueues: ${{ parameters.helixQueues }}
181
182         # This tests whether an array is empty
183         ${{ if eq(join('', parameters.helixQueues), '') }}:
184           condition: false
185
186         publishTestResults: true
187
188         # Set job timeouts
189         #
190         # "timeoutPerTestCollectionInMinutes" is the time needed for the "biggest" xUnit test collection to complete.
191         # In case xUnit test wrappers get refactored this number should also be adjusted.
192         #
193         # "timeoutPerTestInMinutes" corresponds to individual test running time. This is implemented by setting
194         # the __TestTimeout variable, which is later read by the coreclr xunit test wrapper code (the code in the
195         # xunit test dlls that invokes the actual tests). Note this doesn't apply to CoreFX testing.
196
197         ${{ if and(eq(parameters.corefxTests, true), eq(parameters.testGroup, 'innerloop')) }}:
198           timeoutPerTestCollectionInMinutes: 120
199         ${{ if and(ne(parameters.corefxTests, true), eq(parameters.testGroup, 'innerloop')) }}:
200           timeoutPerTestCollectionInMinutes: 30
201           timeoutPerTestInMinutes: 10
202         ${{ if in(parameters.testGroup, 'outerloop') }}:
203           timeoutPerTestCollectionInMinutes: 120
204           timeoutPerTestInMinutes: 10
205         ${{ if in(parameters.testGroup, 'jitstress', 'jitstress-isas-arm', 'jitstress-isas-x86', 'jitstressregs-x86', 'jitstressregs', 'jitstress2-jitstressregs' ) }}:
206           timeoutPerTestCollectionInMinutes: 120
207           timeoutPerTestInMinutes: 30
208         ${{ if in(parameters.testGroup, 'gcstress0x3-gcstress0xc') }}:
209           timeoutPerTestCollectionInMinutes: 240
210           timeoutPerTestInMinutes: 60
211         ${{ if in(parameters.testGroup, 'gcstress-extra', 'r2r-extra') }}:
212           timeoutPerTestCollectionInMinutes: 300
213           timeoutPerTestInMinutes: 90
214
215         runCrossGen: ${{ parameters.readyToRun }}
216         runInUnloadableContext: ${{ parameters.runInUnloadableContext }}
217
218         ${{ if eq(variables['System.TeamProject'], 'internal') }}:
219           # Access token variable for internal project from the
220           # DotNet-HelixApi-Access variable group
221           helixAccessToken: $(HelixApiAccessToken)
222
223         # Choose which tests to send to Helix: CoreFX or CoreCLR.
224         ${{ if eq(parameters.corefxTests, true) }}:
225           helixProjectArguments: 'eng/helixcorefxtests.proj'
226         ${{ if ne(parameters.corefxTests, true) }}:
227           helixProjectArguments: 'tests/helixpublishwitharcade.proj'
228
229         ${{ if in(parameters.testGroup, 'innerloop', 'outerloop') }}:
230           scenarios:
231           - normal
232           - no_tiered_compilation
233         ${{ if in(parameters.testGroup, 'jitstress') }}:
234           scenarios:
235           - jitminopts
236           - jitstress1
237           - jitstress1_tiered
238           - jitstress2
239           - jitstress2_tiered
240           - zapdisable
241           - tailcallstress
242         ${{ if in(parameters.testGroup, 'jitstress-isas-arm') }}:
243           scenarios:
244           - jitstress_isas_incompletehwintrinsic
245           - jitstress_isas_nohwintrinsic
246           - jitstress_isas_nohwintrinsic_nosimd
247           - jitstress_isas_nosimd
248         ${{ if in(parameters.testGroup, 'jitstress-isas-x86') }}:
249           scenarios:
250           - jitstress_isas_incompletehwintrinsic
251           - jitstress_isas_nohwintrinsic
252           - jitstress_isas_nohwintrinsic_nosimd
253           - jitstress_isas_nosimd
254           - jitstress_isas_x86_noaes
255           - jitstress_isas_x86_noavx
256           - jitstress_isas_x86_noavx2
257           - jitstress_isas_x86_nobmi1
258           - jitstress_isas_x86_nobmi2
259           - jitstress_isas_x86_nofma
260           - jitstress_isas_x86_nohwintrinsic
261           - jitstress_isas_x86_nolzcnt
262           - jitstress_isas_x86_nopclmulqdq
263           - jitstress_isas_x86_nopopcnt
264           - jitstress_isas_x86_nosse
265           - jitstress_isas_x86_nosse2
266           - jitstress_isas_x86_nosse3
267           - jitstress_isas_x86_nosse3_4
268           - jitstress_isas_x86_nosse41
269           - jitstress_isas_x86_nosse42
270           - jitstress_isas_x86_nossse3
271         ${{ if in(parameters.testGroup, 'jitstressregs-x86') }}:
272           scenarios:
273           - jitstressregs1_x86_noavx
274           - jitstressregs2_x86_noavx
275           - jitstressregs3_x86_noavx
276           - jitstressregs4_x86_noavx
277           - jitstressregs8_x86_noavx
278           - jitstressregs0x10_x86_noavx
279           - jitstressregs0x80_x86_noavx
280           - jitstressregs0x1000_x86_noavx
281         ${{ if in(parameters.testGroup, 'jitstressregs' ) }}:
282           scenarios:
283           - jitstressregs1
284           - jitstressregs2
285           - jitstressregs3
286           - jitstressregs4
287           - jitstressregs8
288           - jitstressregs0x10
289           - jitstressregs0x80
290           - jitstressregs0x1000
291         ${{ if in(parameters.testGroup, 'jitstress2-jitstressregs') }}:
292           scenarios:
293           - jitstress2_jitstressregs1
294           - jitstress2_jitstressregs2
295           - jitstress2_jitstressregs3
296           - jitstress2_jitstressregs4
297           - jitstress2_jitstressregs8
298           - jitstress2_jitstressregs0x10
299           - jitstress2_jitstressregs0x80
300           - jitstress2_jitstressregs0x1000
301         ${{ if in(parameters.testGroup, 'gcstress0x3-gcstress0xc') }}:
302           scenarios:
303           - gcstress0x3
304           - gcstress0xc
305         ${{ if in(parameters.testGroup, 'gcstress-extra') }}:
306           scenarios:
307           - heapverify1
308           - gcstress0xc_zapdisable
309           - gcstress0xc_zapdisable_jitstress2
310           - gcstress0xc_zapdisable_heapverify1
311           - gcstress0xc_jitstress1
312           - gcstress0xc_jitstress2
313           - gcstress0xc_jitminopts_heapverify1
314         ${{ if in(parameters.testGroup, 'r2r-extra') }}:
315           scenarios:
316           - jitstress1
317           - jitstress2
318           - jitstress1_tiered
319           - jitstress2_tiered
320           - jitstressregs1
321           - jitstressregs2
322           - jitstressregs3
323           - jitstressregs4
324           - jitstressregs8
325           - jitstressregs0x10
326           - jitstressregs0x80
327           - jitstressregs0x1000
328           - jitminopts
329           - forcerelocs
330           - gcstress15
331
332     # Publish Logs
333     - task: PublishBuildArtifacts@1
334       displayName: Publish Logs
335       inputs:
336         pathtoPublish: $(Build.SourcesDirectory)/bin/Logs
337         ${{ if and(eq(parameters.corefxTests, true), eq(parameters.readyToRun, true)) }}:
338           artifactName: ${{ format('TestLogs_r2r_corefx_{0}_{1}_{2}_{3}', parameters.osIdentifier, parameters.archType, parameters.buildConfig, parameters.testGroup) }}
339         ${{ if and(eq(parameters.corefxTests, true), ne(parameters.readyToRun, true)) }}:
340           artifactName: ${{ format('TestLogs_corefx_{0}_{1}_{2}_{3}',     parameters.osIdentifier, parameters.archType, parameters.buildConfig, parameters.testGroup) }}
341         ${{ if and(ne(parameters.corefxTests, true), eq(parameters.readyToRun, true)) }}:
342           artifactName: ${{ format('TestLogs_r2r_{0}_{1}_{2}_{3}',        parameters.osIdentifier, parameters.archType, parameters.buildConfig, parameters.testGroup) }}
343         ${{ if and(ne(parameters.corefxTests, true), ne(parameters.readyToRun, true)) }}:
344           artifactName: ${{ format('TestLogs_{0}_{1}_{2}_{3}',            parameters.osIdentifier, parameters.archType, parameters.buildConfig, parameters.testGroup) }}
345       continueOnError: true
346       condition: always()