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 'OpenSUSE42.1': 'Linux',
32 def osGroup = osGroupMap.get(os, null)
33 assert osGroup != null : "Could not find os group for ${os}"
37 // We use this class (vs variables) so that the static functions can access data here.
40 // Innerloop build OS's
41 // The Windows_NT_BuildOnly OS is a way to speed up the Non-NT builds temporarily by avoiding
42 // test execution in the build flow runs. It generates the exact same build
43 // as Windows_NT but without the tests.
49 'Windows_NT_BuildOnly',
59 def static crossList = ['Ubuntu', 'OSX10.12', 'CentOS7.1', 'RHEL7.2', 'Debian8.4']
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 'forcerelocs' : ['COMPlus_ForceRelocs' : '1'],
67 'jitstress1' : ['COMPlus_JitStress' : '1'],
68 'jitstress2' : ['COMPlus_JitStress' : '2'],
69 'jitstressregs1' : ['COMPlus_JitStressRegs' : '1'],
70 'jitstressregs2' : ['COMPlus_JitStressRegs' : '2'],
71 'jitstressregs3' : ['COMPlus_JitStressRegs' : '3'],
72 'jitstressregs4' : ['COMPlus_JitStressRegs' : '4'],
73 'jitstressregs8' : ['COMPlus_JitStressRegs' : '8'],
74 'jitstressregs0x10' : ['COMPlus_JitStressRegs' : '0x10'],
75 'jitstressregs0x80' : ['COMPlus_JitStressRegs' : '0x80'],
76 'jitstressregs0x1000' : ['COMPlus_JitStressRegs' : '0x1000'],
77 'jitstress2_jitstressregs1' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '1'],
78 'jitstress2_jitstressregs2' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '2'],
79 'jitstress2_jitstressregs3' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '3'],
80 'jitstress2_jitstressregs4' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '4'],
81 'jitstress2_jitstressregs8' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '8'],
82 'jitstress2_jitstressregs0x10' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '0x10'],
83 'jitstress2_jitstressregs0x80' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '0x80'],
84 'jitstress2_jitstressregs0x1000' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '0x1000'],
85 'tailcallstress' : ['COMPlus_TailcallStress' : '1'],
86 'jitsse2only' : ['COMPlus_EnableAVX' : '0', 'COMPlus_EnableSSE3_4' : '0'],
87 'corefx_baseline' : [ : ], // corefx baseline
88 'corefx_minopts' : ['COMPlus_JITMinOpts' : '1'],
89 'corefx_jitstress1' : ['COMPlus_JitStress' : '1'],
90 'corefx_jitstress2' : ['COMPlus_JitStress' : '2'],
91 'corefx_jitstressregs1' : ['COMPlus_JitStressRegs' : '1'],
92 'corefx_jitstressregs2' : ['COMPlus_JitStressRegs' : '2'],
93 'corefx_jitstressregs3' : ['COMPlus_JitStressRegs' : '3'],
94 'corefx_jitstressregs4' : ['COMPlus_JitStressRegs' : '4'],
95 'corefx_jitstressregs8' : ['COMPlus_JitStressRegs' : '8'],
96 'corefx_jitstressregs0x10' : ['COMPlus_JitStressRegs' : '0x10'],
97 'corefx_jitstressregs0x80' : ['COMPlus_JitStressRegs' : '0x80'],
98 'corefx_jitstressregs0x1000' : ['COMPlus_JitStressRegs' : '0x1000'],
99 'gcstress0x3' : ['COMPlus_GCStress' : '0x3'],
100 'gcstress0xc' : ['COMPlus_GCStress' : '0xC'],
101 'zapdisable' : ['COMPlus_ZapDisable' : '1', 'COMPlus_ReadyToRun' : '0'],
102 'heapverify1' : ['COMPlus_HeapVerify' : '1'],
103 'gcstress0xc_zapdisable' : ['COMPlus_GCStress' : '0xC', 'COMPlus_ZapDisable' : '1', 'COMPlus_ReadyToRun' : '0'],
104 'gcstress0xc_zapdisable_jitstress2' : ['COMPlus_GCStress' : '0xC', 'COMPlus_ZapDisable' : '1', 'COMPlus_ReadyToRun' : '0', 'COMPlus_JitStress' : '2'],
105 'gcstress0xc_zapdisable_heapverify1' : ['COMPlus_GCStress' : '0xC', 'COMPlus_ZapDisable' : '1', 'COMPlus_ReadyToRun' : '0', 'COMPlus_HeapVerify' : '1'],
106 'gcstress0xc_jitstress1' : ['COMPlus_GCStress' : '0xC', 'COMPlus_JitStress' : '1'],
107 'gcstress0xc_jitstress2' : ['COMPlus_GCStress' : '0xC', 'COMPlus_JitStress' : '2'],
108 'gcstress0xc_minopts_heapverify1' : ['COMPlus_GCStress' : '0xC', 'COMPlus_JITMinOpts' : '1', 'COMPlus_HeapVerify' : '1']
111 // This is a set of r2r jit stress scenarios
112 def static r2rJitStressScenarios = [
115 'r2r_jitstressregs1',
116 'r2r_jitstressregs2',
117 'r2r_jitstressregs3',
118 'r2r_jitstressregs4',
119 'r2r_jitstressregs8',
120 'r2r_jitstressregs0x10',
121 'r2r_jitstressregs0x80',
122 'r2r_jitstressregs0x1000',
124 'r2r_jitforcerelocs']
126 // This is the basic set of scenarios
127 def static basicScenarios = [
133 'gcstress15_pri1r2r',
140 'gc_reliability_framework',
141 'illink'] + r2rJitStressScenarios
143 def static configurationList = ['Debug', 'Checked', 'Release']
145 // This is the set of architectures
146 def static architectureList = ['arm', 'arm64', 'x64', 'x86', 'x86lb']
149 def static setMachineAffinity(def job, def os, def architecture, def options = null) {
150 if (architecture == 'arm64' && os == 'Windows_NT') {
151 Utilities.setMachineAffinity(job, os, 'latest-arm64');
152 } else if (architecture == 'arm64' && os != 'Windows_NT' && options == null) {
153 Utilities.setMachineAffinity(job, os, 'arm64-small-page-size');
154 } else if (architecture == 'arm64' && os != 'Windows_NT' && options['large_pages'] == true) {
155 Utilities.setMachineAffinity(job, os, 'arm64-huge-page-size');
156 } else if (architecture == 'arm64' && os != 'Windows_NT' && options['is_build_only'] == true) {
157 Utilities.setMachineAffinity(job, os, 'arm64-cross-latest');
158 } else if ((architecture == 'arm') && (os == 'Ubuntu' || os == 'Ubuntu16.04' || os == 'Tizen')) {
159 Utilities.setMachineAffinity(job, 'Ubuntu', 'arm-cross-latest');
160 } else if ((architecture == 'arm') && (os == 'Windows_NT') && options['use_arm64_build_machine'] == true) {
161 Utilities.setMachineAffinity(job, os, 'latest-arm64');
163 Utilities.setMachineAffinity(job, os, 'latest-or-auto');
167 def static isJITStressJob(def scenario) {
168 return Constants.jitStressModeScenarios.containsKey(scenario) ||
169 (Constants.r2rJitStressScenarios.indexOf(scenario) != -1)
172 def static isGCStressRelatedTesting(def scenario) {
173 // The 'gcstress15_pri1r2r' scenario is a basic scenario.
174 // Detect it and make it a GCStress related.
175 if (scenario == 'gcstress15_pri1r2r')
180 def gcStressTestEnvVars = [ 'COMPlus_GCStress', 'COMPlus_ZapDisable', 'COMPlus_HeapVerify']
181 def scenarioName = scenario.toLowerCase()
182 def isGCStressTesting = false
183 Constants.jitStressModeScenarios[scenario].each{ k, v ->
184 if (k in gcStressTestEnvVars) {
185 isGCStressTesting = true;
188 return isGCStressTesting
191 def static isCorefxTesting(def scenario) {
192 def corefx_prefix = 'corefx_'
193 if (scenario.length() < corefx_prefix.length()) {
196 return scenario.substring(0,corefx_prefix.length()) == corefx_prefix
199 def static isR2R(def scenario) {
200 return (scenario == 'r2r' || scenario == 'pri1r2r')
203 def static isCoverage(def scenario) {
204 return (scenario == 'coverage')
207 def static isLongGc(def scenario) {
208 return (scenario == 'longgc' || scenario == 'gcsimulator')
211 def static isJitDiff(def scenario) {
212 return (scenario == 'jitdiff')
215 def static isGcReliabilityFramework(def scenario) {
216 return (scenario == 'gc_reliability_framework')
219 def static scenarioNeedsPri1Build(def scenario) {
220 return (scenario == 'pri1' || scenario == 'pri1r2r' || scenario == 'gcstress15_pri1r2r'|| scenario == 'coverage' || isGcReliabilityFramework(scenario))
223 def static setTestJobTimeOut(newJob, scenario) {
224 if (isGCStressRelatedTesting(scenario)) {
225 Utilities.setJobTimeout(newJob, 4320)
227 else if (isCorefxTesting(scenario)) {
228 Utilities.setJobTimeout(newJob, 360)
230 else if (Constants.jitStressModeScenarios.containsKey(scenario)) {
231 Utilities.setJobTimeout(newJob, 240)
233 else if (isR2R(scenario)) {
234 Utilities.setJobTimeout(newJob, 240)
236 else if (isCoverage(scenario)) {
237 Utilities.setJobTimeout(newJob, 1440)
239 else if (isLongGc(scenario)) {
240 Utilities.setJobTimeout(newJob, 1440)
242 else if (isJitDiff(scenario)) {
243 Utilities.setJobTimeout(newJob, 240)
245 else if (isGcReliabilityFramework(scenario)) {
246 Utilities.setJobTimeout(newJob, 1440)
248 // Non-test jobs use the default timeout value.
251 def static getJobFolder(def scenario) {
252 if (isJITStressJob(scenario)) {
255 if (scenario == 'illink') {
261 def static getStressModeDisplayName(def scenario) {
263 Constants.jitStressModeScenarios[scenario].each{ k, v ->
264 def prefixLength = 'COMPlus_'.length()
265 if (k.length() >= prefixLength) {
266 def modeName = k.substring(prefixLength, k.length())
267 displayStr += ' ' + modeName + '=' + v
273 def static getR2RStressModeDisplayName(def scenario) {
274 // Assume the scenario name is one from the r2rJitStressScenarios list, and remove its
276 def displayStr = scenario
277 def prefixLength = 'r2r_'.length()
278 if (displayStr.length() >= prefixLength) {
279 displayStr = displayStr.substring(prefixLength, displayStr.length())
284 // Generates the string for creating a file that sets environment variables
285 // that makes it possible to run stress modes. Writes the script to the file
286 // specified by the stepScriptLocation parameter.
287 def static genStressModeScriptStep(def os, def stressModeName, def stressModeVars, def stepScriptLocation) {
289 if (os == 'Windows_NT') {
290 stepScript += "echo Creating TestEnv Script for ${stressModeName}\r\n"
291 stepScript += "del ${stepScriptLocation}\r\n"
293 // Timeout in ms, default is 10 minutes. For stress
294 // modes up this to 30 minutes
295 def timeout = 1800000
298 stepScript += "set __TestTimeout=${timeout}\r\n"
299 stepScript += "echo. > ${stepScriptLocation}\r\n"
300 stressModeVars.each{ k, v ->
301 // Write out what we are writing to the script file
302 stepScript += "echo Setting ${k}=${v}\r\n"
303 // Write out the set itself to the script file`
304 stepScript += "echo set ${k}=${v} >> ${stepScriptLocation}\r\n"
308 stepScript += "echo Setting variables for ${stressModeName}\n"
309 stepScript += "echo \\#\\!/usr/bin/env bash > ${stepScriptLocation}\n"
310 stressModeVars.each{ k, v ->
311 // Write out what we are writing to the script file
312 stepScript += "echo Setting ${k}=${v}\n"
313 // Write out the set itself to the script file`
314 stepScript += "echo export ${k}=${v} >> ${stepScriptLocation}\n"
316 stepScript += "chmod +x ${stepScriptLocation}\n"
321 // Calculates the name of the build job based on some typical parameters.
323 def static getJobName(def configuration, def architecture, def os, def scenario, def isBuildOnly) {
324 // If the architecture is x64, do not add that info into the build name.
325 // Need to change around some systems and other builds to pick up the right builds
328 def suffix = scenario != 'default' ? "_${scenario}" : '';
333 switch (architecture) {
335 if (scenario == 'default') {
336 // For now we leave x64 off of the name for compatibility with other jobs
337 baseName = configuration.toLowerCase() + '_' + os.toLowerCase()
339 else if (scenario == 'formatting') {
340 // we don't care about the configuration for the formatting job. It runs all configs
341 baseName = architecture.toLowerCase() + '_' + os.toLowerCase()
344 baseName = architecture.toLowerCase() + '_' + configuration.toLowerCase() + '_' + os.toLowerCase()
348 if (os.toLowerCase() == "windows_nt") {
349 // These are cross builds
350 baseName = architecture.toLowerCase() + '_cross_' + configuration.toLowerCase() + '_' + os.toLowerCase()
353 // Defaults to a small page size set of machines.
354 baseName = architecture.toLowerCase() + '_' + configuration.toLowerCase() + '_' + "small_page_size"
358 // These are cross builds
361 baseName = 'armel_cross_' + configuration.toLowerCase() + '_' + os.toLowerCase()
364 baseName = architecture.toLowerCase() + '_cross_' + configuration.toLowerCase() + '_' + os.toLowerCase()
369 baseName = architecture.toLowerCase() + '_' + configuration.toLowerCase() + '_' + os.toLowerCase()
372 println("Unknown architecture: ${architecture}");
377 return baseName + suffix
380 def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def os, def configuration, def scenario, def isFlowJob, def isWindowsBuildOnlyJob, def bidailyCrossList) {
384 switch (architecture) {
388 if (architecture == 'x86' && os == 'Ubuntu') {
389 Utilities.addPeriodicTrigger(job, '@daily')
391 else if (isFlowJob || os == 'Windows_NT' || !(os in Constants.crossList)) {
392 Utilities.addGithubPushTrigger(job)
396 Utilities.addGithubPushTrigger(job)
399 Utilities.addGithubPushTrigger(job)
402 println("Unknown architecture: ${architecture}");
408 // Pri one gets a push trigger, and only for release
409 if (architecture == 'x64') {
410 if (configuration == 'Release') {
411 // We expect release jobs to be Windows, or in the cross list
412 assert (os == 'Windows_NT') || (os in Constants.crossList)
413 if (!os in bidailyCrossList) {
414 if (isFlowJob || os == 'Windows_NT') {
415 Utilities.addGithubPushTrigger(job)
420 Utilities.addPeriodicTrigger(job, 'H H/12 * * *')
427 //r2r jobs that aren't pri1 can only be triggered by phrase
430 assert !(os in bidailyCrossList)
431 //pri1 r2r gets a push trigger for checked/release
432 if (configuration == 'Checked' || configuration == 'Release') {
433 assert (os == 'Windows_NT') || (os in Constants.crossList)
434 if (architecture == 'x64' && os != 'OSX10.12') {
435 //Flow jobs should be Windows, Ubuntu, OSX0.12, or CentOS
436 if (isFlowJob || os == 'Windows_NT') {
437 Utilities.addGithubPushTrigger(job)
439 // OSX10.12 pri1r2r jobs should only run every 12 hours, not daily.
440 } else if (architecture == 'x64' && os == 'OSX10.12'){
442 Utilities.addPeriodicTrigger(job, 'H H/12 * * *')
445 // For x86, only add per-commit jobs for Windows
446 else if (architecture == 'x86' || architecture == 'x86lb') {
447 if (os == 'Windows_NT') {
448 Utilities.addGithubPushTrigger(job)
451 // arm64 pri1r2r jobs should only run every 12 hours.
452 else if (architecture == 'arm64') {
453 if (os == 'Windows_NT') {
454 Utilities.addPeriodicTrigger(job, 'H H/12 * * *')
455 // TODO: Add once external email sending is available again
456 // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
461 case 'r2r_jitstress1':
462 case 'r2r_jitstress2':
463 case 'r2r_jitstressregs1':
464 case 'r2r_jitstressregs2':
465 case 'r2r_jitstressregs3':
466 case 'r2r_jitstressregs4':
467 case 'r2r_jitstressregs8':
468 case 'r2r_jitstressregs0x10':
469 case 'r2r_jitstressregs0x80':
470 case 'r2r_jitstressregs0x1000':
471 case 'r2r_jitminopts':
472 case 'r2r_jitforcerelocs':
473 case 'gcstress15_pri1r2r':
474 assert !(os in bidailyCrossList)
476 // GCStress=C is currently not supported on OS X
477 if (os == 'OSX10.12' && isGCStressRelatedTesting(scenario)) {
481 //GC Stress 15 pri1 r2r gets a push trigger for checked/release
482 if (configuration == 'Checked' || configuration == 'Release') {
483 assert (os == 'Windows_NT') || (os in Constants.crossList)
484 if (architecture == 'x64') {
485 //Flow jobs should be Windows, Ubuntu, OSX10.12, or CentOS
486 if (isFlowJob || os == 'Windows_NT') {
487 // Add a weekly periodic trigger
488 Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
491 // For x86, only add per-commit jobs for Windows
492 else if (architecture == 'x86') {
493 if (os == 'Windows_NT') {
494 Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
500 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
501 assert configuration == 'Release'
502 assert architecture == 'x64'
503 Utilities.addPeriodicTrigger(job, '@daily')
504 // TODO: Add once external email sending is available again
505 // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
508 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
509 assert configuration == 'Release'
510 assert architecture == 'x64'
511 Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
512 // TODO: Add once external email sending is available again
513 // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
515 case 'standalone_gc':
516 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
517 assert (configuration == 'Release' || configuration == 'Checked')
518 // TODO: Add once external email sending is available again
519 // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
520 Utilities.addPeriodicTrigger(job, '@weekly')
522 case 'gc_reliability_framework':
523 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
524 assert (configuration == 'Release' || configuration == 'Checked')
525 // Only triggered by phrase.
528 assert !(os in bidailyCrossList)
529 // ILASM/ILDASM roundtrip one gets a daily build, and only for release
530 if (architecture == 'x64' && configuration == 'Release') {
531 // We don't expect to see a job generated except in these scenarios
532 assert (os == 'Windows_NT') || (os in Constants.crossList)
533 if (isFlowJob || os == 'Windows_NT') {
534 Utilities.addPeriodicTrigger(job, '@daily')
539 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
540 assert configuration == 'Checked'
541 assert (architecture == 'x64' || architecture == 'x86')
542 Utilities.addGithubPushTrigger(job)
545 assert (os == 'Ubuntu' || os == 'Windows_NT')
546 assert configuration == 'Release'
547 assert architecture == 'x64'
548 Utilities.addPeriodicTrigger(job, '@weekly')
551 assert (os == 'Windows_NT' || os == "Ubuntu")
552 assert architecture == 'x64'
553 Utilities.addGithubPushTrigger(job)
555 case 'jitstressregs1':
556 case 'jitstressregs2':
557 case 'jitstressregs3':
558 case 'jitstressregs4':
559 case 'jitstressregs8':
560 case 'jitstressregs0x10':
561 case 'jitstressregs0x80':
562 case 'jitstressregs0x1000':
567 case 'jitstress2_jitstressregs1':
568 case 'jitstress2_jitstressregs2':
569 case 'jitstress2_jitstressregs3':
570 case 'jitstress2_jitstressregs4':
571 case 'jitstress2_jitstressregs8':
572 case 'jitstress2_jitstressregs0x10':
573 case 'jitstress2_jitstressregs0x80':
574 case 'jitstress2_jitstressregs0x1000':
575 case 'tailcallstress':
577 case 'corefx_baseline':
578 case 'corefx_minopts':
579 case 'corefx_jitstress1':
580 case 'corefx_jitstress2':
581 case 'corefx_jitstressregs1':
582 case 'corefx_jitstressregs2':
583 case 'corefx_jitstressregs3':
584 case 'corefx_jitstressregs4':
585 case 'corefx_jitstressregs8':
586 case 'corefx_jitstressregs0x10':
587 case 'corefx_jitstressregs0x80':
588 case 'corefx_jitstressregs0x1000':
590 if (os != 'CentOS7.1' && !(os in bidailyCrossList)) {
591 assert (os == 'Windows_NT') || (os in Constants.crossList)
592 Utilities.addPeriodicTrigger(job, '@daily')
597 if (os != 'CentOS7.1' && !(os in bidailyCrossList)) {
598 assert (os == 'Windows_NT') || (os in Constants.crossList)
599 if (architecture == 'arm64') {
600 if (os == 'Windows_NT') {
601 Utilities.addPeriodicTrigger(job, '@daily')
603 // TODO: Add once external email sending is available again
604 // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
607 Utilities.addPeriodicTrigger(job, '@weekly')
612 case 'gcstress0xc_zapdisable':
613 case 'gcstress0xc_zapdisable_jitstress2':
614 case 'gcstress0xc_zapdisable_heapverify1':
615 case 'gcstress0xc_jitstress1':
616 case 'gcstress0xc_jitstress2':
617 case 'gcstress0xc_minopts_heapverify1':
618 // GCStress=C is currently not supported on OS X
619 if (os != 'CentOS7.1' && os != 'OSX10.12' && !(os in bidailyCrossList)) {
620 assert (os == 'Windows_NT') || (os in Constants.crossList)
621 if (architecture == 'arm64') {
622 // TODO: Enable a periodic trigger after tests are updated.
623 // Utilities.addPeriodicTrigger(job, '@daily')
624 // TODO: Add once external email sending is available again
625 // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
628 Utilities.addPeriodicTrigger(job, '@weekly')
634 // Testing on other operating systems TBD
635 assert (os == 'Windows_NT' || os == 'Ubuntu')
636 if (architecture == 'x64' || architecture == 'x86') {
637 if (configuration == 'Checked') {
638 Utilities.addPeriodicTrigger(job, '@daily')
644 println("Unknown scenario: ${scenario}");
651 // **************************
652 // Define the basic inner loop builds for PR and commit. This is basically just the set
653 // of coreclr builds over linux/osx 10.12/freebsd/windows and debug/release/checked. In addition, the windows
654 // builds will do a couple extra steps.
655 // **************************
657 // Adds a trigger for the PR build if one is needed. If isFlowJob is true, then this is the
658 // flow job that rolls up the build and test for non-windows OS's. // If the job is a windows build only job,
659 // it's just used for internal builds
660 // If you add a job with a trigger phrase, please add that phrase to coreclr/Documentation/project-docs/ci-trigger-phrases.md
661 def static addTriggers(def job, def branch, def isPR, def architecture, def os, def configuration, def scenario, def isFlowJob, def isWindowsBuildOnlyJob) {
662 if (isWindowsBuildOnlyJob) {
666 def bidailyCrossList = ['RHEL7.2', 'Debian8.4']
667 // Non pull request builds.
669 addNonPRTriggers(job, branch, isPR, architecture, os, configuration, scenario, isFlowJob, isWindowsBuildOnlyJob, bidailyCrossList)
699 // Pull request builds. Generally these fall into two categories: default triggers and on-demand triggers
700 // We generally only have a distinct set of default triggers but a bunch of on-demand ones.
701 def osGroup = getOSGroup(os)
702 switch (architecture) {
703 case 'x64': // editor brace matching: {
704 if (scenario == 'coverage') {
705 assert configuration == 'Release'
706 if (os == 'Ubuntu') {
707 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Coverage Build & Test", "(?i).*test\\W+coverage.*")
712 if (scenario == 'formatting') {
713 assert configuration == 'Checked'
714 if (os == 'Windows_NT' || os == 'Ubuntu') {
715 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Formatting")
721 // OpenSUSE, Debian & RedHat get trigger phrases for pri 0 build, and pri 1 build & test
724 if (scenario == 'default') {
726 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", "(?i).*test\\W+${os}.*")
728 else if (scenario == 'pri1' && isFlowJob) {
729 assert (configuration == 'Release')
730 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Pri 1 Build & Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
735 assert scenario == 'default'
736 // Distinguish with the other architectures (arm and x86)
737 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", "(?i).*test\\W+${os}\\W+${architecture}.*")
743 assert scenario == 'default'
744 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", "(?i).*test\\W+${os}\\W+.*")
747 if (scenario == 'illink') {
748 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
753 // Triggers on the non-flow jobs aren't necessary here
754 // Corefx testing uses non-flow jobs.
755 if (!isFlowJob && !isCorefxTesting(scenario)) {
760 // Ubuntu uses checked for default PR tests
761 if (configuration == 'Checked') {
763 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test")
767 if (configuration == 'Release') {
768 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
772 if (configuration == 'Checked') {
773 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Jit Diff Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
777 if (configuration == 'Release') {
778 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
782 if (configuration == 'Release' || configuration == 'Checked') {
783 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
787 if (configuration == 'Release' || configuration == 'Checked') {
788 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
791 case 'gcstress15_pri1r2r':
792 if (configuration == 'Release' || configuration == 'Checked') {
793 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
796 case 'r2r_jitstress1':
797 case 'r2r_jitstress2':
798 case 'r2r_jitstressregs1':
799 case 'r2r_jitstressregs2':
800 case 'r2r_jitstressregs3':
801 case 'r2r_jitstressregs4':
802 case 'r2r_jitstressregs8':
803 case 'r2r_jitstressregs0x10':
804 case 'r2r_jitstressregs0x80':
805 case 'r2r_jitstressregs0x1000':
806 case 'r2r_jitminopts':
807 case 'r2r_jitforcerelocs':
808 if (configuration == 'Release' || configuration == 'Checked') {
809 def displayStr = getR2RStressModeDisplayName(scenario)
810 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
814 if (configuration == 'Release') {
815 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
819 if (configuration == 'Release') {
820 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
823 case 'standalone_gc':
824 if (configuration == 'Release' || configuration == 'Checked') {
825 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
828 case 'gc_reliability_framework':
829 if (configuration == 'Release' || configuration == 'Checked') {
830 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Reliability Framework", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
837 case 'jitstressregs1':
838 case 'jitstressregs2':
839 case 'jitstressregs3':
840 case 'jitstressregs4':
841 case 'jitstressregs8':
842 case 'jitstressregs0x10':
843 case 'jitstressregs0x80':
844 case 'jitstressregs0x1000':
845 case 'jitstress2_jitstressregs1':
846 case 'jitstress2_jitstressregs2':
847 case 'jitstress2_jitstressregs3':
848 case 'jitstress2_jitstressregs4':
849 case 'jitstress2_jitstressregs8':
850 case 'jitstress2_jitstressregs0x10':
851 case 'jitstress2_jitstressregs0x80':
852 case 'jitstress2_jitstressregs0x1000':
853 case 'tailcallstress':
859 case 'gcstress0xc_zapdisable':
860 case 'gcstress0xc_zapdisable_jitstress2':
861 case 'gcstress0xc_zapdisable_heapverify1':
862 case 'gcstress0xc_jitstress1':
863 case 'gcstress0xc_jitstress2':
864 case 'gcstress0xc_minopts_heapverify1':
865 def displayStr = getStressModeDisplayName(scenario)
866 assert (os == 'Windows_NT') || (os in Constants.crossList)
867 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
868 "(?i).*test\\W+${os}\\W+${scenario}.*")
870 case 'corefx_baseline':
871 case 'corefx_minopts':
872 case 'corefx_jitstress1':
873 case 'corefx_jitstress2':
874 case 'corefx_jitstressregs1':
875 case 'corefx_jitstressregs2':
876 case 'corefx_jitstressregs3':
877 case 'corefx_jitstressregs4':
878 case 'corefx_jitstressregs8':
879 case 'corefx_jitstressregs0x10':
880 case 'corefx_jitstressregs0x80':
881 case 'corefx_jitstressregs0x1000':
882 def displayName = ('CoreFx ' + getStressModeDisplayName(scenario)).trim()
883 assert (os == 'Windows_NT') || (os in Constants.crossList)
884 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayName})",
885 "(?i).*test\\W+${os}\\W+${architecture}\\W+${scenario}.*")
888 println("Unknown scenario: ${scenario}");
896 if (configuration == 'Release') {
897 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
901 if (configuration == 'Checked' || configuration == 'Release') {
902 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
906 if (configuration == 'Checked' || configuration == 'Release') {
907 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
910 case 'gcstress15_pri1r2r':
911 if (configuration == 'Release' || configuration == 'Checked') {
912 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
915 case 'r2r_jitstress1':
916 case 'r2r_jitstress2':
917 case 'r2r_jitstressregs1':
918 case 'r2r_jitstressregs2':
919 case 'r2r_jitstressregs3':
920 case 'r2r_jitstressregs4':
921 case 'r2r_jitstressregs8':
922 case 'r2r_jitstressregs0x10':
923 case 'r2r_jitstressregs0x80':
924 case 'r2r_jitstressregs0x1000':
925 case 'r2r_jitminopts':
926 case 'r2r_jitforcerelocs':
927 if (configuration == 'Release' || configuration == 'Checked') {
928 def displayStr = getR2RStressModeDisplayName(scenario)
929 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
939 if (configuration == 'Debug') {
940 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test")
945 if (configuration == 'Release') {
946 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test")
950 if (configuration == 'Checked') {
951 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Jit Diff Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
955 if (configuration == 'Release') {
956 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
960 if (configuration == 'Checked' || configuration == 'Release') {
961 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
965 if (configuration == 'Checked' || configuration == 'Release') {
966 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
969 case 'gcstress15_pri1r2r':
970 if (configuration == 'Release' || configuration == 'Checked') {
971 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
974 case 'r2r_jitstress1':
975 case 'r2r_jitstress2':
976 case 'r2r_jitstressregs1':
977 case 'r2r_jitstressregs2':
978 case 'r2r_jitstressregs3':
979 case 'r2r_jitstressregs4':
980 case 'r2r_jitstressregs8':
981 case 'r2r_jitstressregs0x10':
982 case 'r2r_jitstressregs0x80':
983 case 'r2r_jitstressregs0x1000':
984 case 'r2r_jitminopts':
985 case 'r2r_jitforcerelocs':
986 if (configuration == 'Release' || configuration == 'Checked') {
987 def displayStr = getR2RStressModeDisplayName(scenario)
988 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
992 if (configuration == 'Release') {
993 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
997 if (configuration == 'Release') {
998 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1001 case 'standalone_gc':
1002 if (configuration == 'Release' || configuration == 'Checked') {
1003 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1006 case 'gc_reliability_framework':
1007 if (configuration == 'Release' || configuration == 'Checked') {
1008 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Reliability Framework", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1015 case 'jitstressregs1':
1016 case 'jitstressregs2':
1017 case 'jitstressregs3':
1018 case 'jitstressregs4':
1019 case 'jitstressregs8':
1020 case 'jitstressregs0x10':
1021 case 'jitstressregs0x80':
1022 case 'jitstressregs0x1000':
1023 case 'jitstress2_jitstressregs1':
1024 case 'jitstress2_jitstressregs2':
1025 case 'jitstress2_jitstressregs3':
1026 case 'jitstress2_jitstressregs4':
1027 case 'jitstress2_jitstressregs8':
1028 case 'jitstress2_jitstressregs0x10':
1029 case 'jitstress2_jitstressregs0x80':
1030 case 'jitstress2_jitstressregs0x1000':
1031 case 'tailcallstress':
1037 case 'gcstress0xc_zapdisable':
1038 case 'gcstress0xc_zapdisable_jitstress2':
1039 case 'gcstress0xc_zapdisable_heapverify1':
1040 case 'gcstress0xc_jitstress1':
1041 case 'gcstress0xc_jitstress2':
1042 case 'gcstress0xc_minopts_heapverify1':
1043 def displayStr = getStressModeDisplayName(scenario)
1044 assert (os == 'Windows_NT') || (os in Constants.crossList)
1045 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
1046 "(?i).*test\\W+${os}\\W+${scenario}.*")
1048 case 'corefx_baseline':
1049 case 'corefx_minopts':
1050 case 'corefx_jitstress1':
1051 case 'corefx_jitstress2':
1052 case 'corefx_jitstressregs1':
1053 case 'corefx_jitstressregs2':
1054 case 'corefx_jitstressregs3':
1055 case 'corefx_jitstressregs4':
1056 case 'corefx_jitstressregs8':
1057 case 'corefx_jitstressregs0x10':
1058 case 'corefx_jitstressregs0x80':
1059 case 'corefx_jitstressregs0x1000':
1060 def displayName = ('CoreFx ' + getStressModeDisplayName(scenario)).trim()
1061 assert (os == 'Windows_NT') || (os in Constants.crossList)
1062 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayName})",
1063 "(?i).*test\\W+${os}\\W+${architecture}\\W+${scenario}.*")
1066 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1069 println("Unknown scenario: ${scenario}");
1075 assert scenario == 'default'
1076 if (configuration == 'Checked') {
1077 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build")
1081 println("Unknown os: ${os}");
1086 // editor brace matching: }
1087 case 'arm': // editor brace matching: {
1091 assert scenario == 'default'
1092 if ((os == 'Ubuntu' && configuration == 'Release') || (os == 'Ubuntu16.04' && configuration == 'Debug')) {
1093 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build")
1096 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build", "(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
1100 architecture='armel'
1101 // Removing the regex will cause this to run on each PR.
1102 if (configuration == 'Release' || configuration == 'Debug') {
1103 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build")
1106 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build", "(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
1110 // Set up a private trigger
1111 def contextString = "${os} ${architecture} Cross ${configuration}"
1112 if (scenario != 'default')
1113 contextString += " ${scenario}"
1114 contextString += " Build"
1115 // Debug builds only.
1116 if (configuration != 'Debug') {
1117 contextString += " and Test"
1121 // For now only run Debug and Release build jobs on PR Trigger. Note this is not a private trigger.
1122 if (configuration == 'Debug' || configuration == 'Release')
1124 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString,
1125 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*", null, arm64Users)
1129 // Checked jobs will run on private trigger and run tests.
1130 Utilities.addDefaultPrivateGithubPRTriggerForBranch(job, branch, contextString, null, arm64Users)
1136 // Stress jobs will will run on private trigger and run tests.
1137 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString,
1138 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*", null, arm64Users)
1143 println("NYI os: ${os}");
1148 // editor brace matching: }
1149 case 'arm64': // editor brace matching: {
1150 assert (scenario == 'default') || (scenario == 'pri1r2r') || (scenario == 'gcstress0x3') || (scenario == 'gcstress0xc')
1152 // Set up a private trigger
1153 def contextString = "${os} ${architecture} Cross ${configuration}"
1154 if (scenario != 'default')
1155 contextString += " ${scenario}"
1156 contextString += " Build"
1157 // Debug builds only.
1158 if (configuration != 'Debug') {
1159 contextString += " and Test"
1167 if (configuration == 'Release') {
1168 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
1172 if (configuration == 'Checked' || configuration == 'Release') {
1173 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1177 if (configuration == 'Checked' || configuration == 'Release') {
1178 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1181 case 'gcstress15_pri1r2r':
1182 if (configuration == 'Release' || configuration == 'Checked') {
1183 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1186 case 'r2r_jitstress1':
1187 case 'r2r_jitstress2':
1188 case 'r2r_jitstressregs1':
1189 case 'r2r_jitstressregs2':
1190 case 'r2r_jitstressregs3':
1191 case 'r2r_jitstressregs4':
1192 case 'r2r_jitstressregs8':
1193 case 'r2r_jitstressregs0x10':
1194 case 'r2r_jitstressregs0x80':
1195 case 'r2r_jitstressregs0x1000':
1196 case 'r2r_jitminopts':
1197 case 'r2r_jitforcerelocs':
1198 if (configuration == 'Release' || configuration == 'Checked') {
1199 def displayStr = getR2RStressModeDisplayName(scenario)
1200 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1209 if (isFlowJob == true) {
1210 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration}", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*")
1213 // For now only run Debug jobs on PR Trigger.
1214 else if (configuration != 'Debug') {
1215 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString,
1216 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*", null, arm64Users)
1219 // Add "Checked Build And Test" and "Debug Build" to the above users' PRs since many of them
1220 // are at higher risk of ARM64-breaking changes.
1221 Utilities.addDefaultPrivateGithubPRTriggerForBranch(job, branch, contextString, null, arm64Users)
1227 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString,
1228 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*", null, arm64Users)
1233 println("NYI os: ${os}");
1238 // editor brace matching: }
1239 case 'x86': // editor brace matching: {
1240 assert ((os == 'Windows_NT') || ((os == 'Ubuntu') && (scenario == 'default')))
1241 if (os == 'Ubuntu') {
1242 // on-demand only for ubuntu x86
1243 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build",
1244 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*")
1249 if (configuration == 'Checked') {
1250 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test")
1252 else if (configuration == 'Release') {
1253 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test",
1254 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*")
1258 if (configuration == 'Release') {
1259 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test")
1263 if (configuration == 'Release') {
1264 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test",
1265 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1269 if (configuration == 'Checked' || configuration == 'Release') {
1270 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test",
1271 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1275 if (configuration == 'Checked' || configuration == 'Release') {
1276 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test",
1277 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1280 case 'gcstress15_pri1r2r':
1281 if (configuration == 'Release' || configuration == 'Checked') {
1282 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test",
1283 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1286 case 'r2r_jitstress1':
1287 case 'r2r_jitstress2':
1288 case 'r2r_jitstressregs1':
1289 case 'r2r_jitstressregs2':
1290 case 'r2r_jitstressregs3':
1291 case 'r2r_jitstressregs4':
1292 case 'r2r_jitstressregs8':
1293 case 'r2r_jitstressregs0x10':
1294 case 'r2r_jitstressregs0x80':
1295 case 'r2r_jitstressregs0x1000':
1296 case 'r2r_jitminopts':
1297 case 'r2r_jitforcerelocs':
1298 if (configuration == 'Release' || configuration == 'Checked') {
1299 def displayStr = getR2RStressModeDisplayName(scenario)
1300 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test",
1301 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1305 if (configuration == 'Release') {
1306 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test",
1307 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1311 if (configuration == 'Release') {
1312 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator",
1313 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1316 case 'standalone_gc':
1317 if (configuration == 'Release' || configuration == 'Checked') {
1318 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC",
1319 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1326 case 'jitstressregs1':
1327 case 'jitstressregs2':
1328 case 'jitstressregs3':
1329 case 'jitstressregs4':
1330 case 'jitstressregs8':
1331 case 'jitstressregs0x10':
1332 case 'jitstressregs0x80':
1333 case 'jitstressregs0x1000':
1334 case 'jitstress2_jitstressregs1':
1335 case 'jitstress2_jitstressregs2':
1336 case 'jitstress2_jitstressregs3':
1337 case 'jitstress2_jitstressregs4':
1338 case 'jitstress2_jitstressregs8':
1339 case 'jitstress2_jitstressregs0x10':
1340 case 'jitstress2_jitstressregs0x80':
1341 case 'jitstress2_jitstressregs0x1000':
1342 case 'tailcallstress':
1348 case 'gcstress0xc_zapdisable':
1349 case 'gcstress0xc_zapdisable_jitstress2':
1350 case 'gcstress0xc_zapdisable_heapverify1':
1351 case 'gcstress0xc_jitstress1':
1352 case 'gcstress0xc_jitstress2':
1353 case 'gcstress0xc_minopts_heapverify1':
1354 def displayStr = getStressModeDisplayName(scenario)
1355 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
1356 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1358 case 'corefx_baseline':
1359 case 'corefx_minopts':
1360 case 'corefx_jitstress1':
1361 case 'corefx_jitstress2':
1362 case 'corefx_jitstressregs1':
1363 case 'corefx_jitstressregs2':
1364 case 'corefx_jitstressregs3':
1365 case 'corefx_jitstressregs4':
1366 case 'corefx_jitstressregs8':
1367 case 'corefx_jitstressregs0x10':
1368 case 'corefx_jitstressregs0x80':
1369 case 'corefx_jitstressregs0x1000':
1370 def displayName = ('CoreFx ' + getStressModeDisplayName(scenario)).trim()
1371 assert (os == 'Windows_NT') || (os in Constants.crossList)
1372 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayName})",
1373 "(?i).*test\\W+${os}\\W+${architecture}\\W+${scenario}.*")
1376 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1379 println("Unknown scenario: ${os} ${architecture} ${scenario}");
1384 // editor brace matching: }
1385 case 'x86lb': // editor brace matching: {
1386 assert (os == 'Windows_NT')
1387 assert (scenario == 'default' || Constants.r2rJitStressScenarios.indexOf(scenario) !=1)
1390 def jit = 'legacy_backend'
1393 if (configuration == 'Checked') {
1394 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} Build and Test",
1395 "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}.*")
1399 println("Unknown scenario: ${os} ${arch} ${jit} ${scenario}");
1404 // editor brace matching: }
1406 println("Unknown architecture: ${architecture}");
1412 def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR, def architecture, def configuration, def os, def enableCorefxTesting, def isBuildOnly) {
1413 def buildCommands = [];
1414 def osGroup = getOSGroup(os)
1415 def lowerConfiguration = configuration.toLowerCase()
1417 // Calculate the build steps, archival, and xunit results
1419 case 'Windows_NT': // editor brace matching: {
1420 switch (architecture) {
1424 def arch = architecture
1426 if (architecture == 'x86lb') {
1430 if (scenario == 'illink') {
1431 buildCommands += "tests\\scripts\\build_illink.cmd clone ${arch}"
1434 if (Constants.jitStressModeScenarios.containsKey(scenario) ||
1435 scenario == 'default' ||
1436 scenario == 'r2r' ||
1437 scenario == 'jitdiff' ||
1438 scenario == 'ilrt' ||
1439 scenario == 'illink' ||
1440 Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
1441 buildOpts += enableCorefxTesting ? ' skiptests' : ''
1442 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${arch} ${buildOpts}"
1445 // For Pri 1 tests, we must shorten the output test binary path names.
1446 // if __TestIntermediateDir is already set, build-test.cmd will
1447 // output test binaries to that directory. If it is not set, the
1448 // binaries are sent to a default directory whose name is about
1449 // 35 characters long.
1451 else if (scenarioNeedsPri1Build(scenario)) {
1452 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${arch} ${buildOpts} -priority=1"
1454 else if (isLongGc(scenario)) {
1455 buildCommands += "build.cmd ${lowerConfiguration} ${arch} ${buildOpts} skiptests"
1456 buildCommands += "set __TestIntermediateDir=int&&build-test.cmd ${lowerConfiguration} ${arch}"
1458 else if (scenario == 'standalone_gc') {
1459 buildCommands += "build.cmd ${lowerConfiguration} ${arch} ${buildOpts} buildstandalonegc"
1461 else if (scenario == 'formatting') {
1462 buildCommands += "python -u tests\\scripts\\format.py -c %WORKSPACE% -o Windows_NT -a ${arch}"
1463 Utilities.addArchival(newJob, "format.patch", "", true, false)
1467 println("Unknown scenario: ${scenario}")
1471 // If we are running a stress mode, we should write out the set of key
1472 // value env pairs to a file at this point and then we'll pass that to runtest.cmd
1475 //If this is a crossgen build, pass 'crossgen' to runtest.cmd
1476 def crossgenStr = ''
1477 def runcrossgentestsStr = ''
1478 def runjitstressStr = ''
1479 def runjitstressregsStr = ''
1480 def runjitmioptsStr = ''
1481 def runjitforcerelocsStr = ''
1482 def runjitdisasmStr = ''
1483 def runilasmroundtripStr = ''
1484 def gcstressStr = ''
1485 def runtestArguments = ''
1486 def gcTestArguments = ''
1487 def illinkArguments = ''
1489 if (scenario == 'r2r' ||
1490 scenario == 'pri1r2r' ||
1491 scenario == 'gcstress15_pri1r2r' ||
1492 Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
1493 crossgenStr = 'crossgen'
1494 runcrossgentestsStr = 'runcrossgentests'
1496 if (scenario == 'r2r_jitstress1'){
1497 runjitstressStr = 'jitstress 1'
1499 else if (scenario == 'r2r_jitstress2') {
1500 runjitstressStr = 'jitstress 2'
1502 else if (scenario == 'r2r_jitstressregs1'){
1503 runjitstressregsStr = 'jitstressregs 1'
1505 else if (scenario == 'r2r_jitstressregs2') {
1506 runjitstressregsStr = 'jitstressregs 2'
1508 else if (scenario == 'r2r_jitstressregs3') {
1509 runjitstressregsStr = 'jitstressregs 3'
1511 else if (scenario == 'r2r_jitstressregs4') {
1512 runjitstressregsStr = 'jitstressregs 4'
1514 else if (scenario == 'r2r_jitstressregs8') {
1515 runjitstressregsStr = 'jitstressregs 8'
1517 else if (scenario == 'r2r_jitstressregs0x10') {
1518 runjitstressregsStr = 'jitstressregs 0x10'
1520 else if (scenario == 'r2r_jitstressregs0x80') {
1521 runjitstressregsStr = 'jitstressregs 0x80'
1523 else if (scenario == 'r2r_jitstressregs0x1000') {
1524 runjitstressregsStr = 'jitstressregs 0x1000'
1526 else if (scenario == 'r2r_jitminopts') {
1527 runjitmioptsStr = 'jitminopts'
1529 else if (scenario == 'r2r_jitforcerelocs') {
1530 runjitforcerelocsStr = 'jitforcerelocs'
1533 if (scenario == 'gcstress15_pri1r2r')
1535 gcstressStr = 'gcstresslevel 0xF'
1538 if (scenario == 'jitdiff')
1540 runjitdisasmStr = 'jitdisasm crossgen'
1543 if (scenario == 'ilrt')
1545 runilasmroundtripStr = 'ilasmroundtrip'
1548 if (isLongGc(scenario)) {
1549 gcTestArguments = "${scenario} sequential"
1552 if (scenario == 'illink')
1554 illinkArguments = "link %WORKSPACE%\\linker\\linker\\bin\\netcore_Release\\netcoreapp2.0\\win10-${arch}\\publish\\illink.exe"
1557 runtestArguments = "${lowerConfiguration} ${arch} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${runjitdisasmStr} ${runilasmroundtripStr} ${gcTestArguments} ${illinkArguments} collectdumps"
1559 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
1560 def stepScriptLocation = "%WORKSPACE%\\SetStressModes.bat"
1561 buildCommands += genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], stepScriptLocation)
1563 if (enableCorefxTesting) {
1564 def workspaceRelativeFxRoot = "_/fx"
1565 def absoluteFxRoot = "%WORKSPACE%\\_\\fx"
1567 buildCommands += "python -u %WORKSPACE%\\tests\\scripts\\run-corefx-tests.py -arch ${arch} -build_type ${configuration} -fx_root ${absoluteFxRoot} -fx_branch ${branch} -env_script ${stepScriptLocation}"
1569 setTestJobTimeOut(newJob, scenario)
1571 // Archive and process (only) the test results
1572 Utilities.addArchival(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1573 Utilities.addXUnitDotNETResults(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1576 buildCommands += "%WORKSPACE%\\tests\\runtest.cmd ${runtestArguments} TestEnv ${stepScriptLocation}"
1579 else if (isGcReliabilityFramework(scenario)) {
1580 buildCommands += "tests\\runtest.cmd ${runtestArguments} GenerateLayoutOnly"
1581 buildCommands += "tests\\scripts\\run-gc-reliability-framework.cmd ${arch} ${configuration}"
1583 else if (architecture == 'x64' || architecture == 'x86') {
1584 buildCommands += "tests\\runtest.cmd ${runtestArguments}"
1586 else if (architecture == 'x86lb') {
1587 buildCommands += "tests\\runtest.cmd ${runtestArguments} TestEnv %WORKSPACE%\\tests\\legacyjit_x86_testenv.cmd"
1591 if (!enableCorefxTesting) {
1592 // Run the rest of the build
1593 // Build the mscorlib for the other OS's
1594 buildCommands += "build.cmd ${lowerConfiguration} ${arch} linuxmscorlib"
1595 buildCommands += "build.cmd ${lowerConfiguration} ${arch} freebsdmscorlib"
1596 buildCommands += "build.cmd ${lowerConfiguration} ${arch} osxmscorlib"
1598 if (arch == "x64") {
1599 buildCommands += "build.cmd ${lowerConfiguration} arm64 linuxmscorlib"
1602 // Zip up the tests directory so that we don't use so much space/time copying
1603 // 10s of thousands of files around.
1604 buildCommands += "powershell -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${arch}.${configuration}', '.\\bin\\tests\\tests.zip')\"";
1606 if (!Constants.jitStressModeScenarios.containsKey(scenario)) {
1607 // For windows, pull full test results and test drops for x86/x64.
1608 // No need to pull for stress mode scenarios (downstream builds use the default scenario)
1609 Utilities.addArchival(newJob, "bin/Product/**,bin/tests/tests.zip", "bin/Product/**/.nuget/**")
1612 if (scenario == 'jitdiff') {
1613 // retrive jit-dasm output for base commit, and run jit-diff
1615 // if this is a build only job, we want to keep the default (build) artifacts for the flow job
1616 Utilities.addArchival(newJob, "bin/tests/${osGroup}.${arch}.${configuration}/dasm/**")
1621 Utilities.addXUnitDotNETResults(newJob, 'bin/**/TestRun*.xml', true)
1622 setTestJobTimeOut(newJob, scenario)
1627 assert (scenario == 'default') || (scenario == 'pri1r2r') || (scenario == 'gcstress0x3') || (scenario == 'gcstress0xc')
1630 setTestJobTimeOut(newJob, scenario)
1632 if ( lowerConfiguration == "debug" ) {
1633 // For Debug builds, we will do a P1 test build
1634 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} -priority=1"
1636 else if (lowerConfiguration == "checked") {
1638 if ((scenario != 'gcstress0x3') && (scenario != 'gcstress0xc'))
1640 // Up the timeout for arm checked testing only.
1641 // Keep the longer timeout for gcstress.
1642 Utilities.setJobTimeout(newJob, 240)
1645 def machineAffinityOptions = ['use_arm64_build_machine' : true]
1646 setMachineAffinity(newJob, os, architecture, machineAffinityOptions)
1647 // For checked runs we will also run testing.
1648 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} -priority=1"
1649 buildCommands += "python tests\\scripts\\arm64_post_build.py -repo_root %WORKSPACE% -arch ${architecture} -build_type ${lowerConfiguration} -scenario ${scenario} -key_location C:\\tools\\key.txt"
1651 else if (lowerConfiguration == "release") {
1652 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture}"
1655 Utilities.addArchival(newJob, "bin/Product/**", "bin/Product/**/.nuget/**")
1658 assert (scenario == 'default') || (scenario == 'pri1r2r') || (scenario == 'gcstress0x3') || (scenario == 'gcstress0xc')
1661 setTestJobTimeOut(newJob, scenario)
1663 // Debug runs take too long to run. So build job only.
1664 if (lowerConfiguration == "debug") {
1665 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} toolset_dir C:\\ats2"
1668 if ((scenario != 'gcstress0x3') && (scenario != 'gcstress0xc'))
1670 // Up the timeout for arm64 checked testing only.
1671 // Keep the longer timeout for gcstress.
1672 Utilities.setJobTimeout(newJob, 240)
1675 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} toolset_dir C:\\ats2 -priority=1"
1676 // Test build and run are launched together.
1677 buildCommands += "python tests\\scripts\\arm64_post_build.py -repo_root %WORKSPACE% -arch ${architecture} -build_type ${lowerConfiguration} -scenario ${scenario} -key_location C:\\tools\\key.txt"
1678 //Utilities.addXUnitDotNETResults(newJob, 'bin/tests/testResults.xml')
1682 Utilities.addArchival(newJob, "bin/Product/**", "bin/Product/**/.nuget/**")
1685 println("Unknown architecture: ${architecture}");
1690 // editor brace matching: }
1699 case 'OpenSUSE42.1':
1701 case 'Fedora24': // editor brace matching: {
1702 switch (architecture) {
1705 if (architecture == 'x86' && os == 'Ubuntu') {
1706 // build and PAL test
1707 buildCommands += "./tests/scripts/x86_ci_script.sh --buildConfig=${lowerConfiguration}"
1708 Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
1712 if (scenario == 'formatting') {
1713 buildCommands += "python tests/scripts/format.py -c \${WORKSPACE} -o Linux -a ${architecture}"
1714 Utilities.addArchival(newJob, "format.patch", "", true, false)
1718 if (scenario == 'illink') {
1719 assert(os == 'Ubuntu')
1720 buildCommands += "./tests/scripts/build_illink.sh --clone --arch=${architecture}"
1723 def standaloneGc = ''
1724 if (scenario == 'standalone_gc') {
1725 standaloneGc = 'buildstandalonegc'
1728 if (!enableCorefxTesting) {
1729 // We run pal tests on all OS but generate mscorlib (and thus, nuget packages)
1730 // only on supported OS platforms.
1731 if (os == 'FreeBSD')
1733 buildCommands += "./build.sh skipmscorlib verbose ${lowerConfiguration} ${architecture} ${standaloneGc}"
1737 def bootstrapRid = Utilities.getBoostrapPublishRid(os)
1738 def bootstrapRidEnv = bootstrapRid != null ? "__PUBLISH_RID=${bootstrapRid} " : ''
1739 buildCommands += "${bootstrapRidEnv}./build.sh verbose ${lowerConfiguration} ${architecture} ${standaloneGc}"
1741 buildCommands += "src/pal/tests/palsuite/runpaltests.sh \${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration} \${WORKSPACE}/bin/paltestout"
1744 setTestJobTimeOut(newJob, scenario)
1745 // Basic archiving of the build
1746 Utilities.addArchival(newJob, "bin/Product/**,bin/obj/*/tests/**/*.dylib,bin/obj/*/tests/**/*.so", "bin/Product/**/.nuget/**")
1748 Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
1751 // Corefx stress testing
1752 assert os == 'Ubuntu'
1753 assert architecture == 'x64'
1754 assert lowerConfiguration == 'checked'
1755 assert Constants.jitStressModeScenarios.containsKey(scenario)
1758 buildCommands += "./build.sh verbose ${lowerConfiguration} ${architecture}"
1760 def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
1761 buildCommands += genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], scriptFileName)
1763 // Build and text corefx
1764 def workspaceRelativeFxRoot = "_/fx"
1765 def absoluteFxRoot = "\$WORKSPACE/${workspaceRelativeFxRoot}"
1767 buildCommands += "python -u \$WORKSPACE/tests/scripts/run-corefx-tests.py -arch ${architecture} -build_type ${configuration} -fx_root ${absoluteFxRoot} -fx_branch ${branch} -env_script ${scriptFileName}"
1769 setTestJobTimeOut(newJob, scenario)
1771 // Archive and process (only) the test results
1772 Utilities.addArchival(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1773 Utilities.addXUnitDotNETResults(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1777 def standaloneGc = ''
1778 if (scenario == 'standalone_gc') {
1779 standaloneGc = 'buildstandalonegc'
1782 if (!enableCorefxTesting) {
1783 buildCommands += "ROOTFS_DIR=/opt/arm64-xenial-rootfs ./build.sh skipmscorlib verbose ${lowerConfiguration} ${architecture} cross clang3.8 skipnuget ${standaloneGc}"
1785 // HACK -- Arm64 does not have corefx jobs yet.
1786 buildCommands += "git clone https://github.com/dotnet/corefx fx"
1787 buildCommands += "ROOTFS_DIR=/opt/arm64-xenial-rootfs-corefx ./fx/build-native.sh -release -buildArch=arm64 -- verbose cross clang3.8"
1788 buildCommands += "mkdir ./bin/Product/Linux.arm64.${configuration}/corefxNative"
1789 buildCommands += "cp fx/bin/Linux.arm64.Release/native/* ./bin/Product/Linux.arm64.${configuration}/corefxNative"
1792 setTestJobTimeOut(newJob, scenario)
1793 // Basic archiving of the build
1794 Utilities.addArchival(newJob, "bin/Product/**,bin/obj/*/tests/**/*.dylib,bin/obj/*/tests/**/*.so", "bin/Product/**/.nuget/**")
1798 // Cross builds for ARM runs on Ubuntu, Ubuntu16.04 and Tizen currently
1799 assert (os == 'Ubuntu') || (os == 'Ubuntu16.04') || (os == 'Tizen')
1801 // default values for Ubuntu
1803 def linuxCodeName="trusty"
1804 if (os == 'Ubuntu16.04') {
1805 linuxCodeName="xenial"
1807 else if (os == 'Tizen') {
1809 linuxCodeName="tizen"
1812 // Unzip the Windows test binaries first. Exit with 0
1813 buildCommands += "unzip -q -o ./bin/tests/tests.zip -d ./bin/tests/Windows_NT.x64.${configuration} || exit 0"
1815 // Unpack the corefx binaries
1816 buildCommands += "mkdir ./bin/CoreFxBinDir"
1817 buildCommands += "tar -xf ./bin/build.tar.gz -C ./bin/CoreFxBinDir"
1818 if (os != 'Tizen') {
1819 buildCommands += "chmod a+x ./bin/CoreFxBinDir/corerun"
1821 // Test environment emulation using docker and qemu has some problem to use lttng library.
1822 // We should remove libcoreclrtraceptprovider.so to avoid test hang.
1823 if (os == 'Ubuntu') {
1824 buildCommands += "rm -f -v ./bin/CoreFxBinDir/libcoreclrtraceptprovider.so"
1827 // Call the ARM CI script to cross build and test using docker
1828 buildCommands += """./tests/scripts/arm32_ci_script.sh \\
1831 --linuxCodeName=${linuxCodeName} \\
1832 --buildConfig=${lowerConfiguration} \\
1833 --testRootDir=./bin/tests/Windows_NT.x64.${configuration} \\
1834 --coreFxBinDir=./bin/CoreFxBinDir \\
1835 --testDirFile=./tests/testsRunningInsideARM.txt"""
1837 // Basic archiving of the build, no pal tests
1838 Utilities.addArchival(newJob, "bin/Product/**", "bin/Product/**/.nuget/**")
1841 println("Unknown architecture: ${architecture}");
1846 // editor brace matching: }
1848 println("Unknown os: ${os}");
1853 return buildCommands
1856 // Additional scenario which can alter behavior
1858 def combinedScenarios = Constants.basicScenarios + Constants.jitStressModeScenarios.keySet()
1859 combinedScenarios.each { scenario ->
1860 [true, false].each { isPR ->
1861 Constants.architectureList.each { architecture ->
1862 Constants.configurationList.each { configuration ->
1863 Constants.osList.each { os ->
1864 // If the OS is Windows_NT_BuildOnly, set the isBuildOnly flag to true
1865 // and reset the os to Windows_NT
1866 def isBuildOnly = false
1867 if (os == 'Windows_NT_BuildOnly') {
1872 // Tizen is only supported for arm architecture
1873 if (os == 'Tizen' && architecture != 'arm') {
1877 // Skip totally unimplemented (in CI) configurations.
1878 switch (architecture) {
1880 if (os == 'Ubuntu16.04') {
1884 // Windows and Ubuntu only
1885 if ((os != 'Windows_NT' && os != 'Ubuntu') || isBuildOnly) {
1890 if ((os != 'Ubuntu') && (os != 'Ubuntu16.04') && (os != 'Tizen') && (os != 'Windows_NT')) {
1895 if ((os != 'Ubuntu') && (os != 'Windows_NT')) {
1900 if (os != 'Windows_NT') {
1905 // Everything implemented
1908 println("Unknown architecture: ${architecture}")
1913 // Skip scenarios (blanket skipping for jit stress modes, which are good most everywhere
1914 // with checked builds
1915 def enableCorefxTesting = false
1916 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
1917 if (configuration != 'Checked') {
1921 enableCorefxTesting = isCorefxTesting(scenario)
1923 // Since these are just execution time differences,
1924 // skip platforms that don't execute the tests here (Windows_NT only)
1925 def isEnabledOS = (os == 'Windows_NT') || (os == 'Ubuntu' && enableCorefxTesting)
1926 if (!isEnabledOS || isBuildOnly) {
1930 switch (architecture) {
1933 if ((scenario != 'gcstress0x3') && (scenario != 'gcstress0xc')) {
1939 // x86 ubuntu: default only
1940 if ((os == 'Ubuntu') && (architecture == 'x86')) {
1943 // Windows: Everything implemented
1946 // No stress modes for legacy jit.
1947 // (There's no technical reason we couldn't allow these.)
1954 // If this is a r2r jitstress, jitstressregs, jitminopts, or forcerelocs scenario
1955 // and configuration is not Checked, bail out.
1956 if (configuration != 'Checked' && Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
1963 // The pri1 build isn't necessary except for Windows_NT. Non-Windows NT uses
1964 // the default scenario build
1965 if (os != 'Windows_NT') {
1969 if (architecture != 'x64') {
1974 // The ilrt build isn't necessary except for Windows_NT2003. Non-Windows NT uses
1975 // the default scenario build
1976 if (os != 'Windows_NT') {
1980 if (architecture != 'x64') {
1984 if (configuration != 'Release') {
1989 if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
1992 if (architecture != 'x64') {
1995 if (configuration != 'Checked') {
2000 // The r2r build isn't necessary except for Windows_NT. Non-Windows NT uses
2001 // the default scenario build
2002 if (os != 'Windows_NT') {
2005 if (architecture != 'x64') {
2010 // The pri1r2r build isn't necessary except for Windows_NT. Non-Windows NT uses
2011 // the default scenario build
2012 if (os != 'Windows_NT') {
2015 if (architecture != 'x64') {
2016 if ((architecture != 'arm64' && architecture != 'arm') || (configuration == 'Debug')) {
2021 case 'gcstress15_pri1r2r':
2022 case 'r2r_jitstress1':
2023 case 'r2r_jitstress2':
2024 case 'r2r_jitstressregs1':
2025 case 'r2r_jitstressregs2':
2026 case 'r2r_jitstressregs3':
2027 case 'r2r_jitstressregs4':
2028 case 'r2r_jitstressregs8':
2029 case 'r2r_jitstressregs0x10':
2030 case 'r2r_jitstressregs0x80':
2031 case 'r2r_jitstressregs0x1000':
2032 case 'r2r_jitminopts':
2033 case 'r2r_jitforcerelocs':
2034 // The above builds are not necessary except for Windows_NT. Non-Windows NT uses
2035 // the default scenario build
2036 if (os != 'Windows_NT') {
2039 if (architecture != 'x64' && architecture != 'x86') {
2045 if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
2048 if (architecture != 'x64') {
2051 if (configuration != 'Release') {
2055 case 'gc_reliability_framework':
2056 case 'standalone_gc':
2057 if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
2061 if (architecture != 'x64') {
2065 if (configuration != 'Release' && configuration != 'Checked') {
2069 // We need Windows x64 Release bits for the code coverage build
2071 if (os != 'Windows_NT') {
2074 if (architecture != 'x64') {
2077 if (configuration != 'Release') {
2081 // We only run Windows and Ubuntu x64 Checked for formatting right now
2083 if (os != 'Windows_NT' && os != 'Ubuntu') {
2086 if (architecture != 'x64') {
2089 if (configuration != 'Checked') {
2097 if (os != 'Windows_NT' && (os != 'Ubuntu' || architecture != 'x64')) {
2100 if (architecture != 'x64' && architecture != 'x86') {
2111 println("Unknown scenario: ${scenario}")
2118 def lowerConfiguration = configuration.toLowerCase()
2119 def jobName = getJobName(configuration, architecture, os, scenario, isBuildOnly)
2120 def folderName = getJobFolder(scenario)
2122 // Create the new job
2123 def newJob = job(Utilities.getFullJobName(project, jobName, isPR, folderName)) {}
2125 def machineAffinityOptions = architecture == 'arm64' ? ['is_build_only': true] : null
2126 machineAffinityOptions = architecture == 'arm' ? ['use_arm64_build_machine': false] : machineAffinityOptions
2127 setMachineAffinity(newJob, os, architecture, machineAffinityOptions)
2129 // Add all the standard options
2130 Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
2131 addTriggers(newJob, branch, isPR, architecture, os, configuration, scenario, false, isBuildOnly)
2133 def buildCommands = calculateBuildCommands(newJob, scenario, branch, isPR, architecture, configuration, os, enableCorefxTesting, isBuildOnly)
2134 def osGroup = getOSGroup(os)
2138 if (os == 'Windows_NT') {
2139 buildCommands.each { buildCommand ->
2140 batchFile(buildCommand)
2144 // Setup corefx and Windows test binaries for Linux cross build for ubuntu-arm, ubuntu16.04-arm and tizen-armel
2145 if ( architecture == 'arm' && ( os == 'Ubuntu' || os == 'Ubuntu16.04' || os == 'Tizen')) {
2146 // Cross build for ubuntu-arm, ubuntu16.04-arm and tizen-armel
2147 // Define the Windows Tests and Corefx build job names
2148 def WindowTestsName = projectFolder + '/' +
2149 Utilities.getFullJobName(project,
2150 getJobName(lowerConfiguration,
2156 def corefxFolder = Utilities.getFolderName('dotnet/corefx') + '/' +
2157 Utilities.getFolderName(branch)
2159 // Copy the Windows test binaries and the Corefx build binaries
2160 copyArtifacts(WindowTestsName) {
2161 includePatterns('bin/tests/tests.zip')
2163 latestSuccessful(true)
2168 def corefx_os = 'linux'
2169 if (os == 'Tizen') {
2174 // Let's use release CoreFX to test checked CoreCLR,
2175 // because we do not generate checked CoreFX in CoreFX CI yet.
2176 def corefx_lowerConfiguration = lowerConfiguration
2177 if ( lowerConfiguration == 'checked' ) {
2178 corefx_lowerConfiguration='release'
2181 copyArtifacts("${corefxFolder}/${corefx_os}_${arm_abi}_cross_${corefx_lowerConfiguration}") {
2182 includePatterns('bin/build.tar.gz')
2184 latestSuccessful(true)
2189 buildCommands.each { buildCommand ->
2203 // Create the Linux/OSX/CentOS coreclr test leg for debug and release and each scenario
2204 combinedScenarios.each { scenario ->
2205 [true, false].each { isPR ->
2206 // Architectures. x64 only at this point
2207 ['x64', 'arm64'].each { architecture ->
2208 // Put the OS's supported for coreclr cross testing here
2209 Constants.crossList.each { os ->
2210 if (architecture == 'arm64') {
2211 if (os != "Ubuntu") {
2216 Constants.configurationList.each { configuration ->
2218 if (architecture == 'arm64') {
2219 if (scenario != 'default' && scenario != 'pri1r2r' && scenario != 'gcstress0x3' && scenario != 'gcstress0xc') {
2224 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
2225 if (configuration != 'Checked') {
2228 if (isCorefxTesting(scenario)) {
2231 //Skip stress modes for these scenarios
2232 if (os == 'RHEL7.2' || os == 'Debian8.4') {
2236 // If this is a r2r jitstress, jitstressregs, jitminopts or forcerelocs scenario
2237 // and configuration is not Checked, bail out.
2238 else if (configuration != 'Checked' && Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
2241 // For CentOS, we only want Checked/Release pri1 builds.
2242 else if (os == 'CentOS7.1') {
2243 if (scenario != 'pri1' &&
2244 scenario != 'r2r' &&
2245 scenario != 'pri1r2r' &&
2246 scenario != 'gcstress15_pri1r2r' &&
2247 Constants.r2rJitStressScenarios.indexOf(scenario) == -1) {
2250 if (configuration != 'Checked' && configuration != 'Release') {
2254 // For RedHat and Debian, we only do Release pri1 builds.
2255 else if (os == 'RHEL7.2' || os == 'Debian8.4') {
2256 if (scenario != 'pri1') {
2259 if (configuration != 'Release') {
2271 if (configuration != 'Release') {
2276 if (configuration != 'Checked') {
2280 //Skip configs that aren't Checked or Release (so just Debug, for now)
2281 if (configuration != 'Checked' && configuration != 'Release') {
2286 //Skip configs that aren't Checked or Release (so just Debug, for now)
2287 if (configuration != 'Checked' && configuration != 'Release') {
2291 case 'gcstress15_pri1r2r':
2292 case 'r2r_jitstress1':
2293 case 'r2r_jitstress2':
2294 case 'r2r_jitstressregs1':
2295 case 'r2r_jitstressregs2':
2296 case 'r2r_jitstressregs3':
2297 case 'r2r_jitstressregs4':
2298 case 'r2r_jitstressregs8':
2299 case 'r2r_jitstressregs0x10':
2300 case 'r2r_jitstressregs0x80':
2301 case 'r2r_jitstressregs0x1000':
2302 case 'r2r_jitminopts':
2303 case 'r2r_jitforcerelocs':
2304 //Skip configs that aren't Checked or Release (so just Debug, for now)
2305 if (configuration != 'Checked' && configuration != 'Release') {
2311 // Long GC tests take a long time on non-Release builds
2312 if (configuration != 'Release') {
2316 case 'gc_reliability_framework':
2317 case 'standalone_gc':
2318 if (configuration != 'Release' && configuration != 'Checked') {
2323 //We only want Ubuntu Release for coverage
2324 if (os != 'Ubuntu') {
2327 if (configuration != 'Release') {
2333 if (os != 'Windows_NT' && os != 'Ubuntu') {
2341 println("Unknown scenario: ${scenario}")
2347 def lowerConfiguration = configuration.toLowerCase()
2348 def osGroup = getOSGroup(os)
2349 def jobName = getJobName(configuration, architecture, os, scenario, false) + "_tst"
2351 // Unless this is a coverage test run, we want to copy over the default build of coreclr.
2352 def inputScenario = 'default'
2353 if (scenario == 'coverage') {
2354 inputScenario = 'coverage'
2356 def inputCoreCLRBuildName = projectFolder + '/' +
2357 Utilities.getFullJobName(project, getJobName(configuration, architecture, os, inputScenario, false), isPR)
2358 // If this is a stress scenario, there isn't any difference in the build job
2359 // so we didn't create a build only job for windows_nt specific to that stress mode. Just copy
2360 // from the default scenario
2361 def testBuildScenario = scenario
2362 if (scenarioNeedsPri1Build(scenario)) {
2363 testBuildScenario = 'pri1'
2365 else if ( testBuildScenario == 'r2r' || Constants.r2rJitStressScenarios.indexOf(testBuildScenario) != -1 || isLongGc(testBuildScenario)) {
2366 testBuildScenario = 'default'
2368 def inputWindowTestsBuildName = ''
2369 def inputWindowsTestBuildArch = architecture
2370 if (architecture == "arm64") {
2371 // Use the x64 test build for arm64 unix
2372 inputWindowsTestBuildArch = "x64"
2374 if (Constants.jitStressModeScenarios.containsKey(testBuildScenario)) {
2375 inputWindowTestsBuildName = projectFolder + '/' +
2376 Utilities.getFullJobName(project, getJobName(configuration, inputWindowsTestBuildArch, 'windows_nt', 'default', true), isPR)
2379 inputWindowTestsBuildName = projectFolder + '/' +
2380 Utilities.getFullJobName(project, getJobName(configuration, inputWindowsTestBuildArch, 'windows_nt', testBuildScenario, true), isPR)
2382 // Enable Server GC for Ubuntu PR builds
2383 def serverGCString = ''
2385 // Whether or not this test run should be run sequentially instead
2386 // of in parallel. Only used for long GC tests.
2387 def sequentialString = ''
2389 // Whether or not this test run should run a specific playlist.
2390 // Only used for long GC tests.
2392 // A note - runtest.sh does have "--long-gc" and "--gcsimulator" options
2393 // for running long GC and GCSimulator tests, respectively. We don't use them
2394 // here because using a playlist file produces much more readable output on the CI machines
2395 // and reduces running time.
2396 def playlistString = ''
2398 if (os == 'Ubuntu' && isPR){
2399 serverGCString = '--useServerGC'
2402 // pass --crossgen to runtest.sh for crossgen builds
2403 def crossgenStr = ''
2404 def runcrossgentestsStr = ''
2405 def runjitstressStr = ''
2406 def runjitstressregsStr = ''
2407 def runjitmioptsStr = ''
2408 def runjitforcerelocsStr = ''
2409 def runjitdisasmStr = ''
2410 def runilasmroundtripStr = ''
2411 def gcstressStr = ''
2413 def layoutOnlyStr =''
2415 if (scenario == 'r2r' ||
2416 scenario == 'pri1r2r' ||
2417 scenario == 'gcstress15_pri1r2r' ||
2418 Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
2419 crossgenStr = '--crossgen'
2420 runcrossgentestsStr = '--runcrossgentests'
2422 if (scenario == 'r2r_jitstress1'){
2423 runjitstressStr = '--jitstress=1'
2425 else if (scenario == 'r2r_jitstress2') {
2426 runjitstressStr = '--jitstress=2'
2428 else if (scenario == 'r2r_jitstressregs1'){
2429 runjitstressregsStr = '--jitstressregs=1'
2431 else if (scenario == 'r2r_jitstressregs2') {
2432 runjitstressregsStr = '--jitstressregs=2'
2434 else if (scenario == 'r2r_jitstressregs3') {
2435 runjitstressregsStr = '--jitstressregs=3'
2437 else if (scenario == 'r2r_jitstressregs4') {
2438 runjitstressregsStr = '--jitstressregs=4'
2440 else if (scenario == 'r2r_jitstressregs8') {
2441 runjitstressregsStr = '--jitstressregs=8'
2443 else if (scenario == 'r2r_jitstressregs0x10') {
2444 runjitstressregsStr = '--jitstressregs=0x10'
2446 else if (scenario == 'r2r_jitstressregs0x80') {
2447 runjitstressregsStr = '--jitstressregs=0x80'
2449 else if (scenario == 'r2r_jitstressregs0x1000') {
2450 runjitstressregsStr = '--jitstressregs=0x1000'
2452 else if (scenario == 'r2r_jitminopts') {
2453 runjitmioptsStr = '--jitminopts'
2455 else if (scenario == 'r2r_jitforcerelocs') {
2456 runjitforcerelocsStr = '--jitforcerelocs'
2459 if (scenario == 'gcstress15_pri1r2r')
2461 gcstressStr = '--gcstresslevel=0xF'
2464 if (scenario == 'jitdiff')
2466 runjitdisasmStr = '--jitdisasm --crossgen'
2469 if (scenario == 'illink')
2471 illinkStr = '--link=\$WORKSPACE/linker/linker/bin/netcore_Release/netcoreapp2.0/ubuntu-x64/publish/illink'
2474 if (isLongGc(scenario)) {
2475 // Long GC tests behave very poorly when they are not
2476 // the only test running (many of them allocate until OOM).
2477 sequentialString = '--sequential'
2479 // The Long GC playlist contains all of the tests that are
2480 // going to be run. The GCSimulator playlist contains all of
2481 // the GC simulator tests.
2482 if (scenario == 'longgc') {
2483 playlistString = '--long-gc --playlist=./tests/longRunningGcTests.txt'
2485 else if (scenario == 'gcsimulator') {
2486 playlistString = '--gcsimulator --playlist=./tests/gcSimulatorTests.txt'
2490 if (isGcReliabilityFramework(scenario)) {
2491 layoutOnlyStr = '--build-overlay-only'
2494 def folder = getJobFolder(scenario)
2495 def newJob = job(Utilities.getFullJobName(project, jobName, isPR, folder)) {
2496 // Add parameters for the inputs
2499 stringParam('CORECLR_WINDOWS_BUILD', '', 'Build number to copy CoreCLR windows test binaries from')
2500 stringParam('CORECLR_BUILD', '', "Build number to copy CoreCLR ${osGroup} binaries from")
2504 // Set up the copies
2506 // Coreclr build containing the tests and mscorlib
2508 copyArtifacts(inputWindowTestsBuildName) {
2509 excludePatterns('**/testResults.xml', '**/*.ni.dll')
2511 buildNumber('${CORECLR_WINDOWS_BUILD}')
2515 if (scenario == 'coverage') {
2517 // Move coreclr to clr directory
2518 shell("rm -rf .clr; mkdir .clr; mv * .clr; mv .git .clr; mv .clr clr")
2521 shell("./clr/build.sh coverage verbose ${lowerConfiguration} ${architecture}")
2523 // Remove folders from obj that we don't expect to be covered. May update this later.
2524 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/ToolBox")
2525 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/debug")
2526 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/ilasm")
2527 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/ildasm")
2528 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/dlls/dbgshim")
2529 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/dlls/mscordac")
2530 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/dlls/mscordbi")
2533 shell("./clr/src/pal/tests/palsuite/runpaltests.sh \$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration} \$(pwd)/clr/bin/paltestout")
2535 // Remove obj files for PAL tests so they're not included in coverage results
2536 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/pal/tests")
2538 // Unzip the tests first. Exit with 0
2539 shell("unzip -q -o ./clr/bin/tests/tests.zip -d ./clr/bin/tests/Windows_NT.${architecture}.${configuration} || exit 0")
2542 shell("git clone https://github.com/dotnet/corefx fx")
2544 // Build Linux corefx
2545 shell("./fx/build-native.sh -release -buildArch=x64 -os=Linux")
2546 shell("./fx/build-managed.sh -release -buildArch=x64 -osgroup=Linux -skiptests")
2549 def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
2550 def createScriptCmds = genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios['heapverify1'], scriptFileName)
2551 shell("${createScriptCmds}")
2552 testEnvOpt = "--test-env=" + scriptFileName
2555 shell("""./fx/run-test.sh \\
2556 --coreclr-bins \$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration} \\
2557 --mscorlib-bins \$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration} \\
2558 --corefx-tests \$(pwd)/fx/bin/tests/${osGroup}.AnyCPU.${configuration} \\
2559 --corefx-native-bins \$(pwd)/fx/bin/${osGroup}.${architecture}.${configuration} \\
2560 --configurationGroup Release""")
2563 // Run coreclr tests w/ workstation GC
2564 shell("""./clr/tests/runtest.sh \\
2565 --testRootDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2566 --testNativeBinDir=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2567 --coreClrBinDir=\"\$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2568 --mscorlibDir=\"\$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2569 --coreFxBinDir=\"\$(pwd)/fx/bin/runtime/netcoreapp-${osGroup}-Release-${architecture}\" \\
2570 --crossgen --runcrossgentests""")
2572 // Run coreclr tests w/ server GC & HeapVerify enabled
2573 shell("""./clr/tests/runtest.sh \\
2574 --testRootDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2575 --testNativeBinDir=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2576 --coreOverlayDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}/Tests/coreoverlay\" \\
2577 --useServerGC ${testEnvOpt}""")
2579 // Run long-running coreclr GC tests & produce coverage reports
2580 shell("""./clr/tests/runtest.sh \\
2581 --testRootDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2582 --testNativeBinDir=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2583 --coreOverlayDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}/Tests/coreoverlay\" \\
2584 --long-gc --playlist=\"\$(pwd)/clr/tests/longRunningGcTests.txt\" --coreclr-coverage\\
2585 --coreclr-objs=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}\" \\
2586 --coreclr-src=\"\$(pwd)/clr/src\" \\
2587 --coverage-output-dir=\"\${WORKSPACE}/coverage\" """)
2592 // Coreclr build we are trying to test
2594 copyArtifacts(inputCoreCLRBuildName) {
2595 excludePatterns('**/testResults.xml', '**/*.ni.dll')
2597 buildNumber('${CORECLR_BUILD}')
2601 def corefxFolder = Utilities.getFolderName('dotnet/corefx') + '/' + Utilities.getFolderName(branch)
2603 // Corefx components. We now have full stack builds on all distros we test here, so we can copy straight from CoreFX jobs.
2605 if (os == 'Ubuntu') {
2606 osJobName = 'ubuntu14.04'
2609 osJobName = os.toLowerCase()
2611 copyArtifacts("${corefxFolder}/${osJobName}_release") {
2612 includePatterns('bin/build.tar.gz')
2614 latestSuccessful(true)
2618 shell ("mkdir ./bin/CoreFxBinDir")
2619 // Unpack the corefx binaries
2620 shell("tar -xf ./bin/build.tar.gz -C ./bin/CoreFxBinDir")
2622 // HACK -- Arm64 does not have corefx jobs yet.
2623 // Clone corefx and build the native packages overwriting the x64 packages.
2624 if (architecture == 'arm64') {
2625 shell("cp ./bin/Product/Linux.arm64.${configuration}/corefxNative/* ./bin/CoreFxBinDir")
2626 shell("chmod +x ./bin/Product/Linux.arm64.${configuration}/corerun")
2629 // Unzip the tests first. Exit with 0
2630 shell("unzip -q -o ./bin/tests/tests.zip -d ./bin/tests/Windows_NT.${architecture}.${configuration} || exit 0")
2632 // Execute the tests
2633 // If we are running a stress mode, we'll set those variables first
2635 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
2636 def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
2637 def createScriptCmds = genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], scriptFileName)
2638 shell("${createScriptCmds}")
2639 testEnvOpt = "--test-env=" + scriptFileName
2642 if (isGCStressRelatedTesting(scenario)) {
2643 shell('./init-tools.sh')
2646 shell("""./tests/runtest.sh \\
2647 --testRootDir=\"\${WORKSPACE}/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2648 --testNativeBinDir=\"\${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2649 --coreClrBinDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2650 --mscorlibDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2651 --coreFxBinDir=\"\${WORKSPACE}/bin/CoreFxBinDir\" \\
2652 --limitedDumpGeneration \\
2653 ${testEnvOpt} ${serverGCString} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} \\
2654 ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${runjitdisasmStr} ${runilasmroundtripStr} \\
2655 ${illinkStr} ${sequentialString} ${playlistString} ${layoutOnlyStr}""")
2657 if (isGcReliabilityFramework(scenario)) {
2658 // runtest.sh doesn't actually execute the reliability framework - do it here.
2659 if (serverGCString != '') {
2660 shell("export COMPlus_gcServer=1")
2663 shell("./tests/scripts/run-gc-reliability-framework.sh ${architecture} ${configuration}")
2669 if (scenario == 'coverage') {
2670 // Publish coverage reports
2671 Utilities.addHtmlPublisher(newJob, '${WORKSPACE}/coverage/Coverage/reports', 'Code Coverage Report', 'coreclr.html')
2672 // TODO: Add once external email sending is available again
2673 // addEmailPublisher(newJob, 'clrcoverage@microsoft.com')
2676 if (scenario == 'jitdiff') {
2677 Utilities.addArchival(newJob, "bin/tests/${osGroup}.${architecture}.${configuration}/dasm/**")
2680 // Experimental: If on Ubuntu 14.04, then attempt to pull in crash dump links
2681 if (os in ['Ubuntu']) {
2682 SummaryBuilder summaries = new SummaryBuilder()
2683 summaries.addLinksSummaryFromFile('Crash dumps from this run:', 'dumplings.txt')
2684 summaries.emit(newJob)
2687 setMachineAffinity(newJob, os, architecture)
2688 Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
2689 // Set timeouts to 240.
2690 setTestJobTimeOut(newJob, scenario)
2692 if (architecture == 'arm64') {
2693 Utilities.setJobTimeout(newJob, 480)
2696 Utilities.addXUnitDotNETResults(newJob, '**/coreclrtests.xml')
2698 // Create a build flow to join together the build and tests required to run this
2700 // Windows CoreCLR build and Linux CoreCLR build (in parallel) ->
2701 // Linux CoreCLR test
2702 def flowJobName = getJobName(configuration, architecture, os, scenario, false) + "_flow"
2703 def fullTestJobName = projectFolder + '/' + newJob.name
2704 // Add a reference to the input jobs for report purposes
2705 JobReport.Report.addReference(inputCoreCLRBuildName)
2706 JobReport.Report.addReference(inputWindowTestsBuildName)
2707 JobReport.Report.addReference(fullTestJobName)
2710 // If this is a coverage job, we don't copy any input coreCLR build - instead, we build it as part of the flow job,
2711 // so that coverage data can be preserved.
2712 if (scenario == 'coverage') {
2713 newFlowJob = buildFlowJob(Utilities.getFullJobName(project, flowJobName, isPR, folder)) {
2715 // Build the input Windows job
2716 windowsBuildJob = build(params, '${inputWindowTestsBuildName}')
2718 // And then build the test build
2719 build(params + [CORECLR_WINDOWS_BUILD: windowsBuildJob.build.number], '${fullTestJobName}')
2722 // Normal jobs copy a Windows build & a non-Windows build
2724 newFlowJob = buildFlowJob(Utilities.getFullJobName(project, flowJobName, isPR, folder)) {
2726 // Build the input jobs in parallel
2728 { coreclrBuildJob = build(params, '${inputCoreCLRBuildName}') },
2729 { windowsBuildJob = build(params, '${inputWindowTestsBuildName}') }
2732 // And then build the test build
2733 build(params + [CORECLR_BUILD: coreclrBuildJob.build.number,
2734 CORECLR_WINDOWS_BUILD: windowsBuildJob.build.number], '${fullTestJobName}')
2739 setMachineAffinity(newFlowJob, os, architecture)
2740 Utilities.standardJobSetup(newFlowJob, project, isPR, "*/${branch}")
2741 addTriggers(newFlowJob, branch, isPR, architecture, os, configuration, scenario, true, false)
2748 JobReport.Report.generateJobReport(out)
2750 // Make the call to generate the help job
2751 Utilities.createHelperJob(this, project, branch,
2752 "Welcome to the ${project} Repository", // This is prepended to the help message
2753 "Have a nice day!") // This is appended to the help message. You might put known issues here.
2755 Utilities.addCROSSCheck(this, project, branch)