13 ### Each test job depends on a corresponding build job with the same
14 ### buildConfig and archType.
17 - template: xplat-job.yml
19 buildConfig: ${{ parameters.buildConfig }}
20 archType: ${{ parameters.archType }}
21 osGroup: ${{ parameters.osGroup }}
22 osIdentifier: ${{ parameters.osIdentifier }}
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) }}
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) }}
39 crossrootfsDir: ${{ parameters.crossrootfsDir }}
42 - ${{ if eq(variables['System.TeamProject'], 'internal') }}:
43 - group: DotNet-HelixApi-Access
44 # Map template parameters to command line arguments
47 - ${{ if ne(parameters.testGroup, 'innerloop') }}:
48 - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
51 - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
57 - ${{ if eq(parameters.readyToRun, true) }}:
63 # Our FreeBSD doesn't yet detect available clang versions, so pass it explicitly.
64 - ${{ if eq(parameters.osGroup, 'FreeBSD') }}:
67 - ${{ if and(eq(parameters.osIdentifier, 'Linux_musl'), eq(parameters.archType, 'arm64')) }}:
71 # FreeBSD test jobs are disabled since we don't have any FreeBSD helix queues.
72 ${{ if eq(parameters.osGroup, 'FreeBSD') }}:
75 # Test job depends on the corresponding build job
76 dependsOn: ${{ format('build_{0}_{1}_{2}', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
78 # Run all steps in the container.
79 # Note that the containers are resources defined in azure-pipelines.yml
80 containerName: ${{ parameters.containerName }}
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') }}:
87 ${{ if eq(parameters.testGroup, 'outerloop') }}:
89 ${{ if in(parameters.testGroup, 'outerloop-jitminopts-jitstress1-jitstress2', 'outerloop-jitstressregs', 'outerloop-jitstress2-jitstressregs', 'outerloop-gcstress0x3-gcstress0xc') }}:
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
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
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
111 artifactName: ${{ format('{0}_{1}_{2}_build', parameters.osIdentifier, parameters.archType, parameters.buildConfig) }}
112 targetPath: $(Build.SourcesDirectory)\bin\Product\Windows_NT.$(archType).$(buildConfigUpper)
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
125 # Send tests to Helix
126 - template: /eng/send-to-helix-step.yml
128 displayName: Send tests to Helix
129 buildConfig: ${{ parameters.buildConfig }}
130 archType: ${{ parameters.archType }}
131 osGroup: ${{ parameters.osGroup }}
133 ${{ if eq(variables['System.TeamProject'], 'public') }}:
134 creator: $(Build.DefinitionName)
136 helixBuild: $(Build.BuildNumber)
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)
145 ${{ if eq(parameters.readyToRun, false) }}:
146 helixType: 'test/functional/cli/'
147 ${{ if eq(parameters.readyToRun, true) }}:
148 helixType: 'test/functional/r2r/cli/'
150 helixQueues: ${{ parameters.helixQueues }}
152 # This tests whether an array is empty
153 ${{ if eq(join('', parameters.helixQueues), '') }}:
156 publishTestResults: true
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
174 runCrossGen: ${{ parameters.readyToRun }}
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)
181 ${{ if in(parameters.testGroup, 'innerloop', 'outerloop') }}:
184 - no_tiered_compilation
185 ${{ if eq(parameters.testGroup, 'outerloop-jitminopts-jitstress1-jitstress2') }}:
192 ${{ if eq(parameters.testGroup, 'outerloop-jitstressregs') }}:
201 - jitstressregs0x1000
202 ${{ if eq(parameters.testGroup, 'outerloop-jitstress2-jitstressregs') }}:
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') }}:
218 - task: PublishPipelineArtifact@0
219 displayName: Publish Logs
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