1 // Import the utility functionality.
3 import jobs.generation.*
5 // The input project name (e.g. dotnet/coreclr)
6 def project = GithubProject
7 // The input branch name (e.g. master)
8 def branch = GithubBranchName
9 def projectFolder = Utilities.getFolderName(project) + '/' + Utilities.getFolderName(branch)
11 // Create a folder for JIT stress jobs and associated folder views
13 Utilities.addStandardFolderView(this, 'jitstress', project)
15 // Create a folder for testing via illink
17 Utilities.addStandardFolderView(this, 'illink', project)
19 def static getOSGroup(def os) {
20 def osGroupMap = ['Ubuntu':'Linux',
22 'Ubuntu16.04': 'Linux',
23 'Ubuntu16.10': 'Linux',
27 'Windows_NT':'Windows_NT',
30 def osGroup = osGroupMap.get(os, null)
31 assert osGroup != null : "Could not find os group for ${os}"
35 // We use this class (vs variables) so that the static functions can access data here.
38 // We have very limited ARM64 hardware (used for ARM/ARMLB/ARM64 testing). So only allow certain branches to use it.
39 def static WindowsArm64Branches = [
42 // Innerloop build OS's
43 // The Windows_NT_BuildOnly OS is a way to speed up the Non-Windows builds by avoiding
44 // test execution in the build flow runs. It generates the exact same build
45 // as Windows_NT but without running the tests.
51 'Windows_NT_BuildOnly',
59 def static crossList = ['Ubuntu', 'OSX10.12', 'CentOS7.1', 'RHEL7.2', 'Debian8.4', 'Windows_NT']
61 // This is a set of JIT stress modes combined with the set of variables that
62 // need to be set to actually enable that stress mode. The key of the map is the stress mode and
63 // the values are the environment variables
64 def static jitStressModeScenarios = [
65 'minopts' : ['COMPlus_JITMinOpts' : '1'],
66 'tieredcompilation' : ['COMPlus_EXPERIMENTAL_TieredCompilation' : '1'],
67 'forcerelocs' : ['COMPlus_ForceRelocs' : '1'],
68 'jitstress1' : ['COMPlus_JitStress' : '1'],
69 'jitstress2' : ['COMPlus_JitStress' : '2'],
70 'jitstressregs1' : ['COMPlus_JitStressRegs' : '1'],
71 'jitstressregs2' : ['COMPlus_JitStressRegs' : '2'],
72 'jitstressregs3' : ['COMPlus_JitStressRegs' : '3'],
73 'jitstressregs4' : ['COMPlus_JitStressRegs' : '4'],
74 'jitstressregs8' : ['COMPlus_JitStressRegs' : '8'],
75 'jitstressregs0x10' : ['COMPlus_JitStressRegs' : '0x10'],
76 'jitstressregs0x80' : ['COMPlus_JitStressRegs' : '0x80'],
77 'jitstressregs0x1000' : ['COMPlus_JitStressRegs' : '0x1000'],
78 'jitstress2_jitstressregs1' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '1'],
79 'jitstress2_jitstressregs2' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '2'],
80 'jitstress2_jitstressregs3' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '3'],
81 'jitstress2_jitstressregs4' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '4'],
82 'jitstress2_jitstressregs8' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '8'],
83 'jitstress2_jitstressregs0x10' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '0x10'],
84 'jitstress2_jitstressregs0x80' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '0x80'],
85 'jitstress2_jitstressregs0x1000' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '0x1000'],
86 'tailcallstress' : ['COMPlus_TailcallStress' : '1'],
87 'jitsse2only' : ['COMPlus_EnableAVX' : '0', 'COMPlus_EnableSSE3_4' : '0'],
88 'jitnosimd' : ['COMPlus_FeatureSIMD' : '0'],
89 'jitincompletehwintrinsic' : ['COMPlus_EnableIncompleteISAClass' : '1'],
90 'jitx86hwintrinsicnoavx' : ['COMPlus_EnableIncompleteISAClass' : '1', 'COMPlus_EnableAVX' : '0'], // testing the legacy SSE encoding
91 'jitx86hwintrinsicnoavx2' : ['COMPlus_EnableIncompleteISAClass' : '1', 'COMPlus_EnableAVX2' : '0'], // testing SNB/IVB
92 'jitx86hwintrinsicnosimd' : ['COMPlus_EnableIncompleteISAClass' : '1', 'COMPlus_FeatureSIMD' : '0'], // match "jitnosimd", may need to remove after decoupling HW intrinsic from FeatureSIMD
93 'jitnox86hwintrinsic' : ['COMPlus_EnableIncompleteISAClass' : '1', 'COMPlus_EnableSSE' : '0' , 'COMPlus_EnableSSE2' : '0' , 'COMPlus_EnableSSE3' : '0' , 'COMPlus_EnableSSSE3' : '0' , 'COMPlus_EnableSSE41' : '0' , 'COMPlus_EnableSSE42' : '0' , 'COMPlus_EnableAVX' : '0' , 'COMPlus_EnableAVX2' : '0' , 'COMPlus_EnableAES' : '0' , 'COMPlus_EnableBMI1' : '0' , 'COMPlus_EnableBMI2' : '0' , 'COMPlus_EnableFMA' : '0' , 'COMPlus_EnableLZCNT' : '0' , 'COMPlus_EnablePCLMULQDQ' : '0' , 'COMPlus_EnablePOPCNT' : '0'],
94 'corefx_baseline' : [ : ], // corefx baseline
95 'corefx_minopts' : ['COMPlus_JITMinOpts' : '1'],
96 'corefx_tieredcompilation' : ['COMPlus_EXPERIMENTAL_TieredCompilation' : '1'],
97 'corefx_jitstress1' : ['COMPlus_JitStress' : '1'],
98 'corefx_jitstress2' : ['COMPlus_JitStress' : '2'],
99 'corefx_jitstressregs1' : ['COMPlus_JitStressRegs' : '1'],
100 'corefx_jitstressregs2' : ['COMPlus_JitStressRegs' : '2'],
101 'corefx_jitstressregs3' : ['COMPlus_JitStressRegs' : '3'],
102 'corefx_jitstressregs4' : ['COMPlus_JitStressRegs' : '4'],
103 'corefx_jitstressregs8' : ['COMPlus_JitStressRegs' : '8'],
104 'corefx_jitstressregs0x10' : ['COMPlus_JitStressRegs' : '0x10'],
105 'corefx_jitstressregs0x80' : ['COMPlus_JitStressRegs' : '0x80'],
106 'corefx_jitstressregs0x1000' : ['COMPlus_JitStressRegs' : '0x1000'],
107 'gcstress0x3' : ['COMPlus_GCStress' : '0x3'],
108 'gcstress0xc' : ['COMPlus_GCStress' : '0xC'],
109 'zapdisable' : ['COMPlus_ZapDisable' : '1', 'COMPlus_ReadyToRun' : '0'],
110 'heapverify1' : ['COMPlus_HeapVerify' : '1'],
111 'gcstress0xc_zapdisable' : ['COMPlus_GCStress' : '0xC', 'COMPlus_ZapDisable' : '1', 'COMPlus_ReadyToRun' : '0'],
112 'gcstress0xc_zapdisable_jitstress2' : ['COMPlus_GCStress' : '0xC', 'COMPlus_ZapDisable' : '1', 'COMPlus_ReadyToRun' : '0', 'COMPlus_JitStress' : '2'],
113 'gcstress0xc_zapdisable_heapverify1' : ['COMPlus_GCStress' : '0xC', 'COMPlus_ZapDisable' : '1', 'COMPlus_ReadyToRun' : '0', 'COMPlus_HeapVerify' : '1'],
114 'gcstress0xc_jitstress1' : ['COMPlus_GCStress' : '0xC', 'COMPlus_JitStress' : '1'],
115 'gcstress0xc_jitstress2' : ['COMPlus_GCStress' : '0xC', 'COMPlus_JitStress' : '2'],
116 'gcstress0xc_minopts_heapverify1' : ['COMPlus_GCStress' : '0xC', 'COMPlus_JITMinOpts' : '1', 'COMPlus_HeapVerify' : '1']
119 // This is a set of ReadyToRun stress scenarios
120 def static r2rStressScenarios = [
121 'r2r_jitstress1' : ["COMPlus_JitStress": "1"],
122 'r2r_jitstress2' : ["COMPlus_JitStress": "2"],
123 'r2r_jitstressregs1' : ["COMPlus_JitStressRegs": "1"],
124 'r2r_jitstressregs2' : ["COMPlus_JitStressRegs": "2"],
125 'r2r_jitstressregs3' : ["COMPlus_JitStressRegs": "3"],
126 'r2r_jitstressregs4' : ["COMPlus_JitStressRegs": "4"],
127 'r2r_jitstressregs8' : ["COMPlus_JitStressRegs": "8"],
128 'r2r_jitstressregs0x10' : ["COMPlus_JitStressRegs": "0x10"],
129 'r2r_jitstressregs0x80' : ["COMPlus_JitStressRegs": "0x80"],
130 'r2r_jitstressregs0x1000' : ["COMPlus_JitStressRegs": "0x1000"],
131 'r2r_jitminopts' : ["COMPlus_JITMinOpts": "1"],
132 'r2r_jitforcerelocs' : ["COMPlus_ForceRelocs": "1"],
133 'r2r_gcstress15' : ["COMPlus_GCStress": "0xF"]
136 // This is the basic set of scenarios
137 def static basicScenarios = [
145 // 'jitdiff', // jitdiff is currently disabled, until someone spends the effort to make it fully work
147 'gc_reliability_framework',
150 def static allScenarios = basicScenarios + r2rStressScenarios.keySet() + jitStressModeScenarios.keySet()
152 // Valid PR trigger combinations.
153 def static prTriggeredValidInnerLoopCombos = [
172 'Windows_NT_buildOnly': [
208 // A set of scenarios that are valid for arm/arm64/armlb tests run on hardware. This is a map from valid scenario name
209 // to Tests.lst file categories to exclude.
211 // This list should contain a subset of the scenarios from `allScenarios`. Please keep this in the same order as that,
212 // and with the same values, with some commented out, for easier maintenance.
214 // Note that some scenarios that are commented out should be enabled, but haven't yet been.
216 def static validArmWindowsScenarios = [
220 'r2r': ["R2R_FAIL", "R2R_EXCLUDE"],
226 // 'gc_reliability_framework'
228 'r2r_jitstress1': ["R2R_FAIL", "R2R_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
229 'r2r_jitstress2': ["R2R_FAIL", "R2R_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
230 'r2r_jitstressregs1': ["R2R_FAIL", "R2R_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
231 'r2r_jitstressregs2': ["R2R_FAIL", "R2R_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
232 'r2r_jitstressregs3': ["R2R_FAIL", "R2R_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
233 'r2r_jitstressregs4': ["R2R_FAIL", "R2R_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
234 'r2r_jitstressregs8': ["R2R_FAIL", "R2R_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
235 'r2r_jitstressregs0x10': ["R2R_FAIL", "R2R_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
236 'r2r_jitstressregs0x80': ["R2R_FAIL", "R2R_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
237 'r2r_jitstressregs0x1000': ["R2R_FAIL", "R2R_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
238 'r2r_jitminopts': ["R2R_FAIL", "R2R_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE", "MINOPTS_FAIL", "MINOPTS_EXCLUDE"],
239 'r2r_jitforcerelocs': ["R2R_FAIL", "R2R_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
240 'r2r_gcstress15': ["R2R_FAIL", "R2R_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE", "GCSTRESS_FAIL", "GCSTRESS_EXCLUDE"],
241 'minopts': ["MINOPTS_FAIL", "MINOPTS_EXCLUDE"],
242 'tieredcompilation': [],
244 'jitstress1': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
245 'jitstress2': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
246 'jitstressregs1': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
247 'jitstressregs2': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
248 'jitstressregs3': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
249 'jitstressregs4': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
250 'jitstressregs8': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
251 'jitstressregs0x10': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
252 'jitstressregs0x80': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
253 'jitstressregs0x1000': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
254 'jitstress2_jitstressregs1': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
255 'jitstress2_jitstressregs2': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
256 'jitstress2_jitstressregs3': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
257 'jitstress2_jitstressregs4': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
258 'jitstress2_jitstressregs8': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
259 'jitstress2_jitstressregs0x10': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
260 'jitstress2_jitstressregs0x80': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
261 'jitstress2_jitstressregs0x1000': ["JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
262 'tailcallstress': ["TAILCALLSTRESS_FAIL", "TAILCALLSTRESS_EXCLUDE"],
263 // 'jitsse2only' // Only relevant to xarch
264 'jitnosimd': [], // Only interesting on platforms where SIMD support exists.
265 // 'jitincompletehwintrinsic'
266 // 'jitx86hwintrinsicnoavx'
267 // 'jitx86hwintrinsicnoavx2'
268 // 'jitx86hwintrinsicnosimd'
269 // 'jitnox86hwintrinsic'
270 'corefx_baseline': [], // corefx tests don't use smarty
271 'corefx_minopts': [], // corefx tests don't use smarty
272 'corefx_tieredcompilation': [], // corefx tests don't use smarty
273 'corefx_jitstress1': [], // corefx tests don't use smarty
274 'corefx_jitstress2': [], // corefx tests don't use smarty
275 'corefx_jitstressregs1': [], // corefx tests don't use smarty
276 'corefx_jitstressregs2': [], // corefx tests don't use smarty
277 'corefx_jitstressregs3': [], // corefx tests don't use smarty
278 'corefx_jitstressregs4': [], // corefx tests don't use smarty
279 'corefx_jitstressregs8': [], // corefx tests don't use smarty
280 'corefx_jitstressregs0x10': [], // corefx tests don't use smarty
281 'corefx_jitstressregs0x80': [], // corefx tests don't use smarty
282 'corefx_jitstressregs0x1000': [], // corefx tests don't use smarty
283 'gcstress0x3': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE"],
284 'gcstress0xc': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE"],
285 'zapdisable': ["ZAPDISABLE_FAIL", "ZAPDISABLE_EXCLUDE"],
287 'gcstress0xc_zapdisable': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "ZAPDISABLE_FAIL", "ZAPDISABLE_EXCLUDE"],
288 'gcstress0xc_zapdisable_jitstress2': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "ZAPDISABLE_FAIL", "ZAPDISABLE_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
289 'gcstress0xc_zapdisable_heapverify1': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "ZAPDISABLE_FAIL", "ZAPDISABLE_EXCLUDE"],
290 'gcstress0xc_jitstress1': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
291 'gcstress0xc_jitstress2': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
292 'gcstress0xc_minopts_heapverify1': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "MINOPTS_FAIL", "MINOPTS_EXCLUDE"],
295 // NOTE: the following scenarios are not defined in the 'allScenarios' list! Is this a bug?
298 'minopts_zapdisable': ["ZAPDISABLE_FAIL", "ZAPDISABLE_EXCLUDE", "MINOPTS_FAIL", "MINOPTS_EXCLUDE"],
299 'gcstress0x3_jitstress1': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
300 'gcstress0x3_jitstress2': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
301 'gcstress0x3_jitstressregs1': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
302 'gcstress0x3_jitstressregs2': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
303 'gcstress0x3_jitstressregs3': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
304 'gcstress0x3_jitstressregs4': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
305 'gcstress0x3_jitstressregs8': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
306 'gcstress0x3_jitstressregs0x10': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
307 'gcstress0x3_jitstressregs0x80': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
308 'gcstress0x3_jitstressregs0x1000': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
309 'gcstress0xc_jitstressregs1': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
310 'gcstress0xc_jitstressregs2': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
311 'gcstress0xc_jitstressregs3': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
312 'gcstress0xc_jitstressregs4': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
313 'gcstress0xc_jitstressregs8': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
314 'gcstress0xc_jitstressregs0x10': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
315 'gcstress0xc_jitstressregs0x80': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"],
316 'gcstress0xc_jitstressregs0x1000': ["GCSTRESS_FAIL", "GCSTRESS_EXCLUDE", "JITSTRESS_FAIL", "JITSTRESS_EXCLUDE"]
319 def static validLinuxArm64Scenarios = [
327 def static configurationList = ['Debug', 'Checked', 'Release']
329 // This is the set of architectures
330 def static architectureList = ['arm', 'armlb', 'x86_arm_altjit', 'x64_arm64_altjit', 'arm64', 'x64', 'x86']
333 // **************************************************************
334 // Create some specific views
336 // These aren't using the Utilities.addStandardFolderView() function, because that creates
337 // views based on a single regular expression. These views will be generated by adding a
338 // specific set of jobs to them.
340 // Utilities.addStandardFolderView() also creates a lot of additional stuff around the
341 // view, like "Build Statistics", "Job Statistics", "Unstable Jobs". Until it is determined
342 // those are required, don't add them (which simplifies the view pages, as well).
343 // **************************************************************
346 def static MergeJobView = null
347 def static PeriodicJobView = null
348 def static ArchitectureViews = [:]
349 def static OSViews = [:]
352 // MergeJobView: include all jobs that execute when a PR change is merged.
353 Views.MergeJobView = listView('Merge') {
366 // PeriodicJobView: include all jobs that execute on a schedule
367 Views.PeriodicJobView = listView('Periodic') {
380 // Create a view for non-PR jobs for each architecture.
381 Constants.architectureList.each { architecture ->
382 Views.ArchitectureViews[architecture] = listView(architecture) {
396 // Create a view for non-PR jobs for each OS.
397 Constants.osList.each { os ->
398 // Don't create one for the special 'Windows_NT_BuildOnly'
399 if (os == 'Windows_NT_BuildOnly') {
402 Views.OSViews[os] = listView(os) {
416 def static addToMergeView(def job) {
417 Views.MergeJobView.with {
424 def static addToPeriodicView(def job) {
425 Views.PeriodicJobView.with {
432 def static addToViews(def job, def isPR, def architecture, def os) {
434 // No views want PR jobs currently.
438 // Add to architecture view.
439 Views.ArchitectureViews[architecture].with {
446 Views.OSViews[os].with {
453 def static addPeriodicTriggerHelper(def job, String cronString, boolean alwaysRuns = false) {
454 addToPeriodicView(job)
455 Utilities.addPeriodicTrigger(job, cronString, alwaysRuns)
458 def static addGithubPushTriggerHelper(def job) {
460 Utilities.addGithubPushTrigger(job)
464 def static setMachineAffinity(def job, def os, def architecture, def options = null) {
465 assert os instanceof String
466 assert architecture instanceof String
468 def armArches = ['arm', 'armlb', 'arm64']
469 def supportedArmLinuxOs = ['Ubuntu', 'Ubuntu16.04', 'Tizen']
471 if (!(architecture in armArches)) {
472 assert options == null
473 Utilities.setMachineAffinity(job, os, 'latest-or-auto')
478 // This is an arm(64) job.
480 // There are several options.
484 // Arm32 (Build) -> latest-arm64
485 // |-> os == "Windows_NT" && architecture == "arm" || architecture == "armlb" && options['use_arm64_build_machine'] == true
486 // Arm32 (Test) -> arm64-windows_nt
487 // |-> os == "Windows_NT" && architecture == "arm" || architecture == "armlb" && options['use_arm64_build_machine'] == false
489 // Arm64 (Build) -> latest-arm64
490 // |-> os == "Windows_NT" && architecture == "arm64" && options['use_arm64_build_machine'] == true
491 // Arm64 (Test) -> arm64-windows_nt
492 // |-> os == "Windows_NT" && architecture == "arm64" && options['use_arm64_build_machine'] == false
496 // Arm32 (Build) -> arm-cross-latest
497 // |-> os in supportedArmLinuxOs && architecture == "arm" || architecture == "armlb"
498 // Arm32 (Test) -> NYI Arch not supported
501 // Arm64 (Build) -> arm64-cross-latest
502 // |-> os != "Windows_NT" && architecture == "arm64" && options['is_build_only'] == true
503 // Arm64 Small Page Size (Test) -> arm64-small-page-size
504 // |-> os != "Windows_NT" && architecture == "arm64" && options['large_pages'] == false
505 // Arm64 Large Page Size (Test) -> arm64-huge-page-size
506 // |-> os != "Windows_NT" && architecture == "arm64" && options['large_pages'] == true
508 // This has to be a arm arch
509 assert architecture in armArches
510 if (os == "Windows_NT") {
511 // Arm(64) Windows jobs share the same machines for now
512 def isBuild = options['use_arm64_build_machine'] == true
514 if (isBuild == true) {
515 Utilities.setMachineAffinity(job, os, 'latest-arm64')
517 Utilities.setMachineAffinity(job, os, 'arm64-windows_nt')
520 assert os != 'Windows_NT'
521 assert os in supportedArmLinuxOs
523 if (architecture == 'arm' || architecture == 'armlb') {
524 Utilities.setMachineAffinity(job, 'Ubuntu', 'arm-cross-latest')
527 if (options['is_build_only'] == true) {
528 Utilities.setMachineAffinity(job, os, 'arm64-cross-latest')
530 // Arm64 Test Machines
531 if (options['large_pages'] == false) {
532 Utilities.setMachineAffinity(job, os, 'arm64-small-page-size')
534 Utilities.setMachineAffinity(job, os, 'arm64-huge-page-size')
541 def static isGCStressRelatedTesting(def scenario) {
542 // The 'r2r_gcstress15' scenario is a basic scenario.
543 // Detect it and make it a GCStress related.
544 if (scenario == 'r2r_gcstress15')
549 def gcStressTestEnvVars = [ 'COMPlus_GCStress', 'COMPlus_ZapDisable', 'COMPlus_HeapVerify']
550 def scenarioName = scenario.toLowerCase()
551 def isGCStressTesting = false
552 Constants.jitStressModeScenarios[scenario].each{ k, v ->
553 if (k in gcStressTestEnvVars) {
554 isGCStressTesting = true;
557 return isGCStressTesting
560 def static isCoreFxScenario(def scenario) {
561 def corefx_prefix = 'corefx_'
562 if (scenario.length() < corefx_prefix.length()) {
565 return scenario.substring(0,corefx_prefix.length()) == corefx_prefix
568 def static isR2RBaselineScenario(def scenario) {
569 return (scenario == 'r2r')
572 def static isR2RStressScenario(def scenario) {
573 return Constants.r2rStressScenarios.containsKey(scenario)
576 def static isR2RScenario(def scenario) {
577 return isR2RBaselineScenario(scenario) || isR2RStressScenario(scenario)
580 def static isJitStressScenario(def scenario) {
581 return Constants.jitStressModeScenarios.containsKey(scenario)
584 def static isLongGc(def scenario) {
585 return (scenario == 'longgc' || scenario == 'gcsimulator')
588 def static isJitDiff(def scenario) {
589 return (scenario == 'jitdiff')
592 def static isGcReliabilityFramework(def scenario) {
593 return (scenario == 'gc_reliability_framework')
596 def static isArmWindowsScenario(def scenario) {
597 return Constants.validArmWindowsScenarios.containsKey(scenario)
600 def static isValidPrTriggeredInnerLoopJob(os, architecture, configuration, isBuildOnly) {
601 if (isBuildOnly == true) {
602 os = 'Windows_NT_buildOnly'
605 def validOsPrTriggerArchConfigs = Constants.prTriggeredValidInnerLoopCombos[os]
607 if (validOsPrTriggerArchConfigs == null) {
611 if (validOsPrTriggerArchConfigs[architecture] != null) {
612 def validOsPrTriggerConfigs = validOsPrTriggerArchConfigs[architecture]
614 if (!(configuration in validOsPrTriggerConfigs)) {
624 def static setJobTimeout(newJob, isPR, architecture, configuration, scenario, isBuildOnly) {
625 // 2 hours (120 minutes) is the default timeout
627 def innerLoop = (scenario == "innerloop")
630 // Pri-1 test builds take a long time. Default PR jobs are Pri-0; everything else is Pri-1
631 // (see calculateBuildCommands()). So up the Pri-1 build jobs timeout.
636 // Note that these can only increase, never decrease, the Pri-1 timeout possibly set above.
637 if (isGCStressRelatedTesting(scenario)) {
640 else if (isCoreFxScenario(scenario)) {
643 else if (isJitStressScenario(scenario)) {
646 else if (isR2RBaselineScenario(scenario)) {
649 else if (isLongGc(scenario)) {
652 else if (isJitDiff(scenario)) {
655 else if (isGcReliabilityFramework(scenario)) {
658 else if (architecture == 'arm' || architecture == 'armlb' || architecture == 'arm64') {
663 if (configuration == 'Debug') {
664 // Debug runs can be very slow. Add an hour.
668 if (architecture == 'x86_arm_altjit' || architecture == 'x64_arm64_altjit') {
669 // AltJit runs compile all methods twice.
673 // If we've changed the timeout from the default, set it in the job.
675 if (timeout != 120) {
676 Utilities.setJobTimeout(newJob, timeout)
680 def static getJobFolder(def scenario) {
681 if (isJitStressScenario(scenario) || isR2RStressScenario(scenario)) {
684 if (scenario == 'illink') {
690 def static getStressModeDisplayName(def scenario) {
692 Constants.jitStressModeScenarios[scenario].each{ k, v ->
693 def prefixLength = 'COMPlus_'.length()
694 if (k.length() >= prefixLength) {
695 def modeName = k.substring(prefixLength, k.length())
696 displayStr += ' ' + modeName + '=' + v
700 if (isCoreFxScenario(scenario)) {
701 displayStr = ('CoreFx ' + displayStr).trim()
707 def static getR2RDisplayName(def scenario) {
708 // Assume the scenario name is one from the r2rStressScenarios dict, and remove its "r2r_" prefix.
709 def displayStr = scenario
710 def prefixLength = 'r2r_'.length()
711 if (displayStr.length() >= prefixLength) {
712 displayStr = "R2R " + displayStr.substring(prefixLength, displayStr.length())
713 } else if (scenario == 'r2r') {
720 // Functions to create an environment script.
721 // envScriptCreate -- initialize the script (call first)
722 // envScriptFinalize -- finalize the script (call last)
723 // envScriptSetStressModeVariables -- set stress mode variables in the env script
724 // envScriptAppendExistingScript -- append an existing script to the generated script
726 // Each script returns a string of commands. Concatenate all the strings together before
727 // adding them to the builds commands, to make sure they get executed as one Jenkins script.
730 // Initialize the environment setting script.
731 def static envScriptCreate(def os, def stepScriptLocation) {
733 if (os == 'Windows_NT') {
734 stepScript += "echo Creating TestEnv script\r\n"
735 stepScript += "if exist ${stepScriptLocation} del ${stepScriptLocation}\r\n"
737 // Create at least an empty script.
738 stepScript += "echo. > ${stepScriptLocation}\r\n"
741 stepScript += "echo Creating environment setting script\n"
742 stepScript += "echo \\#\\!/usr/bin/env bash > ${stepScriptLocation}\n"
748 // Generates the string for setting stress mode variables.
749 def static envScriptSetStressModeVariables(def os, def stressModeVars, def stepScriptLocation) {
751 if (os == 'Windows_NT') {
752 stressModeVars.each{ k, v ->
753 // Write out what we are writing to the script file
754 stepScript += "echo Setting ${k}=${v}\r\n"
755 // Write out the set itself to the script file`
756 stepScript += "echo set ${k}=${v} >> ${stepScriptLocation}\r\n"
760 stressModeVars.each{ k, v ->
761 // Write out what we are writing to the script file
762 stepScript += "echo Setting ${k}=${v}\n"
763 // Write out the set itself to the script file`
764 stepScript += "echo export ${k}=${v} >> ${stepScriptLocation}\n"
771 // Append an existing script to an environment script.
772 // Returns string of commands to do this.
773 def static envScriptAppendExistingScript(def os, def appendScript, def stepScriptLocation) {
774 assert (os == 'Windows_NT')
777 stepScript += "echo Appending ${appendScript} to ${stepScriptLocation}\r\n"
778 stepScript += "type ${appendScript} >> ${stepScriptLocation}\r\n"
783 // Finalize an environment setting script.
784 // Returns string of commands to do this.
785 def static envScriptFinalize(def os, def stepScriptLocation) {
788 if (os == 'Windows_NT') {
789 // Display the resulting script. This is useful when looking at the output log file.
790 stepScript += "echo Display the total script ${stepScriptLocation}\r\n"
791 stepScript += "type ${stepScriptLocation}\r\n"
794 stepScript += "chmod +x ${stepScriptLocation}\n"
800 def static isNeedDocker(def architecture, def os, def isBuild) {
802 if (architecture == 'x86' && os == 'Ubuntu') {
805 else if (architecture == 'arm') {
806 if (os == 'Ubuntu' || os == 'Ubuntu16.04' || os == 'Tizen') {
812 if (architecture == 'x86' && os == 'Ubuntu') {
819 def static getDockerImageName(def architecture, def os, def isBuild) {
820 // We must change some docker private images to official later
822 if (architecture == 'x86' && os == 'Ubuntu') {
823 return "hseok82/dotnet-buildtools-prereqs:ubuntu-16.04-crossx86-ef0ac75-20175511035548"
825 else if (architecture == 'arm') {
826 if (os == 'Ubuntu') {
827 return "microsoft/dotnet-buildtools-prereqs:ubuntu-14.04-cross-0cd4667-20172211042239"
829 else if (os == 'Ubuntu16.04') {
830 return "microsoft/dotnet-buildtools-prereqs:ubuntu-16.04-cross-ef0ac75-20175511035548"
832 else if (os == 'Tizen') {
833 return "hqueue/dotnetcore:ubuntu1404_cross_prereqs_v4-tizen_rootfs"
838 if (architecture == 'x86' && os == 'Ubuntu') {
839 return "hseok82/dotnet-buildtools-prereqs:ubuntu1604_x86_test"
842 println("Unknown architecture to use docker: ${architecture} ${os}");
846 // Calculates the name of the build job based on some typical parameters.
848 def static getJobName(def configuration, def architecture, def os, def scenario, def isBuildOnly) {
849 // If the architecture is x64, do not add that info into the build name.
850 // Need to change around some systems and other builds to pick up the right builds
853 def suffix = scenario != 'normal' ? "_${scenario}" : '';
858 switch (architecture) {
860 if (scenario == 'normal') {
861 // For now we leave x64 off of the name for compatibility with other jobs
862 baseName = configuration.toLowerCase() + '_' + os.toLowerCase()
864 else if (scenario == 'formatting') {
865 // we don't care about the configuration for the formatting job. It runs all configs
866 baseName = architecture.toLowerCase() + '_' + os.toLowerCase()
869 baseName = architecture.toLowerCase() + '_' + configuration.toLowerCase() + '_' + os.toLowerCase()
873 if (os.toLowerCase() == "windows_nt") {
874 // These are cross builds
875 baseName = architecture.toLowerCase() + '_cross_' + configuration.toLowerCase() + '_' + os.toLowerCase()
878 // Defaults to a small page size set of machines.
879 baseName = architecture.toLowerCase() + '_' + configuration.toLowerCase() + '_' + "small_page_size"
883 // These are cross builds
886 baseName = 'armel_cross_' + configuration.toLowerCase() + '_' + os.toLowerCase()
889 baseName = architecture.toLowerCase() + '_cross_' + configuration.toLowerCase() + '_' + os.toLowerCase()
893 baseName = architecture.toLowerCase() + '_cross_' + configuration.toLowerCase() + '_' + os.toLowerCase()
896 case 'x86_arm_altjit':
897 case 'x64_arm64_altjit':
898 baseName = architecture.toLowerCase() + '_' + configuration.toLowerCase() + '_' + os.toLowerCase()
901 println("Unknown architecture: ${architecture}");
906 return baseName + suffix
909 def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def os, def configuration, def scenario, def isFlowJob, def isWindowsBuildOnlyJob, def bidailyCrossList) {
911 // Limited Windows ARM64 hardware is restricted for non-PR triggers to certain branches.
912 if (os == 'Windows_NT') {
913 if ((architecture == 'arm64') || (architecture == 'arm') || (architecture == 'armlb')) {
914 if (!(branch in Constants.WindowsArm64Branches)) {
925 switch (architecture) {
928 if (isFlowJob && architecture == 'x86' && os == 'Ubuntu') {
929 addPeriodicTriggerHelper(job, '@daily')
931 else if (isFlowJob || os == 'Windows_NT' || !(os in Constants.crossList)) {
932 addGithubPushTriggerHelper(job)
937 case 'x86_arm_altjit':
938 case 'x64_arm64_altjit':
939 addGithubPushTriggerHelper(job)
942 // We would normally want a per-push trigger, but with limited hardware we can't keep up
943 addPeriodicTriggerHelper(job, "H H/4 * * *")
946 println("Unknown architecture: ${architecture}");
952 assert !(os in bidailyCrossList)
953 // r2r gets a push trigger for checked/release
954 if (configuration == 'Checked' || configuration == 'Release') {
955 assert (os == 'Windows_NT') || (os in Constants.crossList)
956 if (architecture == 'x64' && os != 'OSX10.12') {
957 //Flow jobs should be Windows, Ubuntu, OSX0.12, or CentOS
958 if (isFlowJob || os == 'Windows_NT') {
959 addGithubPushTriggerHelper(job)
961 // OSX10.12 r2r jobs should only run every 12 hours, not daily.
962 } else if (architecture == 'x64' && os == 'OSX10.12'){
964 addPeriodicTriggerHelper(job, 'H H/12 * * *')
967 // For x86, only add per-commit jobs for Windows
968 else if (architecture == 'x86') {
969 if (os == 'Windows_NT') {
970 addGithubPushTriggerHelper(job)
973 // arm64 r2r jobs should only run daily.
974 else if (architecture == 'arm64') {
975 if (os == 'Windows_NT') {
976 addPeriodicTriggerHelper(job, '@daily')
981 case 'r2r_jitstress1':
982 case 'r2r_jitstress2':
983 case 'r2r_jitstressregs1':
984 case 'r2r_jitstressregs2':
985 case 'r2r_jitstressregs3':
986 case 'r2r_jitstressregs4':
987 case 'r2r_jitstressregs8':
988 case 'r2r_jitstressregs0x10':
989 case 'r2r_jitstressregs0x80':
990 case 'r2r_jitstressregs0x1000':
991 case 'r2r_jitminopts':
992 case 'r2r_jitforcerelocs':
993 case 'r2r_gcstress15':
994 assert !(os in bidailyCrossList)
996 // GCStress=C is currently not supported on OS X
997 if (os == 'OSX10.12' && isGCStressRelatedTesting(scenario)) {
1001 // GC Stress 15 r2r gets a push trigger for checked/release
1002 if (configuration == 'Checked' || configuration == 'Release') {
1003 assert (os == 'Windows_NT') || (os in Constants.crossList)
1004 if (architecture == 'x64') {
1005 //Flow jobs should be Windows, Ubuntu, OSX10.12, or CentOS
1006 if (isFlowJob || os == 'Windows_NT') {
1007 // Add a weekly periodic trigger
1008 addPeriodicTriggerHelper(job, 'H H * * 3,6') // some time every Wednesday and Saturday
1011 // For x86, only add per-commit jobs for Windows
1012 else if (architecture == 'x86') {
1013 if (os == 'Windows_NT') {
1014 addPeriodicTriggerHelper(job, 'H H * * 3,6') // some time every Wednesday and Saturday
1020 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
1021 assert configuration == 'Release'
1022 assert architecture == 'x64'
1023 addPeriodicTriggerHelper(job, '@daily')
1024 // TODO: Add once external email sending is available again
1025 // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
1028 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
1029 assert configuration == 'Release'
1030 assert architecture == 'x64'
1031 addPeriodicTriggerHelper(job, 'H H * * 3,6') // some time every Wednesday and Saturday
1032 // TODO: Add once external email sending is available again
1033 // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
1035 case 'standalone_gc':
1036 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
1037 assert (configuration == 'Release' || configuration == 'Checked')
1038 // TODO: Add once external email sending is available again
1039 // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
1040 addPeriodicTriggerHelper(job, '@daily')
1042 case 'gc_reliability_framework':
1043 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
1044 assert (configuration == 'Release' || configuration == 'Checked')
1045 // Only triggered by phrase.
1048 assert !(os in bidailyCrossList)
1049 // ILASM/ILDASM roundtrip one gets a daily build, and only for release
1050 if (architecture == 'x64' && configuration == 'Release') {
1051 // We don't expect to see a job generated except in these scenarios
1052 assert (os == 'Windows_NT') || (os in Constants.crossList)
1053 if (isFlowJob || os == 'Windows_NT') {
1054 addPeriodicTriggerHelper(job, '@daily')
1059 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
1060 assert configuration == 'Checked'
1061 assert (architecture == 'x64' || architecture == 'x86')
1062 addGithubPushTriggerHelper(job)
1065 assert (os == 'Windows_NT' || os == "Ubuntu")
1066 assert architecture == 'x64'
1067 addGithubPushTriggerHelper(job)
1069 case 'jitstressregs1':
1070 case 'jitstressregs2':
1071 case 'jitstressregs3':
1072 case 'jitstressregs4':
1073 case 'jitstressregs8':
1074 case 'jitstressregs0x10':
1075 case 'jitstressregs0x80':
1076 case 'jitstressregs0x1000':
1081 case 'jitstress2_jitstressregs1':
1082 case 'jitstress2_jitstressregs2':
1083 case 'jitstress2_jitstressregs3':
1084 case 'jitstress2_jitstressregs4':
1085 case 'jitstress2_jitstressregs8':
1086 case 'jitstress2_jitstressregs0x10':
1087 case 'jitstress2_jitstressregs0x80':
1088 case 'jitstress2_jitstressregs0x1000':
1089 case 'tailcallstress':
1092 case 'jitnox86hwintrinsic':
1093 case 'jitincompletehwintrinsic':
1094 case 'jitx86hwintrinsicnoavx':
1095 case 'jitx86hwintrinsicnoavx2':
1096 case 'jitx86hwintrinsicnosimd':
1097 case 'corefx_baseline':
1098 case 'corefx_minopts':
1099 case 'corefx_jitstress1':
1100 case 'corefx_jitstress2':
1101 case 'corefx_jitstressregs1':
1102 case 'corefx_jitstressregs2':
1103 case 'corefx_jitstressregs3':
1104 case 'corefx_jitstressregs4':
1105 case 'corefx_jitstressregs8':
1106 case 'corefx_jitstressregs0x10':
1107 case 'corefx_jitstressregs0x80':
1108 case 'corefx_jitstressregs0x1000':
1110 if (os != 'CentOS7.1' && !(os in bidailyCrossList)) {
1111 assert (os == 'Windows_NT') || (os in Constants.crossList)
1112 if ((architecture == 'arm64') || (architecture == 'arm') || (architecture == 'armlb')) {
1113 if (os == 'Windows_NT') {
1114 // We don't have enough ARM64 machines to run these more frequently than weekly.
1115 addPeriodicTriggerHelper(job, '@weekly')
1119 addPeriodicTriggerHelper(job, '@daily')
1125 if (os != 'CentOS7.1' && !(os in bidailyCrossList)) {
1126 assert (os == 'Windows_NT') || (os in Constants.crossList)
1127 if ((architecture == 'arm64') || (architecture == 'arm') || (architecture == 'armlb')) {
1128 if (os == 'Windows_NT') {
1129 // We don't have enough ARM64 machines to run these more frequently than weekly.
1130 addPeriodicTriggerHelper(job, '@weekly')
1132 // TODO: Add once external email sending is available again
1133 // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
1136 addPeriodicTriggerHelper(job, '@weekly')
1141 case 'gcstress0xc_zapdisable':
1142 case 'gcstress0xc_zapdisable_jitstress2':
1143 case 'gcstress0xc_zapdisable_heapverify1':
1144 case 'gcstress0xc_jitstress1':
1145 case 'gcstress0xc_jitstress2':
1146 case 'gcstress0xc_minopts_heapverify1':
1147 // GCStress=C is currently not supported on OS X
1148 if (os != 'CentOS7.1' && os != 'OSX10.12' && !(os in bidailyCrossList)) {
1149 assert (os == 'Windows_NT') || (os in Constants.crossList)
1150 if ((architecture == 'arm64') || (architecture == 'arm') || (architecture == 'armlb')) {
1151 if (os == 'Windows_NT') {
1152 // We don't have enough ARM64 machines to run these more frequently than weekly.
1153 addPeriodicTriggerHelper(job, '@weekly')
1155 // TODO: Add once external email sending is available again
1156 // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
1159 addPeriodicTriggerHelper(job, '@weekly')
1165 // Testing on other operating systems TBD
1166 assert (os == 'Windows_NT' || os == 'Ubuntu')
1167 if (architecture == 'x64' || architecture == 'x86') {
1168 if (configuration == 'Checked') {
1169 addPeriodicTriggerHelper(job, '@daily')
1174 case 'tieredcompilation':
1175 case 'corefx_tieredcompilation':
1176 // No periodic jobs just yet, still testing
1180 println("Unknown scenario: ${scenario}");
1187 // **************************
1188 // Define the basic inner loop builds for PR and commit. This is basically just the set
1189 // of coreclr builds over linux/osx 10.12/windows and debug/release/checked. In addition, the windows
1190 // builds will do a couple extra steps.
1191 // **************************
1193 // Adds a trigger for the PR build if one is needed. If isFlowJob is true, then this is the
1194 // flow job that rolls up the build and test for non-windows OS's. // If the job is a windows build only job,
1195 // it's just used for internal builds
1196 // If you add a job with a trigger phrase, please add that phrase to coreclr/Documentation/project-docs/ci-trigger-phrases.md
1197 def static addTriggers(def job, def branch, def isPR, def architecture, def os, def configuration, def scenario, def isFlowJob, def isWindowsBuildOnlyJob) {
1198 def isNormalOrInnerloop = (scenario == "normal" || scenario == "innerloop")
1200 if (isWindowsBuildOnlyJob) {
1204 def bidailyCrossList = ['RHEL7.2', 'Debian8.4']
1205 // Non pull request builds.
1207 addNonPRTriggers(job, branch, isPR, architecture, os, configuration, scenario, isFlowJob, isWindowsBuildOnlyJob, bidailyCrossList)
1234 // Pull request builds. Generally these fall into two categories: default triggers and on-demand triggers
1235 // We generally only have a distinct set of default triggers but a bunch of on-demand ones.
1236 def osGroup = getOSGroup(os)
1237 switch (architecture) {
1238 case 'x64': // editor brace matching: {
1239 if (scenario == 'formatting') {
1240 assert configuration == 'Checked'
1241 if (os == 'Windows_NT' || os == 'Ubuntu') {
1242 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Formatting")
1249 // OpenSUSE, Debian & RedHat get trigger phrases for pri 0 build, and pri 1 build & test
1252 if (scenario == 'innerloop') {
1254 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Innerloop Build")
1256 else if (scenario == 'normal') {
1257 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", "(?i).*test\\W+${os}\\W+${architecture}.*")
1263 assert scenario != 'innerloop'
1264 // Distinguish with the other architectures (arm and x86)
1265 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", "(?i).*test\\W+${os}\\W+${architecture}.*")
1271 assert scenario != 'innerloop'
1272 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", "(?i).*test\\W+${os}\\W+.*")
1276 if (scenario == 'illink') {
1277 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1283 // Triggers on the non-flow jobs aren't necessary here
1284 // Corefx testing uses non-flow jobs.
1285 if (!isFlowJob && !isCoreFxScenario(scenario)) {
1290 // PR Triggered jobs. These jobs will run pri0 tests.
1291 if (configuration == 'Checked') {
1292 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Innerloop Build and Test")
1297 // OSX uses checked for default PR tests
1298 if (configuration == 'Checked') {
1300 assert !job.name.contains("centos")
1301 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test", "(?i).*test\\W+${os}\\W+${architecture}\\W+Build and Test.*")
1306 if (configuration == 'Checked') {
1307 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Jit Diff Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
1312 if (configuration == 'Release') {
1313 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
1318 if (configuration == 'Release') {
1319 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1324 if (configuration == 'Release') {
1325 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1329 case 'standalone_gc':
1330 if (configuration == 'Release' || configuration == 'Checked') {
1331 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1335 case 'gc_reliability_framework':
1336 if (configuration == 'Release' || configuration == 'Checked') {
1337 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Reliability Framework", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1342 if (isJitStressScenario(scenario)) {
1343 def displayStr = getStressModeDisplayName(scenario)
1344 assert (os == 'Windows_NT') || (os in Constants.crossList)
1345 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
1346 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1348 else if (isR2RScenario(scenario)) {
1349 if (configuration == 'Release' || configuration == 'Checked') {
1350 def displayStr = getR2RDisplayName(scenario)
1351 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} Build and Test",
1352 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1356 println("Unknown scenario: ${scenario}");
1367 // CentOS uses checked for default PR tests while debug is build only
1368 if (configuration == 'Debug') {
1370 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Innerloop Build")
1373 // Make sure this is a flow job to get build and test.
1374 if (configuration == 'Checked' && isFlowJob) {
1375 assert job.name.contains("flow")
1377 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Innerloop Build and Test")
1382 // Make sure this is a flow job to get build and test.
1383 if (configuration == 'Checked' && isFlowJob) {
1384 assert job.name.contains("flow")
1386 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test", "(?i).*test\\W+${os}\\W+${architecture}\\W+Build and Test.*")
1391 if (isR2RScenario(scenario)) {
1392 if (configuration == 'Release' || configuration == 'Checked') {
1393 def displayStr = getR2RDisplayName(scenario)
1394 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} Build & Test",
1395 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1407 if (configuration == 'Checked' || configuration == 'Release') {
1408 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Innerloop Build and Test")
1413 if (configuration == 'Checked') {
1414 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test", "(?i).*test\\W+${os}\\W+${architecture}\\W+Build and Test.*")
1419 if (configuration == 'Checked') {
1420 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Jit Diff Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
1425 if (configuration == 'Release') {
1426 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
1431 if (configuration == 'Release') {
1432 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1437 if (configuration == 'Release') {
1438 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1442 case 'standalone_gc':
1443 if (configuration == 'Release' || configuration == 'Checked') {
1444 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1448 case 'gc_reliability_framework':
1449 if (configuration == 'Release' || configuration == 'Checked') {
1450 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Reliability Framework", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1455 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1459 if (isJitStressScenario(scenario)) {
1460 def displayStr = getStressModeDisplayName(scenario)
1461 assert (os == 'Windows_NT') || (os in Constants.crossList)
1462 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
1463 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1465 else if (isR2RScenario(scenario)) {
1466 if (configuration == 'Release' || configuration == 'Checked') {
1467 def displayStr = getR2RDisplayName(scenario)
1468 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} Build & Test",
1469 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1473 println("Unknown scenario: ${scenario}");
1482 println("Unknown os: ${os}");
1490 // editor brace matching: }
1492 case 'arm': // editor brace matching: {
1496 if (architecture == 'armlb') { // No arm legacy backend testing for Ubuntu
1500 assert scenario != 'innerloop'
1503 azureVMAgentPostBuildAction {
1504 agentPostBuildAction('Delete agent if the build was not successful (when idle).')
1508 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build",
1509 "(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
1513 if (architecture == 'armlb') { // No arm legacy backend testing for Tizen armel
1517 architecture = 'armel'
1520 azureVMAgentPostBuildAction {
1521 agentPostBuildAction('Delete agent if the build was not successful (when idle).')
1526 if (scenario == 'innerloop') {
1527 if (configuration == 'Checked') {
1528 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Innerloop Build and Test")
1532 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build",
1533 "(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
1538 if (architecture == "armlb") {
1539 // Disable armlb windows jobs
1543 // Triggers on the non-flow jobs aren't necessary here
1548 // Set up a private trigger
1549 def contextString = "${os} ${architecture} Cross ${configuration}"
1550 def triggerString = "(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}"
1551 if (scenario == 'innerloop') {
1552 contextString += " Innerloop"
1553 triggerString += "\\W+Innerloop"
1556 contextString += " ${scenario}"
1557 triggerString += "\\W+${scenario}"
1560 if (configuration == 'Debug') {
1561 contextString += " Build"
1562 triggerString += "\\W+Build"
1564 contextString += " Build and Test"
1565 triggerString += "\\W+Build and Test"
1568 triggerString += ".*"
1572 // Only Checked is an innerloop trigger.
1573 if (configuration == 'Checked')
1575 Utilities.addDefaultPrivateGithubPRTriggerForBranch(job, branch, contextString, null, arm64Users)
1579 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString, triggerString, null, arm64Users)
1582 // Stress jobs will use this code path.
1583 if (isArmWindowsScenario(scenario)) {
1584 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString, triggerString, null, arm64Users)
1590 println("NYI os: ${os}");
1595 // editor brace matching: }
1596 case 'arm64': // editor brace matching: {
1597 // Set up a private trigger
1598 def contextString = "${os} ${architecture} Cross ${configuration}"
1599 def triggerString = "(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}"
1601 if (scenario == 'innerloop') {
1602 contextString += " Innerloop"
1603 triggerString += "\\W+Innerloop"
1606 contextString += " ${scenario}"
1607 triggerString += "\\W+${scenario}"
1610 if (configuration == 'Debug') {
1611 contextString += " Build"
1612 triggerString += "\\W+Build"
1614 contextString += " Build and Test"
1615 triggerString += "\\W+Build and Test"
1618 triggerString += ".*"
1625 if (configuration == 'Debug' && !isFlowJob) {
1626 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Innerloop Build")
1631 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test", triggerString)
1634 if (isR2RScenario(scenario)) {
1635 if (configuration == 'Checked' || configuration == 'Release') {
1636 def displayStr = getR2RDisplayName(scenario)
1637 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} Build and Test", triggerString)
1645 // Triggers on the non-flow jobs aren't necessary here
1650 assert isArmWindowsScenario(scenario)
1653 if (configuration == 'Checked') {
1654 Utilities.addDefaultPrivateGithubPRTriggerForBranch(job, branch, contextString, null, arm64Users)
1659 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString, triggerString, null, arm64Users)
1662 // Stress jobs will use this code path.
1663 if (isArmWindowsScenario(scenario)) {
1664 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString, triggerString, null, arm64Users)
1670 println("NYI os: ${os}");
1676 // editor brace matching: }
1677 case 'x86': // editor brace matching: {
1678 assert ((os == 'Windows_NT') || ((os == 'Ubuntu') && isNormalOrInnerloop))
1679 if (os == 'Ubuntu') {
1680 // Triggers on the non-flow jobs aren't necessary here
1685 // on-demand only for ubuntu x86
1686 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build",
1687 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*")
1693 if (configuration == 'Checked' || configuration == 'Release') {
1694 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Innerloop Build and Test")
1699 if (configuration == 'Checked') {
1700 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test",
1701 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+Build and Test.*")
1706 if (configuration == 'Release') {
1707 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test",
1708 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1713 if (configuration == 'Release') {
1714 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test",
1715 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1720 if (configuration == 'Release') {
1721 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator",
1722 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1726 case 'standalone_gc':
1727 if (configuration == 'Release' || configuration == 'Checked') {
1728 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC",
1729 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1734 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1738 if (isJitStressScenario(scenario)) {
1739 def displayStr = getStressModeDisplayName(scenario)
1740 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
1741 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1743 else if (isR2RScenario(scenario)) {
1744 if (configuration == 'Release' || configuration == 'Checked') {
1745 def displayStr = getR2RDisplayName(scenario)
1746 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} Build & Test",
1747 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1751 println("Unknown scenario: ${os} ${architecture} ${scenario}");
1759 // editor brace matching: }
1760 case 'x64_arm64_altjit':
1761 case 'x86_arm_altjit': // editor brace matching: {
1762 assert (os == 'Windows_NT')
1765 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test",
1766 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+Build and Test.*")
1769 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${scenario}",
1770 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1775 // editor brace matching: }
1777 println("Unknown architecture: ${architecture}");
1783 def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR, def architecture, def configuration, def os, def isBuildOnly) {
1784 def buildCommands = [];
1785 def osGroup = getOSGroup(os)
1786 def lowerConfiguration = configuration.toLowerCase()
1789 if (scenario == 'innerloop') {
1793 setJobTimeout(newJob, isPR, architecture, configuration, scenario, isBuildOnly)
1795 def enableCorefxTesting = isCoreFxScenario(scenario)
1797 // Calculate the build steps, archival, and xunit results
1799 case 'Windows_NT': // editor brace matching: {
1800 switch (architecture) {
1803 case 'x86_arm_altjit':
1804 case 'x64_arm64_altjit':
1805 def arch = architecture
1807 if (architecture == 'x86_arm_altjit') {
1810 else if (architecture == 'x64_arm64_altjit') {
1814 if (scenario == 'formatting') {
1815 buildCommands += "python -u tests\\scripts\\format.py -c %WORKSPACE% -o Windows_NT -a ${arch}"
1816 Utilities.addArchival(newJob, "format.patch", "", true, false)
1820 if (scenario == 'illink') {
1821 buildCommands += "tests\\scripts\\build_illink.cmd clone ${arch}"
1824 // If it is a release build for windows, ensure PGO is used, else fail the build
1825 if ((lowerConfiguration == 'release') &&
1826 (scenario in Constants.basicScenarios) &&
1827 (architecture != 'x86_arm_altjit') &&
1828 (architecture != 'x64_arm64_altjit')) {
1830 buildOpts += ' -enforcepgo'
1833 if (enableCorefxTesting) {
1834 buildOpts += ' skiptests';
1836 buildOpts += " -priority=${priority}"
1839 // Set __TestIntermediateDir to something short. If __TestIntermediateDir is already set, build-test.cmd will
1840 // output test binaries to that directory. If it is not set, the binaries are sent to a default directory whose name is about
1841 // 35 characters long.
1843 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${arch} ${buildOpts}"
1846 def runtestArguments = ''
1847 def testOpts = 'collectdumps'
1849 if (isR2RScenario(scenario)) {
1851 // If this is a ReadyToRun scenario, pass 'crossgen' or 'crossgenaltjit'
1852 // to cause framework assemblies to be crossgen'ed. Pass 'runcrossgentests'
1853 // to cause the tests to be crossgen'ed.
1855 if ((architecture == 'x86_arm_altjit') || (architecture == 'x64_arm64_altjit')) {
1856 testOpts += ' crossgenaltjit protononjit.dll'
1858 testOpts += ' crossgen'
1861 testOpts += ' runcrossgentests'
1863 else if (scenario == 'jitdiff') {
1864 testOpts += ' jitdisasm crossgen'
1866 else if (scenario == 'ilrt') {
1867 testOpts += ' ilasmroundtrip'
1869 else if (isLongGc(scenario)) {
1870 testOpts += " ${scenario} sequential"
1872 else if (scenario == 'standalone_gc') {
1873 testOpts += ' gcname clrgc.dll'
1875 else if (scenario == 'illink') {
1876 testOpts += " link %WORKSPACE%\\linker\\linker\\bin\\netcore_Release\\netcoreapp2.0\\win10-${arch}\\publish\\illink.exe"
1879 // Default per-test timeout is 10 minutes. For stress modes and Debug scenarios, increase this
1880 // to 30 minutes (30 * 60 * 1000 = 180000). The "timeout" argument to runtest.cmd sets this, by
1881 // taking a timeout value in milliseconds. (Note that it sets the __TestTimeout environment variable,
1882 // which is read by the xunit harness.)
1883 if (isJitStressScenario(scenario) || isR2RStressScenario(scenario) || (lowerConfiguration == 'debug'))
1885 def timeout = 1800000
1886 testOpts += " timeout ${timeout}"
1889 // If we are running a stress mode, we should write out the set of key
1890 // value env pairs to a file at this point and then we'll pass that to runtest.cmd
1892 def envScriptPath = ''
1893 if (isJitStressScenario(scenario) || isR2RStressScenario(scenario)) {
1894 def buildCommandsStr = ''
1895 envScriptPath = "%WORKSPACE%\\SetStressModes.bat"
1896 buildCommandsStr += envScriptCreate(os, envScriptPath)
1898 if (isJitStressScenario(scenario)) {
1899 buildCommandsStr += envScriptSetStressModeVariables(os, Constants.jitStressModeScenarios[scenario], envScriptPath)
1901 else if (isR2RStressScenario(scenario)) {
1902 buildCommandsStr += envScriptSetStressModeVariables(os, Constants.r2rStressScenarios[scenario], envScriptPath)
1905 if (architecture == 'x86_arm_altjit') {
1906 buildCommandsStr += envScriptAppendExistingScript(os, "%WORKSPACE%\\tests\\x86_arm_altjit.cmd", envScriptPath)
1908 else if (architecture == 'x64_arm64_altjit') {
1909 buildCommandsStr += envScriptAppendExistingScript(os, "%WORKSPACE%\\tests\\x64_arm64_altjit.cmd", envScriptPath)
1912 envScriptFinalize(os, envScriptPath)
1914 // Note that buildCommands is an array of individually executed commands; we want all the commands used to
1915 // create the SetStressModes.bat script to be executed together, hence we accumulate them as strings
1916 // into a single script.
1917 buildCommands += buildCommandsStr
1919 else if (architecture == 'x86_arm_altjit') {
1920 envScriptPath = "%WORKSPACE%\\tests\\x86_arm_altjit.cmd"
1922 else if (architecture == 'x64_arm64_altjit') {
1923 envScriptPath = "%WORKSPACE%\\tests\\x64_arm64_altjit.cmd"
1925 if (envScriptPath != '') {
1926 testOpts += " TestEnv ${envScriptPath}"
1929 runtestArguments = "${lowerConfiguration} ${arch} ${testOpts}"
1931 if (enableCorefxTesting) {
1932 def workspaceRelativeFxRoot = "_/fx"
1933 def absoluteFxRoot = "%WORKSPACE%\\_\\fx"
1935 buildCommands += "python -u %WORKSPACE%\\tests\\scripts\\run-corefx-tests.py -arch ${arch} -ci_arch ${architecture} -build_type ${configuration} -fx_root ${absoluteFxRoot} -fx_branch ${branch} -env_script ${envScriptPath}"
1937 // Archive and process (only) the test results
1938 Utilities.addArchival(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1939 Utilities.addXUnitDotNETResults(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1941 //Archive additional build stuff to diagnose why my attempt at fault injection isn't causing CI to fail
1942 Utilities.addArchival(newJob, "SetStressModes.bat", "", true, false)
1943 Utilities.addArchival(newJob, "${workspaceRelativeFxRoot}/bin/testhost/**", "", true, false)
1945 else if (isGcReliabilityFramework(scenario)) {
1946 buildCommands += "tests\\runtest.cmd ${runtestArguments} GenerateLayoutOnly"
1947 buildCommands += "tests\\scripts\\run-gc-reliability-framework.cmd ${arch} ${configuration}"
1950 buildCommands += "tests\\runtest.cmd ${runtestArguments}"
1954 if (!enableCorefxTesting) {
1955 // Run the rest of the build
1956 // Build the mscorlib for the other OS's
1957 buildCommands += "build.cmd ${lowerConfiguration} ${arch} linuxmscorlib"
1958 buildCommands += "build.cmd ${lowerConfiguration} ${arch} osxmscorlib"
1960 if (arch == "x64") {
1961 buildCommands += "build.cmd ${lowerConfiguration} arm64 linuxmscorlib"
1964 // Zip up the tests directory so that we don't use so much space/time copying
1965 // 10s of thousands of files around.
1966 buildCommands += "powershell -NoProfile -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${arch}.${configuration}', '.\\bin\\tests\\tests.zip')\"";
1968 if (!isJitStressScenario(scenario)) {
1969 // For Windows, pull full test results and test drops for x86/x64.
1970 // No need to pull for stress mode scenarios (downstream builds use the default scenario)
1971 Utilities.addArchival(newJob, "bin/Product/**,bin/tests/tests.zip", "bin/Product/**/.nuget/**")
1974 if (scenario == 'jitdiff') {
1975 // retrieve jit-dasm output for base commit, and run jit-diff
1977 // if this is a build only job, we want to keep the default (build) artifacts for the flow job
1978 Utilities.addArchival(newJob, "bin/tests/${osGroup}.${arch}.${configuration}/dasm/**")
1983 Utilities.addXUnitDotNETResults(newJob, 'bin/**/TestRun*.xml', true)
1989 assert isArmWindowsScenario(scenario)
1991 def machineAffinityOptions = ['use_arm64_build_machine' : true]
1992 setMachineAffinity(newJob, os, architecture, machineAffinityOptions)
1994 def buildArchitecture = 'arm'
1998 // For 'armlb' (the JIT LEGACY_BACKEND architecture for arm), tell build.cmd to use legacy backend for crossgen compilation.
1999 // Legacy backend is not the default JIT; it is an aljit. So, this is a special case.
2000 if (architecture == 'armlb') {
2001 buildOpts += ' -crossgenaltjit legacyjit.dll'
2004 if (enableCorefxTesting) {
2005 // We shouldn't need to build the tests. However, run-corefx-tests.py currently depends on having the restored corefx
2006 // package available, to determine the correct corefx version git commit hash, and we need to build the tests before
2007 // running "tests\\runtest.cmd GenerateLayoutOnly". So build the pri-0 tests to make this happen.
2009 // buildOpts += ' skiptests';
2010 buildOpts += " -priority=0"
2012 buildOpts += " -priority=${priority}"
2015 // This is now a build only job. Do not run tests. Use the flow job.
2016 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${buildArchitecture} ${buildOpts}"
2018 if (enableCorefxTesting) {
2020 assert architecture == 'arm'
2022 // Generate the test layout because it restores the corefx package which allows run-corefx-tests.py
2023 // to determine the correct matching corefx version git commit hash.
2024 buildCommands += "tests\\runtest.cmd ${lowerConfiguration} ${architecture} GenerateLayoutOnly"
2026 // Set the stress mode variables; this is incorporated into the generated CoreFx RunTests.cmd files.
2027 def envScriptPath = ''
2028 def buildCommandsStr = ''
2029 envScriptPath = "%WORKSPACE%\\SetStressModes.bat"
2030 buildCommandsStr += envScriptCreate(os, envScriptPath)
2031 buildCommandsStr += envScriptSetStressModeVariables(os, Constants.jitStressModeScenarios[scenario], envScriptPath)
2032 envScriptFinalize(os, envScriptPath)
2033 buildCommands += buildCommandsStr
2035 def workspaceRelativeFxRootLinux = "_/fx"
2036 def workspaceRelativeFxRootWin = "_\\fx"
2037 def absoluteFxRoot = "%WORKSPACE%\\_\\fx"
2039 buildCommands += "python -u %WORKSPACE%\\tests\\scripts\\run-corefx-tests.py -arch ${architecture} -ci_arch ${architecture} -build_type ${configuration} -fx_root ${absoluteFxRoot} -fx_branch ${branch} -env_script ${envScriptPath} -no_run_tests"
2041 // Zip up the CoreFx runtime and tests. We don't need the CoreCLR binaries; they have been copied to the CoreFX tree.
2042 buildCommands += "powershell -NoProfile -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('${workspaceRelativeFxRootWin}\\bin\\testhost\\netcoreapp-Windows_NT-Release-arm', '${workspaceRelativeFxRootWin}\\fxruntime.zip')\"";
2043 buildCommands += "powershell -NoProfile -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('${workspaceRelativeFxRootWin}\\bin\\tests', '${workspaceRelativeFxRootWin}\\fxtests.zip')\"";
2045 Utilities.addArchival(newJob, "${workspaceRelativeFxRootLinux}/fxruntime.zip")
2046 Utilities.addArchival(newJob, "${workspaceRelativeFxRootLinux}/fxtests.zip")
2048 // Zip up the tests directory so that we don't use so much space/time copying
2049 // 10s of thousands of files around.
2050 buildCommands += "powershell -NoProfile -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${buildArchitecture}.${configuration}', '.\\bin\\tests\\tests.zip')\"";
2053 Utilities.addArchival(newJob, "bin/Product/**,bin/tests/tests.zip", "bin/Product/**/.nuget/**")
2057 assert isArmWindowsScenario(scenario)
2059 def machineAffinityOptions = ['use_arm64_build_machine' : true]
2060 setMachineAffinity(newJob, os, architecture, machineAffinityOptions)
2062 // This is now a build only job. Do not run tests. Use the flow job.
2063 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} toolset_dir C:\\ats2 -priority=${priority}"
2065 // Zip up the tests directory so that we don't use so much space/time copying
2066 // 10s of thousands of files around.
2067 buildCommands += "powershell -NoProfile -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${architecture}.${configuration}', '.\\bin\\tests\\tests.zip')\"";
2070 Utilities.addArchival(newJob, "bin/Product/**,bin/tests/tests.zip", "bin/Product/**/.nuget/**")
2073 println("Unknown architecture: ${architecture}");
2078 // editor brace matching: }
2087 case 'Fedora24': // editor brace matching: {
2088 switch (architecture) {
2091 if (architecture == 'x86' && os == 'Ubuntu') {
2092 // build and PAL test
2093 def dockerImage = getDockerImageName(architecture, os, true)
2094 buildCommands += "docker run -i --rm -v \${WORKSPACE}:/opt/code -w /opt/code -e ROOTFS_DIR=/crossrootfs/x86 ${dockerImage} ./build.sh ${architecture} cross ${lowerConfiguration}"
2095 dockerImage = getDockerImageName(architecture, os, false)
2096 buildCommands += "docker run -i --rm -v \${WORKSPACE}:/opt/code -w /opt/code ${dockerImage} ./src/pal/tests/palsuite/runpaltests.sh /opt/code/bin/obj/${osGroup}.${architecture}.${configuration} /opt/code/bin/paltestout"
2097 Utilities.addArchival(newJob, "bin/Product/**,bin/obj/*/tests/**/*.so", "bin/Product/**/.nuget/**")
2098 Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
2102 if (scenario == 'formatting') {
2103 buildCommands += "python tests/scripts/format.py -c \${WORKSPACE} -o Linux -a ${architecture}"
2104 Utilities.addArchival(newJob, "format.patch", "", true, false)
2108 if (scenario == 'illink') {
2109 assert(os == 'Ubuntu')
2110 buildCommands += "./tests/scripts/build_illink.sh --clone --arch=${architecture}"
2113 if (!enableCorefxTesting) {
2114 // We run pal tests on all OS but generate mscorlib (and thus, nuget packages)
2115 // only on supported OS platforms.
2116 def bootstrapRid = Utilities.getBoostrapPublishRid(os)
2117 def bootstrapRidEnv = bootstrapRid != null ? "__PUBLISH_RID=${bootstrapRid} " : ''
2119 buildCommands += "${bootstrapRidEnv}./build.sh verbose ${lowerConfiguration} ${architecture}"
2120 buildCommands += "src/pal/tests/palsuite/runpaltests.sh \${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration} \${WORKSPACE}/bin/paltestout"
2122 // Basic archiving of the build
2123 Utilities.addArchival(newJob, "bin/Product/**,bin/obj/*/tests/**/*.dylib,bin/obj/*/tests/**/*.so", "bin/Product/**/.nuget/**")
2125 Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
2128 // Corefx stress testing
2129 assert os == 'Ubuntu'
2130 assert architecture == 'x64'
2131 assert lowerConfiguration == 'checked'
2132 assert isJitStressScenario(scenario)
2135 buildCommands += "./build.sh verbose ${lowerConfiguration} ${architecture}"
2137 def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
2139 def envScriptCmds = envScriptCreate(os, scriptFileName)
2140 envScriptCmds += envScriptSetStressModeVariables(os, Constants.jitStressModeScenarios[scenario], scriptFileName)
2141 envScriptCmds += envScriptFinalize(os, scriptFileName)
2142 buildCommands += envScriptCmds
2144 // Build and text corefx
2145 def workspaceRelativeFxRoot = "_/fx"
2146 def absoluteFxRoot = "\$WORKSPACE/${workspaceRelativeFxRoot}"
2148 buildCommands += "python -u \$WORKSPACE/tests/scripts/run-corefx-tests.py -arch ${architecture} -ci_arch ${architecture} -build_type ${configuration} -fx_root ${absoluteFxRoot} -fx_branch ${branch} -env_script ${scriptFileName}"
2150 // Archive and process (only) the test results
2151 Utilities.addArchival(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
2152 Utilities.addXUnitDotNETResults(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
2156 if (!enableCorefxTesting) {
2157 buildCommands += "ROOTFS_DIR=/opt/arm64-xenial-rootfs ./build.sh verbose ${lowerConfiguration} ${architecture} cross clang3.8"
2159 // HACK -- Arm64 does not have corefx jobs yet.
2160 buildCommands += "git clone https://github.com/dotnet/corefx fx"
2161 buildCommands += "ROOTFS_DIR=/opt/arm64-xenial-rootfs-corefx ./fx/build-native.sh -release -buildArch=arm64 -- verbose cross clang3.8"
2162 buildCommands += "mkdir ./bin/Product/Linux.arm64.${configuration}/corefxNative"
2163 buildCommands += "cp fx/bin/Linux.arm64.Release/native/* ./bin/Product/Linux.arm64.${configuration}/corefxNative"
2165 // Basic archiving of the build
2166 Utilities.addArchival(newJob, "bin/Product/**,bin/obj/*/tests/**/*.dylib,bin/obj/*/tests/**/*.so", "bin/Product/**/.nuget/**")
2170 // Cross builds for ARM runs on Ubuntu, Ubuntu16.04 and Tizen currently
2171 assert (os == 'Ubuntu') || (os == 'Ubuntu16.04') || (os == 'Tizen')
2173 // default values for Ubuntu
2175 def linuxCodeName="trusty"
2176 if (os == 'Ubuntu16.04') {
2177 linuxCodeName="xenial"
2179 else if (os == 'Tizen') {
2181 linuxCodeName="tizen"
2184 // Unzip the Windows test binaries first. Exit with 0
2185 buildCommands += "unzip -q -o ./bin/tests/tests.zip -d ./bin/tests/Windows_NT.x64.${configuration} || exit 0"
2187 // Unpack the corefx binaries
2188 buildCommands += "mkdir ./bin/CoreFxBinDir"
2189 buildCommands += "tar -xf ./bin/build.tar.gz -C ./bin/CoreFxBinDir"
2190 if (os != 'Tizen') {
2191 buildCommands += "chmod a+x ./bin/CoreFxBinDir/corerun"
2193 // Test environment emulation using docker and qemu has some problem to use lttng library.
2194 // We should remove libcoreclrtraceptprovider.so to avoid test hang.
2195 if (os == 'Ubuntu') {
2196 buildCommands += "rm -f -v ./bin/CoreFxBinDir/libcoreclrtraceptprovider.so"
2199 // Call the ARM CI script to cross build and test using docker
2200 buildCommands += """./tests/scripts/arm32_ci_script.sh \\
2203 --linuxCodeName=${linuxCodeName} \\
2204 --buildConfig=${lowerConfiguration} \\
2205 --testRootDir=./bin/tests/Windows_NT.x64.${configuration} \\
2206 --coreFxBinDir=./bin/CoreFxBinDir \\
2207 --testDirFile=./tests/testsRunningInsideARM.txt"""
2209 // Basic archiving of the build, no pal tests
2210 Utilities.addArchival(newJob, "bin/Product/**,bin/obj/*/tests/**/*.dylib,bin/obj/*/tests/**/*.so", "bin/Product/**/.nuget/**")
2213 println("Unknown architecture: ${architecture}");
2218 // editor brace matching: }
2220 println("Unknown os: ${os}");
2225 return buildCommands
2228 Constants.allScenarios.each { scenario ->
2229 [true, false].each { isPR ->
2230 Constants.architectureList.each { architecture ->
2231 Constants.configurationList.each { configuration ->
2232 Constants.osList.each { os ->
2233 // If the OS is Windows_NT_BuildOnly, set the isBuildOnly flag to true
2234 // and reset the os to Windows_NT
2235 def isBuildOnly = false
2236 if (os == 'Windows_NT_BuildOnly') {
2241 // Tizen is only supported for arm architecture
2242 if (os == 'Tizen' && architecture != 'arm') {
2246 // Skip totally unimplemented (in CI) configurations.
2247 switch (architecture) {
2249 if (os == 'Ubuntu16.04') {
2253 // Windows and Ubuntu only
2254 if ((os != 'Windows_NT' && os != 'Ubuntu') || isBuildOnly) {
2259 if ((os != 'Ubuntu') && (os != 'Ubuntu16.04') && (os != 'Tizen') && (os != 'Windows_NT')) {
2264 // Do not create armlb jobs
2268 if ((os != 'Ubuntu') && (os != 'Windows_NT')) {
2272 case 'x86_arm_altjit':
2273 case 'x64_arm64_altjit':
2274 if (os != 'Windows_NT') {
2279 // Everything implemented
2282 println("Unknown architecture: ${architecture}")
2287 // Skip scenarios (blanket skipping for jit stress modes, which are good most everywhere
2288 // with checked builds)
2289 if (isJitStressScenario(scenario)) {
2290 if (configuration != 'Checked') {
2294 // Since these are just execution time differences,
2295 // skip platforms that don't execute the tests here (Windows_NT only)
2296 def isEnabledOS = (os == 'Windows_NT') || (os == 'Ubuntu' && isCoreFxScenario(scenario))
2301 switch (architecture) {
2304 case 'x86_arm_altjit':
2305 case 'x64_arm64_altjit':
2306 // x86 ubuntu: default only
2307 if ((os == 'Ubuntu') && (architecture == 'x86')) {
2316 // We use build only jobs for Windows arm cross-compilation corefx testing, so we need to generate builds for that.
2317 if (!isBuildOnly || !isCoreFxScenario(scenario)) {
2323 // arm64, armlb: stress is handled through flow jobs.
2327 else if (isR2RScenario(scenario)) {
2328 if (os != 'Windows_NT') {
2331 // Stress scenarios only run with Checked builds, not Release (they would work with Debug, but be slow).
2332 if ((configuration != 'Checked') && isR2RStressScenario(scenario)) {
2340 // The ilrt build isn't necessary except for Windows_NT2003. Non-Windows NT uses
2341 // the default scenario build
2342 if (os != 'Windows_NT') {
2346 if (architecture != 'x64') {
2350 if (configuration != 'Release') {
2355 if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
2358 if (architecture != 'x64') {
2361 if (configuration != 'Checked') {
2367 if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
2370 if (architecture != 'x64') {
2373 if (configuration != 'Release') {
2377 case 'gc_reliability_framework':
2378 case 'standalone_gc':
2379 if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
2383 if (architecture != 'x64') {
2387 if (configuration != 'Release' && configuration != 'Checked') {
2391 // We only run Windows and Ubuntu x64 Checked for formatting right now
2393 if (os != 'Windows_NT' && os != 'Ubuntu') {
2396 if (architecture != 'x64') {
2399 if (configuration != 'Checked') {
2407 if (os != 'Windows_NT' && (os != 'Ubuntu' || architecture != 'x64')) {
2410 if (architecture != 'x64' && architecture != 'x86') {
2421 if (!isValidPrTriggeredInnerLoopJob(os, architecture, configuration, isBuildOnly)) {
2426 println("Unknown scenario: ${scenario}")
2432 // For altjit, don't do any scenarios that don't change compilation. That is, scenarios that only change
2433 // runtime behavior, not compile-time behavior, are not interesting.
2434 switch (architecture) {
2435 case 'x86_arm_altjit':
2436 case 'x64_arm64_altjit':
2437 if (isGCStressRelatedTesting(scenario)) {
2446 def lowerConfiguration = configuration.toLowerCase()
2447 def jobName = getJobName(configuration, architecture, os, scenario, isBuildOnly)
2448 def folderName = getJobFolder(scenario)
2450 // Create the new job
2451 def newJob = job(Utilities.getFullJobName(project, jobName, isPR, folderName)) {}
2452 addToViews(newJob, isPR, architecture, os)
2454 def machineAffinityOptions = null
2456 if (os != 'Windows_NT') {
2457 machineAffinityOptions = architecture == 'arm64' ? ['is_build_only': true] : null
2460 machineAffinityOptions = (architecture == 'arm' || architecture == 'armlb' || architecture == 'arm64') ? ['use_arm64_build_machine': false] : null
2463 setMachineAffinity(newJob, os, architecture, machineAffinityOptions)
2465 // Add all the standard options
2466 Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
2467 addTriggers(newJob, branch, isPR, architecture, os, configuration, scenario, false, isBuildOnly) // isFlowJob==false
2469 def buildCommands = calculateBuildCommands(newJob, scenario, branch, isPR, architecture, configuration, os, isBuildOnly)
2470 def osGroup = getOSGroup(os)
2474 if (os == 'Windows_NT') {
2475 buildCommands.each { buildCommand ->
2476 batchFile(buildCommand)
2480 // Setup corefx and Windows test binaries for Linux cross build for ubuntu-arm, ubuntu16.04-arm and tizen-armel
2481 if ( architecture == 'arm' && ( os == 'Ubuntu' || os == 'Ubuntu16.04' || os == 'Tizen')) {
2482 // Cross build for ubuntu-arm, ubuntu16.04-arm and tizen-armel
2483 // Define the Windows Tests and Corefx build job names
2484 def WindowsTestsName = projectFolder + '/' +
2485 Utilities.getFullJobName(project,
2486 getJobName(lowerConfiguration, 'x64' , 'windows_nt', 'normal', true),
2488 def corefxFolder = Utilities.getFolderName('dotnet/corefx') + '/' +
2489 Utilities.getFolderName(branch)
2491 // Copy the Windows test binaries and the Corefx build binaries
2492 copyArtifacts(WindowsTestsName) {
2493 includePatterns('bin/tests/tests.zip')
2495 latestSuccessful(true)
2500 def corefx_os = 'linux'
2501 if (os == 'Tizen') {
2506 // Let's use release CoreFX to test checked CoreCLR,
2507 // because we do not generate checked CoreFX in CoreFX CI yet.
2508 def corefx_lowerConfiguration = lowerConfiguration
2509 if ( lowerConfiguration == 'checked' ) {
2510 corefx_lowerConfiguration='release'
2513 copyArtifacts("${corefxFolder}/${corefx_os}_${arm_abi}_cross_${corefx_lowerConfiguration}") {
2514 includePatterns('bin/build.tar.gz')
2516 latestSuccessful(true)
2521 buildCommands.each { buildCommand ->
2535 // Create jobs requiring flow jobs. This includes x64 non-Windows, arm64 Ubuntu, and arm/arm64/armlb Windows.
2536 Constants.allScenarios.each { scenario ->
2537 def isNormalOrInnerloop = (scenario == 'innerloop' || scenario == 'normal')
2539 [true, false].each { isPR ->
2540 ['arm', 'armlb', 'x64', 'arm64', 'x86'].each { architecture ->
2541 Constants.crossList.each { os ->
2542 if (architecture == 'arm64') {
2543 if (os != "Ubuntu" && os != "Windows_NT") {
2546 } else if (architecture == 'arm') {
2547 if (os != 'Windows_NT') {
2550 } else if (architecture == 'armlb') {
2551 // Do not create armlb windows jobs.
2553 } else if (architecture == 'x86') {
2554 if (os != "Ubuntu") {
2559 def validWindowsNTCrossArches = ["arm", "armlb", "arm64"]
2561 if (os == "Windows_NT" && !(architecture in validWindowsNTCrossArches)) {
2565 Constants.configurationList.each { configuration ->
2567 // First, filter based on OS.
2569 if (os == 'Windows_NT') {
2570 if (!isArmWindowsScenario(scenario)) {
2576 if (architecture == 'arm64') {
2577 if (!(scenario in Constants.validLinuxArm64Scenarios)) {
2581 else if (architecture == 'x86') {
2582 // Linux/x86 only want innerloop and default test
2583 if (!isNormalOrInnerloop) {
2589 // For CentOS, we only want Checked/Release builds.
2590 if (os == 'CentOS7.1') {
2591 if (configuration != 'Checked' && configuration != 'Release') {
2594 if (!isNormalOrInnerloop && !isR2RScenario(scenario) && !isJitStressScenario(scenario)) {
2599 // For RedHat and Debian, we only do Release builds.
2600 else if (os == 'RHEL7.2' || os == 'Debian8.4') {
2601 if (configuration != 'Release') {
2604 if (!isNormalOrInnerloop) {
2609 // Next, filter based on scenario.
2611 if (isJitStressScenario(scenario)) {
2612 if (configuration != 'Checked') {
2616 // CoreFx JIT stress tests currently only implemented for ARM.
2617 if (isCoreFxScenario(scenario) && (architecture != 'arm')) {
2621 else if (isR2RBaselineScenario(scenario)) {
2622 if (configuration != 'Checked' && configuration != 'Release') {
2626 else if (isR2RStressScenario(scenario)) {
2627 if (configuration != 'Checked') {
2637 // Long GC tests take a long time on non-Release builds
2638 // ilrt is also Release only
2639 if (configuration != 'Release') {
2645 if (configuration != 'Checked') {
2650 case 'gc_reliability_framework':
2651 case 'standalone_gc':
2652 if (configuration != 'Release' && configuration != 'Checked') {
2660 if (os != 'Windows_NT' && os != 'Ubuntu') {
2671 if (!isValidPrTriggeredInnerLoopJob(os, architecture, configuration, false)) {
2677 println("Unknown scenario: ${scenario}")
2683 // Done filtering. Now, create the jobs.
2685 // =============================================================================================
2686 // Create the test job
2687 // =============================================================================================
2689 def windowsArmJob = (os == "Windows_NT" && architecture in validWindowsNTCrossArches)
2691 def lowerConfiguration = configuration.toLowerCase()
2692 def osGroup = getOSGroup(os)
2693 def jobName = getJobName(configuration, architecture, os, scenario, false) + "_tst"
2695 def inputCoreCLRBuildScenario = scenario == 'innerloop' ? 'innerloop' : 'normal'
2696 def inputCoreCLRBuildIsBuildOnly = false
2697 if (isCoreFxScenario(scenario)) {
2698 // Every CoreFx test depends on its own unique build.
2699 inputCoreCLRBuildScenario = scenario
2700 inputCoreCLRBuildIsBuildOnly = true
2702 def inputCoreCLRFolderName = getJobFolder(inputCoreCLRBuildScenario)
2703 def inputCoreCLRBuildName = projectFolder + '/' +
2704 Utilities.getFullJobName(project, getJobName(configuration, architecture, os, inputCoreCLRBuildScenario, inputCoreCLRBuildIsBuildOnly), isPR, inputCoreCLRFolderName)
2706 def inputWindowsTestsBuildName = ""
2707 if (windowsArmJob != true) {
2708 // If this is a stress scenario, there isn't any difference in the build job, so we didn't create a build only
2709 // job for Windows_NT specific to that stress mode. Just copy from the default scenario.
2711 def testBuildScenario = scenario == 'innerloop' ? 'innerloop' : 'normal'
2713 def inputWindowsTestBuildArch = architecture
2714 if (architecture == "arm64" && os != "Windows_NT") {
2715 // Use the x64 test build for arm64 unix
2716 inputWindowsTestBuildArch = "x64"
2719 if (isJitStressScenario(scenario)) {
2720 inputWindowsTestsBuildName = projectFolder + '/' +
2721 Utilities.getFullJobName(project, getJobName(configuration, inputWindowsTestBuildArch, 'windows_nt', testBuildScenario, false), isPR)
2723 inputWindowsTestsBuildName = projectFolder + '/' +
2724 Utilities.getFullJobName(project, getJobName(configuration, inputWindowsTestBuildArch, 'windows_nt', testBuildScenario, true), isPR)
2726 } // if (windowsArmJob != true)
2728 def serverGCString = ''
2731 if (windowsArmJob != true) {
2732 // Enable Server GC for Ubuntu PR builds
2733 if (os == 'Ubuntu' && isPR) {
2734 serverGCString = '--useServerGC'
2737 if (isR2RScenario(scenario)) {
2739 testOpts += ' --crossgen --runcrossgentests'
2741 if (scenario == 'r2r_jitstress1') {
2742 testOpts += ' --jitstress=1'
2744 else if (scenario == 'r2r_jitstress2') {
2745 testOpts += ' --jitstress=2'
2747 else if (scenario == 'r2r_jitstressregs1') {
2748 testOpts += ' --jitstressregs=1'
2750 else if (scenario == 'r2r_jitstressregs2') {
2751 testOpts += ' --jitstressregs=2'
2753 else if (scenario == 'r2r_jitstressregs3') {
2754 testOpts += ' --jitstressregs=3'
2756 else if (scenario == 'r2r_jitstressregs4') {
2757 testOpts += ' --jitstressregs=4'
2759 else if (scenario == 'r2r_jitstressregs8') {
2760 testOpts += ' --jitstressregs=8'
2762 else if (scenario == 'r2r_jitstressregs0x10') {
2763 testOpts += ' --jitstressregs=0x10'
2765 else if (scenario == 'r2r_jitstressregs0x80') {
2766 testOpts += ' --jitstressregs=0x80'
2768 else if (scenario == 'r2r_jitstressregs0x1000') {
2769 testOpts += ' --jitstressregs=0x1000'
2771 else if (scenario == 'r2r_jitminopts') {
2772 testOpts += ' --jitminopts'
2774 else if (scenario == 'r2r_jitforcerelocs') {
2775 testOpts += ' --jitforcerelocs'
2777 else if (scenario == 'r2r_gcstress15') {
2778 testOpts += ' --gcstresslevel=0xF'
2781 else if (scenario == 'jitdiff') {
2782 testOpts += ' --jitdisasm --crossgen'
2784 else if (scenario == 'illink') {
2785 testOpts += ' --link=\$WORKSPACE/linker/linker/bin/netcore_Release/netcoreapp2.0/ubuntu-x64/publish/illink'
2787 else if (isLongGc(scenario)) {
2788 // Long GC tests behave very poorly when they are not
2789 // the only test running (many of them allocate until OOM).
2790 testOpts += ' --sequential'
2792 // A note - runtest.sh does have "--long-gc" and "--gcsimulator" options
2793 // for running long GC and GCSimulator tests, respectively. We don't use them
2794 // here because using a playlist file produces much more readable output on the CI machines
2795 // and reduces running time.
2797 // The Long GC playlist contains all of the tests that are
2798 // going to be run. The GCSimulator playlist contains all of
2799 // the GC simulator tests.
2800 if (scenario == 'longgc') {
2801 testOpts += ' --long-gc --playlist=./tests/longRunningGcTests.txt'
2803 else if (scenario == 'gcsimulator') {
2804 testOpts += ' --gcsimulator --playlist=./tests/gcSimulatorTests.txt'
2807 else if (isGcReliabilityFramework(scenario)) {
2808 testOpts += ' --build-overlay-only'
2810 else if (scenario == 'standalone_gc') {
2811 if (osGroup == 'OSX') {
2812 testOpts += ' --gcname=libclrgc.dylib'
2814 else if (osGroup == 'Linux') {
2815 testOpts += ' --gcname=libclrgc.so'
2818 println("Unexpected OS group: ${osGroup} for os ${os}")
2822 } // if (windowsArmJob != true)
2824 def folder = getJobFolder(scenario)
2825 def newJob = job(Utilities.getFullJobName(project, jobName, isPR, folder)) {
2826 // Add parameters for the inputs
2828 if (windowsArmJob == true) {
2830 stringParam('CORECLR_BUILD', '', "Build number to copy CoreCLR ${osGroup} binaries from")
2835 stringParam('CORECLR_WINDOWS_BUILD', '', 'Build number to copy CoreCLR Windows test binaries from')
2836 stringParam('CORECLR_BUILD', '', "Build number to copy CoreCLR ${osGroup} binaries from")
2841 // Set up the copies
2843 // Coreclr build containing the tests and mscorlib
2844 // pri1 jobs still need to copy windows_nt built tests
2845 if (windowsArmJob != true) {
2846 copyArtifacts(inputWindowsTestsBuildName) {
2847 excludePatterns('**/testResults.xml', '**/*.ni.dll')
2849 buildNumber('${CORECLR_WINDOWS_BUILD}')
2854 // Coreclr build we are trying to test
2856 // ** NOTE ** This will, correctly, overwrite the CORE_ROOT from the Windows test archive
2858 copyArtifacts(inputCoreCLRBuildName) {
2859 excludePatterns('**/testResults.xml', '**/*.ni.dll')
2861 buildNumber('${CORECLR_BUILD}')
2865 // Windows CoreCLR Arm(64) will restore corefx
2866 // packages correctly.
2868 // In addition, test steps are entirely different
2869 // because we do not have a unified runner
2870 if (windowsArmJob != true) {
2871 def corefxFolder = Utilities.getFolderName('dotnet/corefx') + '/' + Utilities.getFolderName(branch)
2873 // HACK -- Arm64 does not have corefx jobs yet.
2874 // Clone corefx and build the native packages overwriting the x64 packages.
2875 if (architecture == 'arm64') {
2876 shell("mkdir -p ./bin/CoreFxBinDir")
2877 shell("cp ./bin/Product/Linux.arm64.${configuration}/corefxNative/* ./bin/CoreFxBinDir")
2878 shell("chmod +x ./bin/Product/Linux.arm64.${configuration}/corerun")
2880 else if (architecture == 'x86') {
2881 shell("mkdir ./bin/CoreFxNative")
2883 copyArtifacts("${corefxFolder}/ubuntu16.04_x86_release") {
2884 includePatterns('bin/build.tar.gz')
2885 targetDirectory('bin/CoreFxNative')
2887 latestSuccessful(true)
2891 shell("tar -xf ./bin/CoreFxNative/bin/build.tar.gz -C ./bin/CoreFxBinDir")
2894 // Unzip the tests first. Exit with 0
2895 shell("unzip -q -o ./bin/tests/tests.zip -d ./bin/tests/${osGroup}.${architecture}.${configuration} || exit 0")
2896 shell("rm -r ./bin/tests/${osGroup}.${architecture}.${configuration}/Tests/Core_Root || exit 0")
2898 shell("./build-test.sh ${architecture} ${configuration} generatelayoutonly")
2900 // Execute the tests
2901 def runDocker = isNeedDocker(architecture, os, false)
2902 def dockerPrefix = ""
2905 def dockerImage = getDockerImageName(architecture, os, false)
2906 dockerPrefix = "docker run -i --rm -v \${WORKSPACE}:\${WORKSPACE} -w \${WORKSPACE} "
2907 dockerCmd = dockerPrefix + "${dockerImage} "
2910 // If we are running a stress mode, we'll set those variables first
2912 if (isJitStressScenario(scenario)) {
2913 def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
2914 def envScriptCmds = envScriptCreate(os, scriptFileName)
2915 envScriptCmds += envScriptSetStressModeVariables(os, Constants.jitStressModeScenarios[scenario], scriptFileName)
2916 envScriptCmds += envScriptFinalize(os, scriptFileName)
2917 shell("${envScriptCmds}")
2918 testEnvOpt = "--test-env=" + scriptFileName
2921 if (isGCStressRelatedTesting(scenario)) {
2922 shell('./init-tools.sh')
2925 shell("""${dockerCmd}./tests/runtest.sh \\
2926 --testRootDir=\"\${WORKSPACE}/bin/tests/${osGroup}.${architecture}.${configuration}\" \\
2927 --coreOverlayDir=\"\${WORKSPACE}/bin/tests/${osGroup}.${architecture}.${configuration}/Tests/Core_Root\" \\
2928 --testNativeBinDir=\"\${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2929 --copyNativeTestBin --limitedDumpGeneration ${testEnvOpt} ${serverGCString} ${testOpts}""")
2931 if (isGcReliabilityFramework(scenario)) {
2932 // runtest.sh doesn't actually execute the reliability framework - do it here.
2933 if (serverGCString != '') {
2935 dockerCmd = dockerPrefix + "-e COMPlus_gcServer=1 ${dockerImage} "
2938 shell("export COMPlus_gcServer=1")
2942 shell("${dockerCmd}./tests/scripts/run-gc-reliability-framework.sh ${architecture} ${configuration}")
2945 else { // windowsArmJob == true
2947 if (isCoreFxScenario(scenario)) {
2949 // Only arm supported for corefx testing now.
2950 assert architecture == 'arm'
2952 // Unzip CoreFx runtime
2953 batchFile("powershell -NoProfile -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::ExtractToDirectory('_\\fx\\fxruntime.zip', '_\\fx\\bin\\testhost\\netcoreapp-Windows_NT-Release-arm')")
2955 // Unzip CoreFx tests.
2956 batchFile("powershell -NoProfile -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::ExtractToDirectory('_\\fx\\fxtests.zip', '_\\fx\\bin\\tests')")
2958 // Add the script to run the corefx tests
2959 def corefx_runtime_path = "%WORKSPACE%\\_\\fx\\bin\\testhost\\netcoreapp-Windows_NT-Release-arm"
2960 def corefx_tests_dir = "%WORKSPACE%\\_\\fx\\bin\\tests"
2961 def corefx_exclusion_file = "%WORKSPACE%\\tests\\arm\\corefx_test_exclusions.txt"
2962 batchFile("call %WORKSPACE%\\tests\\scripts\\run-corefx-tests.bat ${corefx_runtime_path} ${corefx_tests_dir} ${corefx_exclusion_file}")
2964 } else { // !isCoreFxScenario(scenario)
2967 batchFile("powershell -NoProfile -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::ExtractToDirectory('bin\\tests\\tests.zip', 'bin\\tests\\${osGroup}.${architecture}.${configuration}')")
2969 def buildCommands = ""
2971 def coreRootLocation = "%WORKSPACE%\\bin\\tests\\Windows_NT.${architecture}.${configuration}\\Tests\\Core_Root"
2972 def addEnvVariable = { variable, value -> buildCommands += "set ${variable}=${value}\r\n"}
2973 def addCommand = { cmd -> buildCommands += "${cmd}\r\n"}
2975 // Make sure Command Extensions are enabled. Used so %ERRORLEVEL% is available.
2976 addCommand("SETLOCAL ENABLEEXTENSIONS")
2979 addEnvVariable("CORE_ROOT", coreRootLocation)
2981 addEnvVariable("COMPlus_NoGuiOnAssert", "1")
2982 addEnvVariable("COMPlus_ContinueOnAssert", "0")
2984 // ARM legacy backend; this is an altjit.
2985 if (architecture == "armlb") {
2986 addEnvVariable("COMPlus_AltJit", "*")
2987 addEnvVariable("COMPlus_AltJitNgen", "*")
2988 addEnvVariable("COMPlus_AltJitName", "legacyjit.dll")
2989 addEnvVariable("COMPlus_AltJitAssertOnNYI", "1")
2992 // If we are running a stress mode, we'll set those variables as well
2993 if (isJitStressScenario(scenario) || isR2RStressScenario(scenario)) {
2994 def stressValues = null
2995 if (isJitStressScenario(scenario)) {
2996 stressValues = Constants.jitStressModeScenarios[scenario]
2999 stressValues = Constants.r2rStressScenarios[scenario]
3002 stressValues.each { key, value ->
3003 addEnvVariable(key, value)
3007 if (isR2RScenario(scenario)) {
3008 // Crossgen the framework assemblies.
3009 buildCommands += """
3010 @for %%F in (%CORE_ROOT%\\*.dll) do @call :PrecompileAssembly "%CORE_ROOT%" "%%F" %%~nxF
3011 @goto skip_PrecompileAssembly
3014 @REM Skip mscorlib since it is already precompiled.
3015 @if /I "%3" == "mscorlib.dll" exit /b 0
3016 @if /I "%3" == "mscorlib.ni.dll" exit /b 0
3018 "%CORE_ROOT%\\crossgen.exe" /Platform_Assemblies_Paths "%CORE_ROOT%" %2 >nul 2>nul
3019 @if "%errorlevel%" == "-2146230517" (
3020 echo %2 is not a managed assembly.
3021 ) else if "%errorlevel%" == "-2146234344" (
3022 echo %2 is not a managed assembly.
3023 ) else if %errorlevel% neq 0 (
3024 echo Unable to precompile %2
3030 :skip_PrecompileAssembly
3033 // Set RunCrossGen variable to cause test wrappers to invoke their logic to run
3034 // crossgen on tests before running them.
3035 addEnvVariable("RunCrossGen", "true")
3036 } // isR2RScenario(scenario)
3038 // Create the smarty command
3039 def smartyCommand = "C:\\Tools\\Smarty.exe /noecid /noie /workers 9 /inc EXPECTED_PASS "
3040 def addSmartyFlag = { flag -> smartyCommand += flag + " "}
3041 def addExclude = { exclude -> addSmartyFlag("/exc " + exclude)}
3043 def addArchSpecificExclude = { architectureToExclude, exclude -> if (architectureToExclude == "armlb") { addExclude("LEGACYJIT_" + exclude) } else { addExclude(exclude) } }
3045 if (architecture == "armlb") {
3046 addExclude("LEGACYJIT_FAIL")
3049 // Exclude tests based on scenario.
3050 Constants.validArmWindowsScenarios[scenario].each { excludeTag ->
3051 addArchSpecificExclude(architecture, excludeTag)
3054 // Innerloop jobs run Pri-0 tests; everyone else runs Pri-1.
3055 if (scenario == 'innerloop') {
3059 // Exclude any test marked LONG_RUNNING; these often exceed the standard timeout and fail as a result.
3060 // TODO: We should create a "long running" job that runs these with a longer timeout.
3061 addExclude("LONG_RUNNING")
3063 smartyCommand += "/lstFile Tests.lst"
3065 def testListArch = [
3071 def archLocation = testListArch[architecture]
3073 addCommand("copy %WORKSPACE%\\tests\\${archLocation}\\Tests.lst bin\\tests\\${osGroup}.${architecture}.${configuration}")
3074 addCommand("pushd bin\\tests\\${osGroup}.${architecture}.${configuration}")
3075 addCommand("${smartyCommand}")
3077 // Save the errorlevel from the smarty command to be used as the errorlevel of this batch file.
3078 // However, we also need to remove all the variables that were set during this batch file, so we
3079 // can run the ZIP powershell command (below) in a clean environment. (We can't run the powershell
3080 // command with the COMPlus_AltJit variables set, for example.) To do that, we do ENDLOCAL as well
3081 // as save the current errorlevel on the same line. This works because CMD evaluates the %errorlevel%
3082 // variable expansion (or any variable expansion on the line) BEFORE it executes the ENDLOCAL command.
3083 // Note that the ENDLOCAL also undoes the pushd command, but we add the popd here for clarity.
3084 addCommand("popd & ENDLOCAL & set __save_smarty_errorlevel=%errorlevel%")
3086 // ZIP up the smarty output, no matter what the smarty result.
3087 addCommand("powershell -NoProfile -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${architecture}.${configuration}\\Smarty.run.0', '.\\bin\\tests\\${osGroup}.${architecture}.${configuration}\\Smarty.run.0.zip')\"")
3089 addCommand("echo %errorlevel%")
3090 addCommand("dir .\\bin\\tests\\${osGroup}.${architecture}.${configuration}")
3092 // Use the smarty errorlevel as the script errorlevel.
3093 addCommand("exit /b %__save_smarty_errorlevel%")
3095 batchFile(buildCommands)
3096 } // non-corefx testing
3097 } // windowsArmJob == true
3101 addToViews(newJob, isPR, architecture, os)
3103 if (scenario == 'jitdiff') {
3104 Utilities.addArchival(newJob, "bin/tests/${osGroup}.${architecture}.${configuration}/dasm/**")
3107 // Experimental: If on Ubuntu 14.04, then attempt to pull in crash dump links
3108 if (os in ['Ubuntu']) {
3109 SummaryBuilder summaries = new SummaryBuilder()
3110 summaries.addLinksSummaryFromFile('Crash dumps from this run:', 'dumplings.txt')
3111 summaries.emit(newJob)
3114 def affinityOptions = null
3116 if (windowsArmJob == true) {
3118 "use_arm64_build_machine" : false
3122 else if (architecture == 'arm64' && os != 'Windows_NT') {
3124 "large_pages" : false
3128 setMachineAffinity(newJob, os, architecture, affinityOptions)
3129 Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
3131 setJobTimeout(newJob, isPR, architecture, configuration, scenario, false)
3133 if (windowsArmJob != true) {
3134 Utilities.addXUnitDotNETResults(newJob, '**/coreclrtests.xml')
3137 if (!isCoreFxScenario(scenario)) {
3138 Utilities.addArchival(newJob, "bin/tests/${osGroup}.${architecture}.${configuration}/Smarty.run.0/*.smrt", '', true, false)
3140 // Archive a ZIP file of the entire Smarty.run.0 directory. This is possibly a little too much,
3141 // but there is no easy way to only archive the HTML/TXT files of the failing tests, so we get
3142 // all the passing test info as well. Not necessarily a bad thing, but possibly somewhat large.
3143 Utilities.addArchival(newJob, "bin/tests/${osGroup}.${architecture}.${configuration}/Smarty.run.0.zip", '', true, false)
3147 // =============================================================================================
3148 // Create a build flow to join together the build and tests required to run this test.
3149 // =============================================================================================
3151 // Windows CoreCLR build and Linux CoreCLR build (in parallel) ->
3152 // Linux CoreCLR test
3153 def flowJobName = getJobName(configuration, architecture, os, scenario, false) + "_flow"
3154 def fullTestJobName = projectFolder + '/' + newJob.name
3155 // Add a reference to the input jobs for report purposes
3156 JobReport.Report.addReference(inputCoreCLRBuildName)
3157 if (windowsArmJob != true) {
3158 JobReport.Report.addReference(inputWindowsTestsBuildName)
3160 JobReport.Report.addReference(fullTestJobName)
3161 def newFlowJob = null
3163 if (os == 'RHEL7.2' || os == 'Debian8.4') {
3164 // Do not create the flow job for RHEL jobs.
3168 // For pri0 jobs we can build tests on unix
3169 if (windowsArmJob) {
3170 // For Windows arm jobs there is no reason to build a parallel test job.
3171 // The product build supports building and archiving the tests.
3173 newFlowJob = buildFlowJob(Utilities.getFullJobName(project, flowJobName, isPR, folder)) {
3175 coreclrBuildJob = build(params, '${inputCoreCLRBuildName}')
3177 // And then build the test build
3178 build(params + [CORECLR_BUILD: coreclrBuildJob.build.number], '${fullTestJobName}')
3183 newFlowJob = buildFlowJob(Utilities.getFullJobName(project, flowJobName, isPR, folder)) {
3185 // Build the input jobs in parallel
3187 { coreclrBuildJob = build(params, '${inputCoreCLRBuildName}') },
3188 { windowsBuildJob = build(params, '${inputWindowsTestsBuildName}') }
3191 // And then build the test build
3192 build(params + [CORECLR_BUILD: coreclrBuildJob.build.number,
3193 CORECLR_WINDOWS_BUILD: windowsBuildJob.build.number], '${fullTestJobName}')
3198 addToViews(newFlowJob, isPR, architecture, os)
3200 // For the flow jobs set the machine affinity as x64 if an armarch.
3201 def flowArch = architecture
3203 if (flowArch in validWindowsNTCrossArches) {
3205 affinityOptions = null
3208 setMachineAffinity(newFlowJob, os, flowArch, affinityOptions)
3209 Utilities.standardJobSetup(newFlowJob, project, isPR, "*/${branch}")
3210 addTriggers(newFlowJob, branch, isPR, architecture, os, configuration, scenario, true, false) // isFlowJob==true, isWindowsBuildOnlyJob==false
3217 JobReport.Report.generateJobReport(out)
3219 // Make the call to generate the help job
3220 Utilities.createHelperJob(this, project, branch,
3221 "Welcome to the ${project} Repository", // This is prepended to the help message
3222 "Have a nice day!") // This is appended to the help message. You might put known issues here.
3224 Utilities.addCROSSCheck(this, project, branch)