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 'illink'] + r2rJitStressScenarios
142 def static configurationList = ['Debug', 'Checked', 'Release']
144 // This is the set of architectures
145 def static architectureList = ['arm', 'arm64', 'x64', 'x86']
148 def static setMachineAffinity(def job, def os, def architecture) {
149 if (architecture == 'arm64' && os == 'Windows_NT') {
150 Utilities.setMachineAffinity(job, os, 'latest-arm64');
151 } else if (architecture == 'arm64' && os == 'Ubuntu') {
152 Utilities.setMachineAffinity(job, os, 'arm-cross-latest');
153 } else if ((architecture == 'arm') && (os == 'Ubuntu' || os == 'Ubuntu16.04' || os == 'Tizen')) {
154 Utilities.setMachineAffinity(job, 'Ubuntu', 'arm-cross-latest');
156 Utilities.setMachineAffinity(job, os, 'latest-or-auto');
160 def static isJITStressJob(def scenario) {
161 return Constants.jitStressModeScenarios.containsKey(scenario) ||
162 (Constants.r2rJitStressScenarios.indexOf(scenario) != -1)
165 def static isGCStressRelatedTesting(def scenario) {
166 // The 'gcstress15_pri1r2r' scenario is a basic scenario.
167 // Detect it and make it a GCStress related.
168 if (scenario == 'gcstress15_pri1r2r')
173 def gcStressTestEnvVars = [ 'COMPlus_GCStress', 'COMPlus_ZapDisable', 'COMPlus_HeapVerify']
174 def scenarioName = scenario.toLowerCase()
175 def isGCStressTesting = false
176 Constants.jitStressModeScenarios[scenario].each{ k, v ->
177 if (k in gcStressTestEnvVars) {
178 isGCStressTesting = true;
181 return isGCStressTesting
184 def static isCorefxTesting(def scenario) {
185 def corefx_prefix = 'corefx_'
186 if (scenario.length() < corefx_prefix.length()) {
189 return scenario.substring(0,corefx_prefix.length()) == corefx_prefix
192 def static isR2R(def scenario) {
193 return (scenario == 'r2r' || scenario == 'pri1r2r')
196 def static isCoverage(def scenario) {
197 return (scenario == 'coverage')
200 def static isLongGc(def scenario) {
201 return (scenario == 'longgc' || scenario == 'gcsimulator')
204 def static isJitDiff(def scenario) {
205 return (scenario == 'jitdiff')
208 def static setTestJobTimeOut(newJob, scenario) {
209 if (isGCStressRelatedTesting(scenario)) {
210 Utilities.setJobTimeout(newJob, 4320)
212 else if (isCorefxTesting(scenario)) {
213 Utilities.setJobTimeout(newJob, 360)
215 else if (Constants.jitStressModeScenarios.containsKey(scenario)) {
216 Utilities.setJobTimeout(newJob, 240)
218 else if (isR2R(scenario)) {
219 Utilities.setJobTimeout(newJob, 240)
221 else if (isCoverage(scenario)) {
222 Utilities.setJobTimeout(newJob, 1440)
224 else if (isLongGc(scenario)) {
225 Utilities.setJobTimeout(newJob, 1440)
227 else if (isJitDiff(scenario)) {
228 Utilities.setJobTimeout(newJob, 240)
230 // Non-test jobs use the default timeout value.
233 def static getJobFolder(def scenario) {
234 if (isJITStressJob(scenario)) {
237 if (scenario == 'illink') {
243 def static getStressModeDisplayName(def scenario) {
245 Constants.jitStressModeScenarios[scenario].each{ k, v ->
246 def prefixLength = 'COMPlus_'.length()
247 if (k.length() >= prefixLength) {
248 def modeName = k.substring(prefixLength, k.length())
249 displayStr += ' ' + modeName + '=' + v
255 def static getR2RStressModeDisplayName(def scenario) {
256 // Assume the scenario name is one from the r2rJitStressScenarios list, and remove its
258 def displayStr = scenario
259 def prefixLength = 'r2r_'.length()
260 if (displayStr.length() >= prefixLength) {
261 displayStr = displayStr.substring(prefixLength, displayStr.length())
266 // Generates the string for creating a file that sets environment variables
267 // that makes it possible to run stress modes. Writes the script to the file
268 // specified by the stepScriptLocation parameter.
269 def static genStressModeScriptStep(def os, def stressModeName, def stressModeVars, def stepScriptLocation) {
271 if (os == 'Windows_NT') {
272 stepScript += "echo Creating TestEnv Script for ${stressModeName}\r\n"
273 stepScript += "del ${stepScriptLocation}\r\n"
275 // Timeout in ms, default is 10 minutes. For stress
276 // modes up this to 30 minutes
277 def timeout = 1800000
280 stepScript += "set __TestTimeout=${timeout}\r\n"
281 stepScript += "echo. > ${stepScriptLocation}\r\n"
282 stressModeVars.each{ k, v ->
283 // Write out what we are writing to the script file
284 stepScript += "echo Setting ${k}=${v}\r\n"
285 // Write out the set itself to the script file`
286 stepScript += "echo set ${k}=${v} >> ${stepScriptLocation}\r\n"
290 stepScript += "echo Setting variables for ${stressModeName}\n"
291 stepScript += "echo \\#\\!/usr/bin/env bash > ${stepScriptLocation}\n"
292 stressModeVars.each{ k, v ->
293 // Write out what we are writing to the script file
294 stepScript += "echo Setting ${k}=${v}\n"
295 // Write out the set itself to the script file`
296 stepScript += "echo export ${k}=${v} >> ${stepScriptLocation}\n"
298 stepScript += "chmod +x ${stepScriptLocation}\n"
303 // Calculates the name of the build job based on some typical parameters.
305 def static getJobName(def configuration, def architecture, def os, def scenario, def isBuildOnly) {
306 // If the architecture is x64, do not add that info into the build name.
307 // Need to change around some systems and other builds to pick up the right builds
310 def suffix = scenario != 'default' ? "_${scenario}" : '';
315 switch (architecture) {
317 if (scenario == 'default') {
318 // For now we leave x64 off of the name for compatibility with other jobs
319 baseName = configuration.toLowerCase() + '_' + os.toLowerCase()
321 else if (scenario == 'formatting') {
322 // we don't care about the configuration for the formatting job. It runs all configs
323 baseName = architecture.toLowerCase() + '_' + os.toLowerCase()
326 baseName = architecture.toLowerCase() + '_' + configuration.toLowerCase() + '_' + os.toLowerCase()
330 // These are cross builds
331 baseName = architecture.toLowerCase() + '_cross_' + configuration.toLowerCase() + '_' + os.toLowerCase()
334 // These are cross builds
337 baseName = 'armel_cross_' + configuration.toLowerCase() + '_' + os.toLowerCase()
340 baseName = architecture.toLowerCase() + '_cross_' + configuration.toLowerCase() + '_' + os.toLowerCase()
344 baseName = architecture.toLowerCase() + '_' + configuration.toLowerCase() + '_' + os.toLowerCase()
347 println("Unknown architecture: ${architecture}");
352 return baseName + suffix
355 def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def os, def configuration, def scenario, def isFlowJob, def isWindowsBuildOnlyJob, def bidailyCrossList) {
359 switch (architecture) {
362 if (architecture == 'x86' && os == 'Ubuntu') {
363 Utilities.addPeriodicTrigger(job, '@daily')
365 else if (isFlowJob || os == 'Windows_NT' || !(os in Constants.crossList)) {
366 Utilities.addGithubPushTrigger(job)
370 Utilities.addGithubPushTrigger(job)
373 if (os == 'Windows_NT') {
374 Utilities.addGithubPushTrigger(job)
375 // TODO: Add once external email sending is available again
376 // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
380 println("Unknown architecture: ${architecture}");
386 // Pri one gets a push trigger, and only for release
387 if (architecture == 'x64') {
388 if (configuration == 'Release') {
389 // We expect release jobs to be Windows, or in the cross list
390 assert (os == 'Windows_NT') || (os in Constants.crossList)
391 if (!os in bidailyCrossList) {
392 if (isFlowJob || os == 'Windows_NT') {
393 Utilities.addGithubPushTrigger(job)
398 Utilities.addPeriodicTrigger(job, 'H H/12 * * *')
405 //r2r jobs that aren't pri1 can only be triggered by phrase
408 assert !(os in bidailyCrossList)
409 //pri1 r2r gets a push trigger for checked/release
410 if (configuration == 'Checked' || configuration == 'Release') {
411 assert (os == 'Windows_NT') || (os in Constants.crossList)
412 if (architecture == 'x64' && os != 'OSX10.12') {
413 //Flow jobs should be Windows, Ubuntu, OSX0.12, or CentOS
414 if (isFlowJob || os == 'Windows_NT') {
415 Utilities.addGithubPushTrigger(job)
417 // OSX10.12 pri1r2r jobs should only run every 12 hours, not daily.
418 } else if (architecture == 'x64' && os == 'OSX10.12'){
420 Utilities.addPeriodicTrigger(job, 'H H/12 * * *')
423 // For x86, only add per-commit jobs for Windows
424 else if (architecture == 'x86') {
425 if (os == 'Windows_NT') {
426 Utilities.addGithubPushTrigger(job)
429 // arm64 pri1r2r jobs should only run every 12 hours.
430 else if (architecture == 'arm64') {
431 if (os == 'Windows_NT') {
432 Utilities.addPeriodicTrigger(job, 'H H/12 * * *')
433 // TODO: Add once external email sending is available again
434 // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
439 case 'r2r_jitstress1':
440 case 'r2r_jitstress2':
441 case 'r2r_jitstressregs1':
442 case 'r2r_jitstressregs2':
443 case 'r2r_jitstressregs3':
444 case 'r2r_jitstressregs4':
445 case 'r2r_jitstressregs8':
446 case 'r2r_jitstressregs0x10':
447 case 'r2r_jitstressregs0x80':
448 case 'r2r_jitstressregs0x1000':
449 case 'r2r_jitminopts':
450 case 'r2r_jitforcerelocs':
451 case 'gcstress15_pri1r2r':
452 assert !(os in bidailyCrossList)
454 // GCStress=C is currently not supported on OS X
455 if (os == 'OSX10.12' && isGCStressRelatedTesting(scenario)) {
459 //GC Stress 15 pri1 r2r gets a push trigger for checked/release
460 if (configuration == 'Checked' || configuration == 'Release') {
461 assert (os == 'Windows_NT') || (os in Constants.crossList)
462 if (architecture == 'x64') {
463 //Flow jobs should be Windows, Ubuntu, OSX10.12, or CentOS
464 if (isFlowJob || os == 'Windows_NT') {
465 // Add a weekly periodic trigger
466 Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
469 // For x86, only add per-commit jobs for Windows
470 else if (architecture == 'x86') {
471 if (os == 'Windows_NT') {
472 Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
478 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
479 assert configuration == 'Release'
480 assert architecture == 'x64'
481 Utilities.addPeriodicTrigger(job, '@daily')
482 // TODO: Add once external email sending is available again
483 // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
486 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
487 assert configuration == 'Release'
488 assert architecture == 'x64'
489 Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
490 // TODO: Add once external email sending is available again
491 // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
493 case 'standalone_gc':
494 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
495 assert (configuration == 'Release' || configuration == 'Checked')
496 // TODO: Add once external email sending is available again
497 // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
498 Utilities.addPeriodicTrigger(job, '@weekly')
501 assert !(os in bidailyCrossList)
502 // ILASM/ILDASM roundtrip one gets a daily build, and only for release
503 if (architecture == 'x64' && configuration == 'Release') {
504 // We don't expect to see a job generated except in these scenarios
505 assert (os == 'Windows_NT') || (os in Constants.crossList)
506 if (isFlowJob || os == 'Windows_NT') {
507 Utilities.addPeriodicTrigger(job, '@daily')
512 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
513 assert configuration == 'Checked'
514 assert (architecture == 'x64' || architecture == 'x86')
515 Utilities.addGithubPushTrigger(job)
518 assert (os == 'Ubuntu' || os == 'Windows_NT')
519 assert configuration == 'Release'
520 assert architecture == 'x64'
521 Utilities.addPeriodicTrigger(job, '@weekly')
524 assert (os == 'Windows_NT' || os == "Ubuntu")
525 assert architecture == 'x64'
526 Utilities.addGithubPushTrigger(job)
528 case 'jitstressregs1':
529 case 'jitstressregs2':
530 case 'jitstressregs3':
531 case 'jitstressregs4':
532 case 'jitstressregs8':
533 case 'jitstressregs0x10':
534 case 'jitstressregs0x80':
535 case 'jitstressregs0x1000':
540 case 'jitstress2_jitstressregs1':
541 case 'jitstress2_jitstressregs2':
542 case 'jitstress2_jitstressregs3':
543 case 'jitstress2_jitstressregs4':
544 case 'jitstress2_jitstressregs8':
545 case 'jitstress2_jitstressregs0x10':
546 case 'jitstress2_jitstressregs0x80':
547 case 'jitstress2_jitstressregs0x1000':
548 case 'tailcallstress':
550 case 'corefx_baseline':
551 case 'corefx_minopts':
552 case 'corefx_jitstress1':
553 case 'corefx_jitstress2':
554 case 'corefx_jitstressregs1':
555 case 'corefx_jitstressregs2':
556 case 'corefx_jitstressregs3':
557 case 'corefx_jitstressregs4':
558 case 'corefx_jitstressregs8':
559 case 'corefx_jitstressregs0x10':
560 case 'corefx_jitstressregs0x80':
561 case 'corefx_jitstressregs0x1000':
563 if (os != 'CentOS7.1' && !(os in bidailyCrossList)) {
564 assert (os == 'Windows_NT') || (os in Constants.crossList)
565 Utilities.addPeriodicTrigger(job, '@daily')
570 if (os != 'CentOS7.1' && !(os in bidailyCrossList)) {
571 assert (os == 'Windows_NT') || (os in Constants.crossList)
572 if (architecture == 'arm64') {
573 assert (os == 'Windows_NT')
574 Utilities.addPeriodicTrigger(job, '@daily')
575 // TODO: Add once external email sending is available again
576 // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
579 Utilities.addPeriodicTrigger(job, '@weekly')
584 case 'gcstress0xc_zapdisable':
585 case 'gcstress0xc_zapdisable_jitstress2':
586 case 'gcstress0xc_zapdisable_heapverify1':
587 case 'gcstress0xc_jitstress1':
588 case 'gcstress0xc_jitstress2':
589 case 'gcstress0xc_minopts_heapverify1':
590 // GCStress=C is currently not supported on OS X
591 if (os != 'CentOS7.1' && os != 'OSX10.12' && !(os in bidailyCrossList)) {
592 assert (os == 'Windows_NT') || (os in Constants.crossList)
593 if (architecture == 'arm64') {
594 assert (os == 'Windows_NT')
595 // TODO: Enable a periodic trigger after tests are updated.
596 // Utilities.addPeriodicTrigger(job, '@daily')
597 // TODO: Add once external email sending is available again
598 // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
601 Utilities.addPeriodicTrigger(job, '@weekly')
607 // Testing on other operating systems TBD
608 assert (os == 'Windows_NT' || os == 'Ubuntu')
609 if (architecture == 'x64' || architecture == 'x86') {
610 if (configuration == 'Checked') {
611 Utilities.addPeriodicTrigger(job, '@daily')
617 println("Unknown scenario: ${scenario}");
624 // **************************
625 // Define the basic inner loop builds for PR and commit. This is basically just the set
626 // of coreclr builds over linux/osx 10.12/freebsd/windows and debug/release/checked. In addition, the windows
627 // builds will do a couple extra steps.
628 // **************************
630 // Adds a trigger for the PR build if one is needed. If isFlowJob is true, then this is the
631 // flow job that rolls up the build and test for non-windows OS's. // If the job is a windows build only job,
632 // it's just used for internal builds
633 // If you add a job with a trigger phrase, please add that phrase to coreclr/Documentation/project-docs/ci-trigger-phrases.md
634 def static addTriggers(def job, def branch, def isPR, def architecture, def os, def configuration, def scenario, def isFlowJob, def isWindowsBuildOnlyJob) {
635 if (isWindowsBuildOnlyJob) {
639 def bidailyCrossList = ['RHEL7.2', 'Debian8.4']
640 // Non pull request builds.
642 addNonPRTriggers(job, branch, isPR, architecture, os, configuration, scenario, isFlowJob, isWindowsBuildOnlyJob, bidailyCrossList)
645 // Pull request builds. Generally these fall into two categories: default triggers and on-demand triggers
646 // We generally only have a distinct set of default triggers but a bunch of on-demand ones.
647 def osGroup = getOSGroup(os)
648 switch (architecture) {
649 case 'x64': // editor brace matching: {
650 if (scenario == 'coverage') {
651 assert configuration == 'Release'
652 if (os == 'Ubuntu') {
653 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Coverage Build & Test", "(?i).*test\\W+coverage.*")
658 if (scenario == 'formatting') {
659 assert configuration == 'Checked'
660 if (os == 'Windows_NT' || os == 'Ubuntu') {
661 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Formatting")
667 // OpenSUSE, Debian & RedHat get trigger phrases for pri 0 build, and pri 1 build & test
670 if (scenario == 'default') {
672 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", "(?i).*test\\W+${os}.*")
674 else if (scenario == 'pri1' && isFlowJob) {
675 assert (configuration == 'Release')
676 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Pri 1 Build & Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
681 assert scenario == 'default'
682 // Distinguish with the other architectures (arm and x86)
683 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", "(?i).*test\\W+${os}\\W+${architecture}.*")
689 assert scenario == 'default'
690 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", "(?i).*test\\W+${os}\\W+.*")
693 if (scenario == 'illink') {
694 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
699 // Triggers on the non-flow jobs aren't necessary here
700 // Corefx testing uses non-flow jobs.
701 if (!isFlowJob && !isCorefxTesting(scenario)) {
706 // Ubuntu uses checked for default PR tests
707 if (configuration == 'Checked') {
709 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test")
713 if (configuration == 'Release') {
714 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
718 if (configuration == 'Checked') {
719 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Jit Diff Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
723 if (configuration == 'Release') {
724 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
728 if (configuration == 'Release' || configuration == 'Checked') {
729 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
733 if (configuration == 'Release' || configuration == 'Checked') {
734 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
737 case 'gcstress15_pri1r2r':
738 if (configuration == 'Release' || configuration == 'Checked') {
739 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
742 case 'r2r_jitstress1':
743 case 'r2r_jitstress2':
744 case 'r2r_jitstressregs1':
745 case 'r2r_jitstressregs2':
746 case 'r2r_jitstressregs3':
747 case 'r2r_jitstressregs4':
748 case 'r2r_jitstressregs8':
749 case 'r2r_jitstressregs0x10':
750 case 'r2r_jitstressregs0x80':
751 case 'r2r_jitstressregs0x1000':
752 case 'r2r_jitminopts':
753 case 'r2r_jitforcerelocs':
754 if (configuration == 'Release' || configuration == 'Checked') {
755 def displayStr = getR2RStressModeDisplayName(scenario)
756 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
760 if (configuration == 'Release') {
761 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
765 if (configuration == 'Release') {
766 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
773 case 'jitstressregs1':
774 case 'jitstressregs2':
775 case 'jitstressregs3':
776 case 'jitstressregs4':
777 case 'jitstressregs8':
778 case 'jitstressregs0x10':
779 case 'jitstressregs0x80':
780 case 'jitstressregs0x1000':
781 case 'jitstress2_jitstressregs1':
782 case 'jitstress2_jitstressregs2':
783 case 'jitstress2_jitstressregs3':
784 case 'jitstress2_jitstressregs4':
785 case 'jitstress2_jitstressregs8':
786 case 'jitstress2_jitstressregs0x10':
787 case 'jitstress2_jitstressregs0x80':
788 case 'jitstress2_jitstressregs0x1000':
789 case 'tailcallstress':
795 case 'gcstress0xc_zapdisable':
796 case 'gcstress0xc_zapdisable_jitstress2':
797 case 'gcstress0xc_zapdisable_heapverify1':
798 case 'gcstress0xc_jitstress1':
799 case 'gcstress0xc_jitstress2':
800 case 'gcstress0xc_minopts_heapverify1':
801 def displayStr = getStressModeDisplayName(scenario)
802 assert (os == 'Windows_NT') || (os in Constants.crossList)
803 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
804 "(?i).*test\\W+${os}\\W+${scenario}.*")
806 case 'corefx_baseline':
807 case 'corefx_minopts':
808 case 'corefx_jitstress1':
809 case 'corefx_jitstress2':
810 case 'corefx_jitstressregs1':
811 case 'corefx_jitstressregs2':
812 case 'corefx_jitstressregs3':
813 case 'corefx_jitstressregs4':
814 case 'corefx_jitstressregs8':
815 case 'corefx_jitstressregs0x10':
816 case 'corefx_jitstressregs0x80':
817 case 'corefx_jitstressregs0x1000':
818 def displayName = ('CoreFx ' + getStressModeDisplayName(scenario)).trim()
819 assert (os == 'Windows_NT') || (os in Constants.crossList)
820 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayName})",
821 "(?i).*test\\W+${os}\\W+${architecture}\\W+${scenario}.*")
824 println("Unknown scenario: ${scenario}");
832 if (configuration == 'Release') {
833 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
837 if (configuration == 'Checked' || configuration == 'Release') {
838 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
842 if (configuration == 'Checked' || configuration == 'Release') {
843 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
846 case 'gcstress15_pri1r2r':
847 if (configuration == 'Release' || configuration == 'Checked') {
848 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
851 case 'r2r_jitstress1':
852 case 'r2r_jitstress2':
853 case 'r2r_jitstressregs1':
854 case 'r2r_jitstressregs2':
855 case 'r2r_jitstressregs3':
856 case 'r2r_jitstressregs4':
857 case 'r2r_jitstressregs8':
858 case 'r2r_jitstressregs0x10':
859 case 'r2r_jitstressregs0x80':
860 case 'r2r_jitstressregs0x1000':
861 case 'r2r_jitminopts':
862 case 'r2r_jitforcerelocs':
863 if (configuration == 'Release' || configuration == 'Checked') {
864 def displayStr = getR2RStressModeDisplayName(scenario)
865 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
875 if (configuration == 'Debug') {
876 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test")
881 if (configuration == 'Release') {
882 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test")
886 if (configuration == 'Checked') {
887 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Jit Diff Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
891 if (configuration == 'Release') {
892 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
896 if (configuration == 'Checked' || configuration == 'Release') {
897 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
901 if (configuration == 'Checked' || configuration == 'Release') {
902 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
905 case 'gcstress15_pri1r2r':
906 if (configuration == 'Release' || configuration == 'Checked') {
907 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
910 case 'r2r_jitstress1':
911 case 'r2r_jitstress2':
912 case 'r2r_jitstressregs1':
913 case 'r2r_jitstressregs2':
914 case 'r2r_jitstressregs3':
915 case 'r2r_jitstressregs4':
916 case 'r2r_jitstressregs8':
917 case 'r2r_jitstressregs0x10':
918 case 'r2r_jitstressregs0x80':
919 case 'r2r_jitstressregs0x1000':
920 case 'r2r_jitminopts':
921 case 'r2r_jitforcerelocs':
922 if (configuration == 'Release' || configuration == 'Checked') {
923 def displayStr = getR2RStressModeDisplayName(scenario)
924 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
928 if (configuration == 'Release') {
929 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
933 if (configuration == 'Release') {
934 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
937 case 'standalone_gc':
938 if (configuration == 'Release' || configuration == 'Checked') {
939 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
946 case 'jitstressregs1':
947 case 'jitstressregs2':
948 case 'jitstressregs3':
949 case 'jitstressregs4':
950 case 'jitstressregs8':
951 case 'jitstressregs0x10':
952 case 'jitstressregs0x80':
953 case 'jitstressregs0x1000':
954 case 'jitstress2_jitstressregs1':
955 case 'jitstress2_jitstressregs2':
956 case 'jitstress2_jitstressregs3':
957 case 'jitstress2_jitstressregs4':
958 case 'jitstress2_jitstressregs8':
959 case 'jitstress2_jitstressregs0x10':
960 case 'jitstress2_jitstressregs0x80':
961 case 'jitstress2_jitstressregs0x1000':
962 case 'tailcallstress':
968 case 'gcstress0xc_zapdisable':
969 case 'gcstress0xc_zapdisable_jitstress2':
970 case 'gcstress0xc_zapdisable_heapverify1':
971 case 'gcstress0xc_jitstress1':
972 case 'gcstress0xc_jitstress2':
973 case 'gcstress0xc_minopts_heapverify1':
974 def displayStr = getStressModeDisplayName(scenario)
975 assert (os == 'Windows_NT') || (os in Constants.crossList)
976 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
977 "(?i).*test\\W+${os}\\W+${scenario}.*")
979 case 'corefx_baseline':
980 case 'corefx_minopts':
981 case 'corefx_jitstress1':
982 case 'corefx_jitstress2':
983 case 'corefx_jitstressregs1':
984 case 'corefx_jitstressregs2':
985 case 'corefx_jitstressregs3':
986 case 'corefx_jitstressregs4':
987 case 'corefx_jitstressregs8':
988 case 'corefx_jitstressregs0x10':
989 case 'corefx_jitstressregs0x80':
990 case 'corefx_jitstressregs0x1000':
991 def displayName = ('CoreFx ' + getStressModeDisplayName(scenario)).trim()
992 assert (os == 'Windows_NT') || (os in Constants.crossList)
993 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayName})",
994 "(?i).*test\\W+${os}\\W+${architecture}\\W+${scenario}.*")
997 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1000 println("Unknown scenario: ${scenario}");
1006 assert scenario == 'default'
1007 if (configuration == 'Checked') {
1008 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build")
1012 println("Unknown os: ${os}");
1017 // editor brace matching: }
1018 case 'arm': // editor brace matching: {
1019 assert scenario == 'default'
1023 if ((os == 'Ubuntu' && configuration == 'Release') || (os == 'Ubuntu16.04' && configuration == 'Debug')) {
1024 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build")
1027 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build", "(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
1031 architecture='armel'
1032 // Removing the regex will cause this to run on each PR.
1033 if (configuration == 'Release' || configuration == 'Debug') {
1034 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build")
1037 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build", "(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
1041 if (configuration == 'Debug' || configuration == 'Release')
1043 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build")
1047 println("NYI os: ${os}");
1052 // editor brace matching: }
1053 case 'arm64': // editor brace matching: {
1054 assert (scenario == 'default') || (scenario == 'pri1r2r') || (scenario == 'gcstress0x3') || (scenario == 'gcstress0xc')
1056 // Set up a private trigger
1057 def contextString = "${os} ${architecture} Cross ${configuration}"
1058 if (scenario != 'default')
1059 contextString += " ${scenario}"
1060 contextString += " Build"
1061 // Debug builds only.
1062 if (configuration != 'Debug') {
1063 contextString += " and Test"
1096 // For now only run Debug jobs on PR Trigger.
1097 if (configuration != 'Debug') {
1098 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString,
1099 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*", null, arm64Users)
1102 // Add "Checked Build And Test" and "Debug Build" to the above users' PRs since many of them
1103 // are at higher risk of ARM64-breaking changes.
1104 Utilities.addDefaultPrivateGithubPRTriggerForBranch(job, branch, contextString, null, arm64Users)
1110 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString,
1111 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*", null, arm64Users)
1116 println("NYI os: ${os}");
1121 // editor brace matching: }
1122 case 'x86': // editor brace matching: {
1123 assert ((os == 'Windows_NT') || ((os == 'Ubuntu') && (scenario == 'default')))
1124 if (os == 'Ubuntu') {
1125 // on-demand only for ubuntu x86
1126 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build",
1127 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*")
1132 if (configuration == 'Checked') {
1133 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test")
1135 else if (configuration == 'Release') {
1136 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test",
1137 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*")
1141 if (configuration == 'Release') {
1142 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test")
1146 if (configuration == 'Release') {
1147 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test",
1148 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1152 if (configuration == 'Checked' || configuration == 'Release') {
1153 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test",
1154 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1158 if (configuration == 'Checked' || configuration == 'Release') {
1159 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test",
1160 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1163 case 'gcstress15_pri1r2r':
1164 if (configuration == 'Release' || configuration == 'Checked') {
1165 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test",
1166 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1169 case 'r2r_jitstress1':
1170 case 'r2r_jitstress2':
1171 case 'r2r_jitstressregs1':
1172 case 'r2r_jitstressregs2':
1173 case 'r2r_jitstressregs3':
1174 case 'r2r_jitstressregs4':
1175 case 'r2r_jitstressregs8':
1176 case 'r2r_jitstressregs0x10':
1177 case 'r2r_jitstressregs0x80':
1178 case 'r2r_jitstressregs0x1000':
1179 case 'r2r_jitminopts':
1180 case 'r2r_jitforcerelocs':
1181 if (configuration == 'Release' || configuration == 'Checked') {
1182 def displayStr = getR2RStressModeDisplayName(scenario)
1183 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test",
1184 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1188 if (configuration == 'Release') {
1189 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test",
1190 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1194 if (configuration == 'Release') {
1195 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator",
1196 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1199 case 'standalone_gc':
1200 if (configuration == 'Release' || configuration == 'Checked') {
1201 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC",
1202 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1209 case 'jitstressregs1':
1210 case 'jitstressregs2':
1211 case 'jitstressregs3':
1212 case 'jitstressregs4':
1213 case 'jitstressregs8':
1214 case 'jitstressregs0x10':
1215 case 'jitstressregs0x80':
1216 case 'jitstressregs0x1000':
1217 case 'jitstress2_jitstressregs1':
1218 case 'jitstress2_jitstressregs2':
1219 case 'jitstress2_jitstressregs3':
1220 case 'jitstress2_jitstressregs4':
1221 case 'jitstress2_jitstressregs8':
1222 case 'jitstress2_jitstressregs0x10':
1223 case 'jitstress2_jitstressregs0x80':
1224 case 'jitstress2_jitstressregs0x1000':
1225 case 'tailcallstress':
1231 case 'gcstress0xc_zapdisable':
1232 case 'gcstress0xc_zapdisable_jitstress2':
1233 case 'gcstress0xc_zapdisable_heapverify1':
1234 case 'gcstress0xc_jitstress1':
1235 case 'gcstress0xc_jitstress2':
1236 case 'gcstress0xc_minopts_heapverify1':
1237 def displayStr = getStressModeDisplayName(scenario)
1238 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
1239 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1241 case 'corefx_baseline':
1242 case 'corefx_minopts':
1243 case 'corefx_jitstress1':
1244 case 'corefx_jitstress2':
1245 case 'corefx_jitstressregs1':
1246 case 'corefx_jitstressregs2':
1247 case 'corefx_jitstressregs3':
1248 case 'corefx_jitstressregs4':
1249 case 'corefx_jitstressregs8':
1250 case 'corefx_jitstressregs0x10':
1251 case 'corefx_jitstressregs0x80':
1252 case 'corefx_jitstressregs0x1000':
1253 def displayName = ('CoreFx ' + getStressModeDisplayName(scenario)).trim()
1254 assert (os == 'Windows_NT') || (os in Constants.crossList)
1255 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayName})",
1256 "(?i).*test\\W+${os}\\W+${architecture}\\W+${scenario}.*")
1259 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1262 println("Unknown scenario: ${os} ${architecture} ${scenario}");
1267 // editor brace matching: }
1269 println("Unknown architecture: ${architecture}");
1275 def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR, def architecture, def configuration, def os, def enableCorefxTesting, def isBuildOnly) {
1276 def buildCommands = [];
1277 def osGroup = getOSGroup(os)
1278 def lowerConfiguration = configuration.toLowerCase()
1280 // Calculate the build steps, archival, and xunit results
1282 case 'Windows_NT': // editor brace matching: {
1283 switch (architecture) {
1286 def arch = architecture
1289 if (scenario == 'illink') {
1290 buildCommands += "tests\\scripts\\build_illink.cmd clone ${arch}"
1293 if (Constants.jitStressModeScenarios.containsKey(scenario) ||
1294 scenario == 'default' ||
1295 scenario == 'r2r' ||
1296 scenario == 'jitdiff' ||
1297 scenario == 'illink' ||
1298 Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
1299 buildOpts += enableCorefxTesting ? ' skiptests' : ''
1300 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${arch} ${buildOpts}"
1303 // For Pri 1 tests, we must shorten the output test binary path names.
1304 // if __TestIntermediateDir is already set, build-test.cmd will
1305 // output test binaries to that directory. If it is not set, the
1306 // binaries are sent to a default directory whose name is about
1307 // 35 characters long.
1309 else if (scenario == 'pri1' || scenario == 'pri1r2r' || scenario == 'gcstress15_pri1r2r'|| scenario == 'coverage') {
1310 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${arch} ${buildOpts} -priority=1"
1312 else if (scenario == 'ilrt') {
1313 // First do the build with skiptests and then build the tests with ilasm roundtrip
1314 buildCommands += "build.cmd ${lowerConfiguration} ${arch} ${buildOpts} skiptests"
1315 buildCommands += "set __TestIntermediateDir=int&&build-test.cmd ${lowerConfiguration} ${arch} -ilasmroundtrip"
1317 else if (isLongGc(scenario)) {
1318 buildCommands += "build.cmd ${lowerConfiguration} ${arch} ${buildOpts} skiptests"
1319 buildCommands += "set __TestIntermediateDir=int&&build-test.cmd ${lowerConfiguration} ${arch}"
1321 else if (scenario == 'standalone_gc') {
1322 buildCommands += "build.cmd ${lowerConfiguration} ${arch} ${buildOpts} buildstandalonegc"
1324 else if (scenario == 'formatting') {
1325 buildCommands += "python -u tests\\scripts\\format.py -c %WORKSPACE% -o Windows_NT -a ${arch}"
1326 Utilities.addArchival(newJob, "format.patch", "", true, false)
1330 println("Unknown scenario: ${scenario}")
1334 // If we are running a stress mode, we should write out the set of key
1335 // value env pairs to a file at this point and then we'll pass that to runtest.cmd
1338 //If this is a crossgen build, pass 'crossgen' to runtest.cmd
1339 def crossgenStr = ''
1340 def runcrossgentestsStr = ''
1341 def runjitstressStr = ''
1342 def runjitstressregsStr = ''
1343 def runjitmioptsStr = ''
1344 def runjitforcerelocsStr = ''
1345 def runjitdisasmStr = ''
1346 def gcstressStr = ''
1347 def runtestArguments = ''
1348 def gcTestArguments = ''
1349 def illinkArguments = ''
1351 if (scenario == 'r2r' ||
1352 scenario == 'pri1r2r' ||
1353 scenario == 'gcstress15_pri1r2r' ||
1354 Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
1355 crossgenStr = 'crossgen'
1356 runcrossgentestsStr = 'runcrossgentests'
1358 if (scenario == 'r2r_jitstress1'){
1359 runjitstressStr = 'jitstress 1'
1361 else if (scenario == 'r2r_jitstress2') {
1362 runjitstressStr = 'jitstress 2'
1364 else if (scenario == 'r2r_jitstressregs1'){
1365 runjitstressregsStr = 'jitstressregs 1'
1367 else if (scenario == 'r2r_jitstressregs2') {
1368 runjitstressregsStr = 'jitstressregs 2'
1370 else if (scenario == 'r2r_jitstressregs3') {
1371 runjitstressregsStr = 'jitstressregs 3'
1373 else if (scenario == 'r2r_jitstressregs4') {
1374 runjitstressregsStr = 'jitstressregs 4'
1376 else if (scenario == 'r2r_jitstressregs8') {
1377 runjitstressregsStr = 'jitstressregs 8'
1379 else if (scenario == 'r2r_jitstressregs0x10') {
1380 runjitstressregsStr = 'jitstressregs 0x10'
1382 else if (scenario == 'r2r_jitstressregs0x80') {
1383 runjitstressregsStr = 'jitstressregs 0x80'
1385 else if (scenario == 'r2r_jitstressregs0x1000') {
1386 runjitstressregsStr = 'jitstressregs 0x1000'
1388 else if (scenario == 'r2r_jitminopts') {
1389 runjitmioptsStr = 'jitminopts'
1391 else if (scenario == 'r2r_jitforcerelocs') {
1392 runjitforcerelocsStr = 'jitforcerelocs'
1395 if (scenario == 'gcstress15_pri1r2r')
1397 gcstressStr = 'gcstresslevel 0xF'
1400 if (scenario == 'jitdiff')
1402 runjitdisasmStr = 'jitdisasm crossgen'
1405 if (isLongGc(scenario)) {
1406 gcTestArguments = "${scenario} sequential"
1409 if (scenario == 'illink')
1411 illinkArguments = "link %WORKSPACE%\\linker\\linker\\bin\\netcore_Release\\netcoreapp2.0\\win10-${arch}\\publish\\illink.exe"
1414 runtestArguments = "${lowerConfiguration} ${arch} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${runjitdisasmStr} ${gcTestArguments} ${illinkArguments} collectdumps"
1416 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
1417 def stepScriptLocation = "%WORKSPACE%\\SetStressModes.bat"
1418 buildCommands += genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], stepScriptLocation)
1420 if (enableCorefxTesting) {
1421 def workspaceRelativeFxRoot = "_/fx"
1422 def absoluteFxRoot = "%WORKSPACE%\\_\\fx"
1424 buildCommands += "python -u %WORKSPACE%\\tests\\scripts\\run-corefx-tests.py -arch ${arch} -build_type ${configuration} -fx_root ${absoluteFxRoot} -fx_branch ${branch} -env_script ${stepScriptLocation}"
1426 setTestJobTimeOut(newJob, scenario)
1428 // Archive and process (only) the test results
1429 Utilities.addArchival(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1430 Utilities.addXUnitDotNETResults(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1433 buildCommands += "%WORKSPACE%\\tests\\runtest.cmd ${runtestArguments} TestEnv ${stepScriptLocation}"
1436 else if (architecture == 'x64' || architecture == 'x86') {
1437 buildCommands += "tests\\runtest.cmd ${runtestArguments}"
1441 if (!enableCorefxTesting) {
1442 // Run the rest of the build
1443 // Build the mscorlib for the other OS's
1444 buildCommands += "build.cmd ${lowerConfiguration} ${arch} linuxmscorlib"
1445 buildCommands += "build.cmd ${lowerConfiguration} ${arch} freebsdmscorlib"
1446 buildCommands += "build.cmd ${lowerConfiguration} ${arch} osxmscorlib"
1448 // Zip up the tests directory so that we don't use so much space/time copying
1449 // 10s of thousands of files around.
1450 buildCommands += "powershell -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${arch}.${configuration}', '.\\bin\\tests\\tests.zip')\"";
1452 if (!Constants.jitStressModeScenarios.containsKey(scenario)) {
1453 // For windows, pull full test results and test drops for x86/x64.
1454 // No need to pull for stress mode scenarios (downstream builds use the default scenario)
1455 Utilities.addArchival(newJob, "bin/Product/**,bin/tests/tests.zip", "bin/Product/**/.nuget/**")
1458 if (scenario == 'jitdiff') {
1459 // retrive jit-dasm output for base commit, and run jit-diff
1461 // if this is a build only job, we want to keep the default (build) artifacts for the flow job
1462 Utilities.addArchival(newJob, "bin/tests/${osGroup}.${arch}.${configuration}/dasm/**")
1467 if (architecture == 'x64' || !isPR) {
1468 Utilities.addXUnitDotNETResults(newJob, 'bin/**/TestRun*.xml')
1470 setTestJobTimeOut(newJob, scenario)
1475 assert (scenario == 'default')
1478 setTestJobTimeOut(newJob, scenario)
1480 if ( lowerConfiguration == "debug" ) {
1481 // For Debug builds, we will do a P1 test build
1482 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} -priority=1"
1485 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture}"
1488 Utilities.addArchival(newJob, "bin/Product/**", "bin/Product/**/.nuget/**")
1491 assert (scenario == 'default') || (scenario == 'pri1r2r') || (scenario == 'gcstress0x3') || (scenario == 'gcstress0xc')
1494 setTestJobTimeOut(newJob, scenario)
1496 // Debug runs take too long to run. So build job only.
1497 if (lowerConfiguration == "debug") {
1498 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} toolset_dir C:\\ats2"
1501 if ((scenario != 'gcstress0x3') && (scenario != 'gcstress0xc'))
1503 // Up the timeout for arm64 checked testing only.
1504 // Keep the longer timeout for gcstress.
1505 Utilities.setJobTimeout(newJob, 240)
1508 buildCommands += "set __TestIntermediateDir=int&&build.cmd skiptests ${lowerConfiguration} ${architecture} toolset_dir C:\\ats2"
1509 // Test build and run are launched together.
1510 buildCommands += "python tests\\scripts\\arm64_post_build.py -repo_root %WORKSPACE% -arch ${architecture} -build_type ${lowerConfiguration} -scenario ${scenario} -key_location C:\\tools\\key.txt"
1511 //Utilities.addXUnitDotNETResults(newJob, 'bin/tests/testResults.xml')
1515 Utilities.addArchival(newJob, "bin/Product/**", "bin/Product/**/.nuget/**")
1518 println("Unknown architecture: ${architecture}");
1523 // editor brace matching: }
1532 case 'OpenSUSE42.1':
1534 case 'Fedora24': // editor brace matching: {
1535 switch (architecture) {
1538 if (architecture == 'x86' && os == 'Ubuntu') {
1539 // build and PAL test
1540 buildCommands += "./tests/scripts/x86_ci_script.sh --buildConfig=${lowerConfiguration}"
1541 Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
1545 if (scenario == 'formatting') {
1546 buildCommands += "python tests/scripts/format.py -c \${WORKSPACE} -o Linux -a ${architecture}"
1547 Utilities.addArchival(newJob, "format.patch", "", true, false)
1551 if (scenario == 'illink') {
1552 assert(os == 'Ubuntu')
1553 buildCommands += "./tests/scripts/build_illink.sh --clone --arch=${architecture}"
1556 def standaloneGc = ''
1557 if (scenario == 'standalone_gc') {
1558 standaloneGc = 'buildstandalonegc'
1561 if (!enableCorefxTesting) {
1562 // We run pal tests on all OS but generate mscorlib (and thus, nuget packages)
1563 // only on supported OS platforms.
1564 if (os == 'FreeBSD')
1566 buildCommands += "./build.sh skipmscorlib verbose ${lowerConfiguration} ${architecture} ${standaloneGc}"
1570 def bootstrapRid = Utilities.getBoostrapPublishRid(os)
1571 def bootstrapRidEnv = bootstrapRid != null ? "__PUBLISH_RID=${bootstrapRid} " : ''
1572 buildCommands += "${bootstrapRidEnv}./build.sh verbose ${lowerConfiguration} ${architecture} ${standaloneGc}"
1574 buildCommands += "src/pal/tests/palsuite/runpaltests.sh \${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration} \${WORKSPACE}/bin/paltestout"
1577 setTestJobTimeOut(newJob, scenario)
1578 // Basic archiving of the build
1579 Utilities.addArchival(newJob, "bin/Product/**,bin/obj/*/tests/**/*.dylib,bin/obj/*/tests/**/*.so", "bin/Product/**/.nuget/**")
1581 Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
1584 // Corefx stress testing
1585 assert os == 'Ubuntu'
1586 assert architecture == 'x64'
1587 assert lowerConfiguration == 'checked'
1588 assert Constants.jitStressModeScenarios.containsKey(scenario)
1591 buildCommands += "./build.sh verbose ${lowerConfiguration} ${architecture}"
1593 def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
1594 buildCommands += genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], scriptFileName)
1596 // Build and text corefx
1597 def workspaceRelativeFxRoot = "_/fx"
1598 def absoluteFxRoot = "\$WORKSPACE/${workspaceRelativeFxRoot}"
1600 buildCommands += "python -u \$WORKSPACE/tests/scripts/run-corefx-tests.py -arch ${architecture} -build_type ${configuration} -fx_root ${absoluteFxRoot} -fx_branch ${branch} -env_script ${scriptFileName}"
1602 setTestJobTimeOut(newJob, scenario)
1604 // Archive and process (only) the test results
1605 Utilities.addArchival(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1606 Utilities.addXUnitDotNETResults(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1610 // We don't run the cross build except on Ubuntu
1611 assert os == 'Ubuntu'
1613 buildCommands += """echo \"Using rootfs in /opt/aarch64-linux-gnu-root\"
1614 ROOTFS_DIR=/opt/aarch64-linux-gnu-root ./build.sh skipmscorlib arm64 cross verbose ${lowerConfiguration}"""
1616 // Basic archiving of the build, no pal tests
1617 Utilities.addArchival(newJob, "bin/Product/**", "bin/Product/**/.nuget/**")
1620 // Cross builds for ARM runs on Ubuntu, Ubuntu16.04 and Tizen currently
1621 assert (os == 'Ubuntu') || (os == 'Ubuntu16.04') || (os == 'Tizen')
1623 // default values for Ubuntu
1625 def linuxCodeName="trusty"
1626 if (os == 'Ubuntu16.04') {
1627 linuxCodeName="xenial"
1629 else if (os == 'Tizen') {
1631 linuxCodeName="tizen"
1634 // Unzip the Windows test binaries first. Exit with 0
1635 buildCommands += "unzip -q -o ./bin/tests/tests.zip -d ./bin/tests/Windows_NT.x64.${configuration} || exit 0"
1637 // Unpack the corefx binaries
1638 buildCommands += "mkdir ./bin/CoreFxBinDir"
1639 buildCommands += "tar -xf ./bin/build.tar.gz -C ./bin/CoreFxBinDir"
1640 if (os != 'Tizen') {
1641 buildCommands += "chmod a+x ./bin/CoreFxBinDir/corerun"
1643 // Test environment emulation using docker and qemu has some problem to use lttng library.
1644 // We should remove libcoreclrtraceptprovider.so to avoid test hang.
1645 if (os == 'Ubuntu') {
1646 buildCommands += "rm -f -v ./bin/CoreFxBinDir/libcoreclrtraceptprovider.so"
1649 // Call the ARM CI script to cross build and test using docker
1650 buildCommands += """./tests/scripts/arm32_ci_script.sh \\
1653 --linuxCodeName=${linuxCodeName} \\
1654 --buildConfig=${lowerConfiguration} \\
1655 --testRootDir=./bin/tests/Windows_NT.x64.${configuration} \\
1656 --coreFxBinDir=./bin/CoreFxBinDir \\
1657 --testDirFile=./tests/testsRunningInsideARM.txt"""
1659 // Basic archiving of the build, no pal tests
1660 Utilities.addArchival(newJob, "bin/Product/**", "bin/Product/**/.nuget/**")
1663 println("Unknown architecture: ${architecture}");
1668 // editor brace matching: }
1670 println("Unknown os: ${os}");
1675 return buildCommands
1678 // Additional scenario which can alter behavior
1680 def combinedScenarios = Constants.basicScenarios + Constants.jitStressModeScenarios.keySet()
1681 combinedScenarios.each { scenario ->
1682 [true, false].each { isPR ->
1683 Constants.architectureList.each { architecture ->
1684 Constants.configurationList.each { configuration ->
1685 Constants.osList.each { os ->
1686 // If the OS is Windows_NT_BuildOnly, set the isBuildOnly flag to true
1687 // and reset the os to Windows_NT
1688 def isBuildOnly = false
1689 if (os == 'Windows_NT_BuildOnly') {
1694 // WinArm32 is only built for Debug and Release
1695 if (os == 'Windows_NT' && architecture == 'arm')
1697 if (configuration == 'Checked')
1702 // Tizen is only supported for arm architecture
1703 if (os == 'Tizen' && architecture != 'arm') {
1707 // Skip totally unimplemented (in CI) configurations.
1708 switch (architecture) {
1711 if (os != 'Windows_NT' || isBuildOnly) {
1716 if ((os != 'Ubuntu') && (os != 'Ubuntu16.04') && (os != 'Tizen') && (os != 'Windows_NT')) {
1721 if ((os != 'Ubuntu') && (os != 'Windows_NT')) {
1726 // Everything implemented
1729 println("Unknown architecture: ${architecture}")
1734 // Skip scenarios (blanket skipping for jit stress modes, which are good most everywhere
1735 // with checked builds
1736 def enableCorefxTesting = false
1737 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
1738 if (configuration != 'Checked') {
1742 enableCorefxTesting = isCorefxTesting(scenario)
1744 // Since these are just execution time differences,
1745 // skip platforms that don't execute the tests here (Windows_NT only)
1746 def isEnabledOS = (os == 'Windows_NT') || (os == 'Ubuntu' && enableCorefxTesting)
1747 if (!isEnabledOS || isBuildOnly) {
1751 switch (architecture) {
1753 if ((scenario != 'gcstress0x3') && (scenario != 'gcstress0xc')) {
1759 // x86 ubuntu: default only
1760 if ((os == 'Ubuntu') && (architecture == 'x86')) {
1763 // Windows: Everything implemented
1770 // If this is a r2r jitstress, jitstressregs, jitminopts, or forcerelocs scenario
1771 // and configuration is not Checked, bail out.
1772 if (configuration != 'Checked' && Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
1779 // The pri1 build isn't necessary except for Windows_NT. Non-Windows NT uses
1780 // the default scenario build
1781 if (os != 'Windows_NT') {
1785 if (architecture != 'x64') {
1790 // The ilrt build isn't necessary except for Windows_NT. Non-Windows NT uses
1791 // the default scenario build
1792 if (os != 'Windows_NT') {
1796 if (architecture != 'x64') {
1800 if (configuration != 'Release') {
1805 if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
1808 if (architecture != 'x64') {
1811 if (configuration != 'Checked') {
1816 // The r2r build isn't necessary except for Windows_NT. Non-Windows NT uses
1817 // the default scenario build
1818 if (os != 'Windows_NT') {
1821 if (architecture != 'x64') {
1826 // The pri1r2r build isn't necessary except for Windows_NT. Non-Windows NT uses
1827 // the default scenario build
1828 if (os != 'Windows_NT') {
1831 if (architecture != 'x64') {
1832 if (architecture != 'arm64' || configuration == 'Debug') {
1837 case 'gcstress15_pri1r2r':
1838 case 'r2r_jitstress1':
1839 case 'r2r_jitstress2':
1840 case 'r2r_jitstressregs1':
1841 case 'r2r_jitstressregs2':
1842 case 'r2r_jitstressregs3':
1843 case 'r2r_jitstressregs4':
1844 case 'r2r_jitstressregs8':
1845 case 'r2r_jitstressregs0x10':
1846 case 'r2r_jitstressregs0x80':
1847 case 'r2r_jitstressregs0x1000':
1848 case 'r2r_jitminopts':
1849 case 'r2r_jitforcerelocs':
1850 // The above builds are not necessary except for Windows_NT. Non-Windows NT uses
1851 // the default scenario build
1852 if (os != 'Windows_NT') {
1855 if (architecture != 'x64') {
1861 if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
1864 if (architecture != 'x64') {
1867 if (configuration != 'Release') {
1871 case 'standalone_gc':
1872 if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
1876 if (architecture != 'x64') {
1880 if (configuration != 'Release' && configuration != 'Checked') {
1884 // We need Windows x64 Release bits for the code coverage build
1886 if (os != 'Windows_NT') {
1889 if (architecture != 'x64') {
1892 if (configuration != 'Release') {
1896 // We only run Windows and Ubuntu x64 Checked for formatting right now
1898 if (os != 'Windows_NT' && os != 'Ubuntu') {
1901 if (architecture != 'x64') {
1904 if (configuration != 'Checked') {
1912 if (os != 'Windows_NT' && (os != 'Ubuntu' || architecture != 'x64')) {
1915 if (architecture != 'x64' && architecture != 'x86') {
1926 println("Unknown scenario: ${scenario}")
1933 def lowerConfiguration = configuration.toLowerCase()
1934 def jobName = getJobName(configuration, architecture, os, scenario, isBuildOnly)
1935 def folderName = getJobFolder(scenario)
1937 // Create the new job
1938 def newJob = job(Utilities.getFullJobName(project, jobName, isPR, folderName)) {}
1940 setMachineAffinity(newJob, os, architecture)
1942 // Add all the standard options
1943 Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
1944 addTriggers(newJob, branch, isPR, architecture, os, configuration, scenario, false, isBuildOnly)
1946 def buildCommands = calculateBuildCommands(newJob, scenario, branch, isPR, architecture, configuration, os, enableCorefxTesting, isBuildOnly)
1947 def osGroup = getOSGroup(os)
1951 if (os == 'Windows_NT') {
1952 buildCommands.each { buildCommand ->
1953 batchFile(buildCommand)
1957 // Setup corefx and Windows test binaries for Linux cross build for ubuntu-arm, ubuntu16.04-arm and tizen-armel
1958 if ( architecture == 'arm' && ( os == 'Ubuntu' || os == 'Ubuntu16.04' || os == 'Tizen')) {
1959 // Cross build for ubuntu-arm, ubuntu16.04-arm and tizen-armel
1960 // Define the Windows Tests and Corefx build job names
1961 def WindowTestsName = projectFolder + '/' +
1962 Utilities.getFullJobName(project,
1963 getJobName(lowerConfiguration,
1969 def corefxFolder = Utilities.getFolderName('dotnet/corefx') + '/' +
1970 Utilities.getFolderName(branch)
1972 // Copy the Windows test binaries and the Corefx build binaries
1973 copyArtifacts(WindowTestsName) {
1974 excludePatterns('**/testResults.xml', '**/*.ni.dll')
1976 latestSuccessful(true)
1980 // Defaults for Ubuntu
1982 def corefx_os = 'ubuntu14.04'
1983 if (os == 'Ubuntu16.04') {
1985 corefx_os = 'ubuntu16.04'
1987 else if (os == 'Tizen') {
1992 // Let's use release CoreFX to test checked CoreCLR,
1993 // because we do not generate checked CoreFX in CoreFX CI yet.
1994 def corefx_lowerConfiguration = lowerConfiguration
1995 if ( lowerConfiguration == 'checked' ) {
1996 corefx_lowerConfiguration='release'
1998 copyArtifacts("${corefxFolder}/${corefx_os}_${arm_abi}_cross_${corefx_lowerConfiguration}") {
1999 includePatterns('bin/build.tar.gz')
2001 latestSuccessful(true)
2006 buildCommands.each { buildCommand ->
2020 // Create the Linux/OSX/CentOS coreclr test leg for debug and release and each scenario
2021 combinedScenarios.each { scenario ->
2022 [true, false].each { isPR ->
2023 // Architectures. x64 only at this point
2024 ['x64'].each { architecture ->
2025 // Put the OS's supported for coreclr cross testing here
2026 Constants.crossList.each { os ->
2027 Constants.configurationList.each { configuration ->
2029 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
2030 if (configuration != 'Checked') {
2033 if (isCorefxTesting(scenario)) {
2036 //Skip stress modes for these scenarios
2037 if (os == 'RHEL7.2' || os == 'Debian8.4') {
2041 // If this is a r2r jitstress, jitstressregs, jitminopts or forcerelocs scenario
2042 // and configuration is not Checked, bail out.
2043 else if (configuration != 'Checked' && Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
2046 // For CentOS, we only want Checked/Release pri1 builds.
2047 else if (os == 'CentOS7.1') {
2048 if (scenario != 'pri1' &&
2049 scenario != 'r2r' &&
2050 scenario != 'pri1r2r' &&
2051 scenario != 'gcstress15_pri1r2r' &&
2052 Constants.r2rJitStressScenarios.indexOf(scenario) == -1) {
2055 if (configuration != 'Checked' && configuration != 'Release') {
2059 // For RedHat and Debian, we only do Release pri1 builds.
2060 else if (os == 'RHEL7.2' || os == 'Debian8.4') {
2061 if (scenario != 'pri1') {
2064 if (configuration != 'Release') {
2076 if (configuration != 'Release') {
2081 if (configuration != 'Checked') {
2085 //Skip configs that aren't Checked or Release (so just Debug, for now)
2086 if (configuration != 'Checked' && configuration != 'Release') {
2091 //Skip configs that aren't Checked or Release (so just Debug, for now)
2092 if (configuration != 'Checked' && configuration != 'Release') {
2096 case 'gcstress15_pri1r2r':
2097 case 'r2r_jitstress1':
2098 case 'r2r_jitstress2':
2099 case 'r2r_jitstressregs1':
2100 case 'r2r_jitstressregs2':
2101 case 'r2r_jitstressregs3':
2102 case 'r2r_jitstressregs4':
2103 case 'r2r_jitstressregs8':
2104 case 'r2r_jitstressregs0x10':
2105 case 'r2r_jitstressregs0x80':
2106 case 'r2r_jitstressregs0x1000':
2107 case 'r2r_jitminopts':
2108 case 'r2r_jitforcerelocs':
2109 //Skip configs that aren't Checked or Release (so just Debug, for now)
2110 if (configuration != 'Checked' && configuration != 'Release') {
2116 // Long GC tests take a long time on non-Release builds
2117 if (configuration != 'Release') {
2121 case 'standalone_gc':
2122 if (configuration != 'Release' && configuration != 'Checked') {
2126 //We only want Ubuntu Release for coverage
2127 if (os != 'Ubuntu') {
2130 if (configuration != 'Release') {
2136 if (os != 'Windows_NT' && os != 'Ubuntu') {
2144 println("Unknown scenario: ${scenario}")
2150 def lowerConfiguration = configuration.toLowerCase()
2151 def osGroup = getOSGroup(os)
2152 def jobName = getJobName(configuration, architecture, os, scenario, false) + "_tst"
2154 // Unless this is a coverage test run, we want to copy over the default build of coreclr.
2155 def inputScenario = 'default'
2156 if (scenario == 'coverage') {
2157 inputScenario = 'coverage'
2159 def inputCoreCLRBuildName = projectFolder + '/' +
2160 Utilities.getFullJobName(project, getJobName(configuration, architecture, os, inputScenario, false), isPR)
2161 // If this is a stress scenario, there isn't any difference in the build job
2162 // so we didn't create a build only job for windows_nt specific to that stress mode. Just copy
2163 // from the default scenario
2164 def testBuildScenario = scenario
2165 if (testBuildScenario == 'coverage' || testBuildScenario == 'pri1r2r'|| testBuildScenario == 'gcstress15_pri1r2r') {
2166 testBuildScenario = 'pri1'
2168 else if ( testBuildScenario == 'r2r' || isLongGc(testBuildScenario)) {
2169 testBuildScenario = 'default'
2171 def inputWindowTestsBuildName = ''
2172 if (Constants.jitStressModeScenarios.containsKey(testBuildScenario)) {
2173 inputWindowTestsBuildName = projectFolder + '/' +
2174 Utilities.getFullJobName(project, getJobName(configuration, architecture, 'windows_nt', 'default', true), isPR)
2177 inputWindowTestsBuildName = projectFolder + '/' +
2178 Utilities.getFullJobName(project, getJobName(configuration, architecture, 'windows_nt', testBuildScenario, true), isPR)
2180 // Enable Server GC for Ubuntu PR builds
2181 def serverGCString = ''
2183 // Whether or not this test run should be run sequentially instead
2184 // of in parallel. Only used for long GC tests.
2185 def sequentialString = ''
2187 // Whether or not this test run should run a specific playlist.
2188 // Only used for long GC tests.
2190 // A note - runtest.sh does have "--long-gc" and "--gcsimulator" options
2191 // for running long GC and GCSimulator tests, respectively. We don't use them
2192 // here because using a playlist file produces much more readable output on the CI machines
2193 // and reduces running time.
2194 def playlistString = ''
2196 if (os == 'Ubuntu' && isPR){
2197 serverGCString = '--useServerGC'
2200 // pass --crossgen to runtest.sh for crossgen builds
2201 def crossgenStr = ''
2202 def runcrossgentestsStr = ''
2203 def runjitstressStr = ''
2204 def runjitstressregsStr = ''
2205 def runjitmioptsStr = ''
2206 def runjitforcerelocsStr = ''
2207 def runjitdisasmStr = ''
2208 def gcstressStr = ''
2211 if (scenario == 'r2r' ||
2212 scenario == 'pri1r2r' ||
2213 scenario == 'gcstress15_pri1r2r' ||
2214 Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
2215 crossgenStr = '--crossgen'
2216 runcrossgentestsStr = '--runcrossgentests'
2218 if (scenario == 'r2r_jitstress1'){
2219 runjitstressStr = '--jitstress=1'
2221 else if (scenario == 'r2r_jitstress2') {
2222 runjitstressStr = '--jitstress=2'
2224 else if (scenario == 'r2r_jitstressregs1'){
2225 runjitstressregsStr = '--jitstressregs=1'
2227 else if (scenario == 'r2r_jitstressregs2') {
2228 runjitstressregsStr = '--jitstressregs=2'
2230 else if (scenario == 'r2r_jitstressregs3') {
2231 runjitstressregsStr = '--jitstressregs=3'
2233 else if (scenario == 'r2r_jitstressregs4') {
2234 runjitstressregsStr = '--jitstressregs=4'
2236 else if (scenario == 'r2r_jitstressregs8') {
2237 runjitstressregsStr = '--jitstressregs=8'
2239 else if (scenario == 'r2r_jitstressregs0x10') {
2240 runjitstressregsStr = '--jitstressregs=0x10'
2242 else if (scenario == 'r2r_jitstressregs0x80') {
2243 runjitstressregsStr = '--jitstressregs=0x80'
2245 else if (scenario == 'r2r_jitstressregs0x1000') {
2246 runjitstressregsStr = '--jitstressregs=0x1000'
2248 else if (scenario == 'r2r_jitminopts') {
2249 runjitmioptsStr = '--jitminopts'
2251 else if (scenario == 'r2r_jitforcerelocs') {
2252 runjitforcerelocsStr = '--jitforcerelocs'
2255 if (scenario == 'gcstress15_pri1r2r')
2257 gcstressStr = '--gcstresslevel=0xF'
2260 if (scenario == 'jitdiff')
2262 runjitdisasmStr = '--jitdisasm --crossgen'
2265 if (scenario == 'illink')
2267 illinkStr = '--link=\$WORKSPACE/linker/linker/bin/netcore_Release/netcoreapp2.0/ubuntu-x64/publish/illink'
2270 if (isLongGc(scenario)) {
2271 // Long GC tests behave very poorly when they are not
2272 // the only test running (many of them allocate until OOM).
2273 sequentialString = '--sequential'
2275 // The Long GC playlist contains all of the tests that are
2276 // going to be run. The GCSimulator playlist contains all of
2277 // the GC simulator tests.
2278 if (scenario == 'longgc') {
2279 playlistString = '--long-gc --playlist=./tests/longRunningGcTests.txt'
2281 else if (scenario == 'gcsimulator') {
2282 playlistString = '--gcsimulator --playlist=./tests/gcSimulatorTests.txt'
2286 def folder = getJobFolder(scenario)
2287 def newJob = job(Utilities.getFullJobName(project, jobName, isPR, folder)) {
2288 // Add parameters for the inputs
2291 stringParam('CORECLR_WINDOWS_BUILD', '', 'Build number to copy CoreCLR windows test binaries from')
2292 stringParam('CORECLR_BUILD', '', "Build number to copy CoreCLR ${osGroup} binaries from")
2296 // Set up the copies
2298 // Coreclr build containing the tests and mscorlib
2300 copyArtifacts(inputWindowTestsBuildName) {
2301 excludePatterns('**/testResults.xml', '**/*.ni.dll')
2303 buildNumber('${CORECLR_WINDOWS_BUILD}')
2307 if (scenario == 'coverage') {
2309 // Move coreclr to clr directory
2310 shell("rm -rf .clr; mkdir .clr; mv * .clr; mv .git .clr; mv .clr clr")
2313 shell("./clr/build.sh coverage verbose ${lowerConfiguration} ${architecture}")
2315 // Remove folders from obj that we don't expect to be covered. May update this later.
2316 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/ToolBox")
2317 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/debug")
2318 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/ilasm")
2319 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/ildasm")
2320 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/dlls/dbgshim")
2321 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/dlls/mscordac")
2322 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/dlls/mscordbi")
2325 shell("./clr/src/pal/tests/palsuite/runpaltests.sh \$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration} \$(pwd)/clr/bin/paltestout")
2327 // Remove obj files for PAL tests so they're not included in coverage results
2328 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/pal/tests")
2330 // Unzip the tests first. Exit with 0
2331 shell("unzip -q -o ./clr/bin/tests/tests.zip -d ./clr/bin/tests/Windows_NT.${architecture}.${configuration} || exit 0")
2334 shell("git clone https://github.com/dotnet/corefx fx")
2336 // Build Linux corefx
2337 shell("./fx/build-native.sh -release -buildArch=x64 -os=Linux")
2338 shell("./fx/build-managed.sh -release -buildArch=x64 -osgroup=Linux -skiptests")
2341 def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
2342 def createScriptCmds = genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios['heapverify1'], scriptFileName)
2343 shell("${createScriptCmds}")
2344 testEnvOpt = "--test-env=" + scriptFileName
2347 shell("""./fx/run-test.sh \\
2348 --coreclr-bins \$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration} \\
2349 --mscorlib-bins \$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration} \\
2350 --corefx-tests \$(pwd)/fx/bin/tests/${osGroup}.AnyCPU.${configuration} \\
2351 --corefx-native-bins \$(pwd)/fx/bin/${osGroup}.${architecture}.${configuration} \\
2352 --configurationGroup Release""")
2355 // Run coreclr tests w/ workstation GC
2356 shell("""./clr/tests/runtest.sh \\
2357 --testRootDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2358 --testNativeBinDir=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2359 --coreClrBinDir=\"\$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2360 --mscorlibDir=\"\$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2361 --coreFxBinDir=\"\$(pwd)/fx/bin/runtime/netcoreapp-${osGroup}-Release-${architecture}\" \\
2362 --crossgen --runcrossgentests""")
2364 // Run coreclr tests w/ server GC & HeapVerify enabled
2365 shell("""./clr/tests/runtest.sh \\
2366 --testRootDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2367 --testNativeBinDir=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2368 --coreOverlayDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}/Tests/coreoverlay\" \\
2369 --useServerGC ${testEnvOpt}""")
2371 // Run long-running coreclr GC tests & produce coverage reports
2372 shell("""./clr/tests/runtest.sh \\
2373 --testRootDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2374 --testNativeBinDir=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2375 --coreOverlayDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}/Tests/coreoverlay\" \\
2376 --long-gc --playlist=\"\$(pwd)/clr/tests/longRunningGcTests.txt\" --coreclr-coverage\\
2377 --coreclr-objs=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}\" \\
2378 --coreclr-src=\"\$(pwd)/clr/src\" \\
2379 --coverage-output-dir=\"\${WORKSPACE}/coverage\" """)
2384 // Coreclr build we are trying to test
2386 copyArtifacts(inputCoreCLRBuildName) {
2387 excludePatterns('**/testResults.xml', '**/*.ni.dll')
2389 buildNumber('${CORECLR_BUILD}')
2393 def corefxFolder = Utilities.getFolderName('dotnet/corefx') + '/' + Utilities.getFolderName(branch)
2395 // Corefx components. We now have full stack builds on all distros we test here, so we can copy straight from CoreFX jobs.
2397 if (os == 'Ubuntu') {
2398 osJobName = 'ubuntu14.04'
2401 osJobName = os.toLowerCase()
2403 copyArtifacts("${corefxFolder}/${osJobName}_release") {
2404 includePatterns('bin/build.tar.gz')
2406 latestSuccessful(true)
2410 shell ("mkdir ./bin/CoreFxBinDir")
2411 // Unpack the corefx binaries
2412 shell("tar -xf ./bin/build.tar.gz -C ./bin/CoreFxBinDir")
2414 // Unzip the tests first. Exit with 0
2415 shell("unzip -q -o ./bin/tests/tests.zip -d ./bin/tests/Windows_NT.${architecture}.${configuration} || exit 0")
2417 // Execute the tests
2418 // If we are running a stress mode, we'll set those variables first
2420 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
2421 def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
2422 def createScriptCmds = genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], scriptFileName)
2423 shell("${createScriptCmds}")
2424 testEnvOpt = "--test-env=" + scriptFileName
2427 if (isGCStressRelatedTesting(scenario)) {
2428 shell('./init-tools.sh')
2431 shell("""./tests/runtest.sh \\
2432 --testRootDir=\"\${WORKSPACE}/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2433 --testNativeBinDir=\"\${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2434 --coreClrBinDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2435 --mscorlibDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2436 --coreFxBinDir=\"\${WORKSPACE}/bin/CoreFxBinDir\" \\
2437 --limitedDumpGeneration \\
2438 ${testEnvOpt} ${serverGCString} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${runjitdisasmStr} ${illinkStr} ${sequentialString} ${playlistString}""")
2443 if (scenario == 'coverage') {
2444 // Publish coverage reports
2445 Utilities.addHtmlPublisher(newJob, '${WORKSPACE}/coverage/Coverage/reports', 'Code Coverage Report', 'coreclr.html')
2446 // TODO: Add once external email sending is available again
2447 // addEmailPublisher(newJob, 'clrcoverage@microsoft.com')
2450 if (scenario == 'jitdiff') {
2451 Utilities.addArchival(newJob, "bin/tests/${osGroup}.${architecture}.${configuration}/dasm/**")
2454 // Experimental: If on Ubuntu 14.04, then attempt to pull in crash dump links
2455 if (os in ['Ubuntu']) {
2456 SummaryBuilder summaries = new SummaryBuilder()
2457 summaries.addLinksSummaryFromFile('Crash dumps from this run:', 'dumplings.txt')
2458 summaries.emit(newJob)
2461 setMachineAffinity(newJob, os, architecture)
2462 Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
2463 // Set timeouts to 240.
2464 setTestJobTimeOut(newJob, scenario)
2465 Utilities.addXUnitDotNETResults(newJob, '**/coreclrtests.xml')
2467 // Create a build flow to join together the build and tests required to run this
2469 // Windows CoreCLR build and Linux CoreCLR build (in parallel) ->
2470 // Linux CoreCLR test
2471 def flowJobName = getJobName(configuration, architecture, os, scenario, false) + "_flow"
2472 def fullTestJobName = projectFolder + '/' + newJob.name
2473 // Add a reference to the input jobs for report purposes
2474 JobReport.Report.addReference(inputCoreCLRBuildName)
2475 JobReport.Report.addReference(inputWindowTestsBuildName)
2476 JobReport.Report.addReference(fullTestJobName)
2479 // If this is a coverage job, we don't copy any input coreCLR build - instead, we build it as part of the flow job,
2480 // so that coverage data can be preserved.
2481 if (scenario == 'coverage') {
2482 newFlowJob = buildFlowJob(Utilities.getFullJobName(project, flowJobName, isPR, folder)) {
2484 // Build the input Windows job
2485 windowsBuildJob = build(params, '${inputWindowTestsBuildName}')
2487 // And then build the test build
2488 build(params + [CORECLR_WINDOWS_BUILD: windowsBuildJob.build.number], '${fullTestJobName}')
2491 // Normal jobs copy a Windows build & a non-Windows build
2493 newFlowJob = buildFlowJob(Utilities.getFullJobName(project, flowJobName, isPR, folder)) {
2495 // Build the input jobs in parallel
2497 { coreclrBuildJob = build(params, '${inputCoreCLRBuildName}') },
2498 { windowsBuildJob = build(params, '${inputWindowTestsBuildName}') }
2501 // And then build the test build
2502 build(params + [CORECLR_BUILD: coreclrBuildJob.build.number,
2503 CORECLR_WINDOWS_BUILD: windowsBuildJob.build.number], '${fullTestJobName}')
2508 setMachineAffinity(newFlowJob, os, architecture)
2509 Utilities.standardJobSetup(newFlowJob, project, isPR, "*/${branch}")
2510 addTriggers(newFlowJob, branch, isPR, architecture, os, configuration, scenario, true, false)
2517 JobReport.Report.generateJobReport(out)
2519 // Make the call to generate the help job
2520 Utilities.createHelperJob(this, project, branch,
2521 "Welcome to the ${project} Repository", // This is prepended to the help message
2522 "Have a nice day!") // This is appended to the help message. You might put known issues here.
2524 Utilities.addCROSSCheck(this, project, branch)