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');
161 Utilities.setMachineAffinity(job, os, 'latest-or-auto');
165 def static isJITStressJob(def scenario) {
166 return Constants.jitStressModeScenarios.containsKey(scenario) ||
167 (Constants.r2rJitStressScenarios.indexOf(scenario) != -1)
170 def static isGCStressRelatedTesting(def scenario) {
171 // The 'gcstress15_pri1r2r' scenario is a basic scenario.
172 // Detect it and make it a GCStress related.
173 if (scenario == 'gcstress15_pri1r2r')
178 def gcStressTestEnvVars = [ 'COMPlus_GCStress', 'COMPlus_ZapDisable', 'COMPlus_HeapVerify']
179 def scenarioName = scenario.toLowerCase()
180 def isGCStressTesting = false
181 Constants.jitStressModeScenarios[scenario].each{ k, v ->
182 if (k in gcStressTestEnvVars) {
183 isGCStressTesting = true;
186 return isGCStressTesting
189 def static isCorefxTesting(def scenario) {
190 def corefx_prefix = 'corefx_'
191 if (scenario.length() < corefx_prefix.length()) {
194 return scenario.substring(0,corefx_prefix.length()) == corefx_prefix
197 def static isR2R(def scenario) {
198 return (scenario == 'r2r' || scenario == 'pri1r2r')
201 def static isCoverage(def scenario) {
202 return (scenario == 'coverage')
205 def static isLongGc(def scenario) {
206 return (scenario == 'longgc' || scenario == 'gcsimulator')
209 def static isJitDiff(def scenario) {
210 return (scenario == 'jitdiff')
213 def static isGcReliabilityFramework(def scenario) {
214 return (scenario == 'gc_reliability_framework')
217 def static scenarioNeedsPri1Build(def scenario) {
218 return (scenario == 'pri1' || scenario == 'pri1r2r' || scenario == 'gcstress15_pri1r2r'|| scenario == 'coverage' || isGcReliabilityFramework(scenario))
221 def static setTestJobTimeOut(newJob, scenario) {
222 if (isGCStressRelatedTesting(scenario)) {
223 Utilities.setJobTimeout(newJob, 4320)
225 else if (isCorefxTesting(scenario)) {
226 Utilities.setJobTimeout(newJob, 360)
228 else if (Constants.jitStressModeScenarios.containsKey(scenario)) {
229 Utilities.setJobTimeout(newJob, 240)
231 else if (isR2R(scenario)) {
232 Utilities.setJobTimeout(newJob, 240)
234 else if (isCoverage(scenario)) {
235 Utilities.setJobTimeout(newJob, 1440)
237 else if (isLongGc(scenario)) {
238 Utilities.setJobTimeout(newJob, 1440)
240 else if (isJitDiff(scenario)) {
241 Utilities.setJobTimeout(newJob, 240)
243 else if (isGcReliabilityFramework(scenario)) {
244 Utilities.setJobTimeout(newJob, 1440)
246 // Non-test jobs use the default timeout value.
249 def static getJobFolder(def scenario) {
250 if (isJITStressJob(scenario)) {
253 if (scenario == 'illink') {
259 def static getStressModeDisplayName(def scenario) {
261 Constants.jitStressModeScenarios[scenario].each{ k, v ->
262 def prefixLength = 'COMPlus_'.length()
263 if (k.length() >= prefixLength) {
264 def modeName = k.substring(prefixLength, k.length())
265 displayStr += ' ' + modeName + '=' + v
271 def static getR2RStressModeDisplayName(def scenario) {
272 // Assume the scenario name is one from the r2rJitStressScenarios list, and remove its
274 def displayStr = scenario
275 def prefixLength = 'r2r_'.length()
276 if (displayStr.length() >= prefixLength) {
277 displayStr = displayStr.substring(prefixLength, displayStr.length())
282 // Generates the string for creating a file that sets environment variables
283 // that makes it possible to run stress modes. Writes the script to the file
284 // specified by the stepScriptLocation parameter.
285 def static genStressModeScriptStep(def os, def stressModeName, def stressModeVars, def stepScriptLocation) {
287 if (os == 'Windows_NT') {
288 stepScript += "echo Creating TestEnv Script for ${stressModeName}\r\n"
289 stepScript += "del ${stepScriptLocation}\r\n"
291 // Timeout in ms, default is 10 minutes. For stress
292 // modes up this to 30 minutes
293 def timeout = 1800000
296 stepScript += "set __TestTimeout=${timeout}\r\n"
297 stepScript += "echo. > ${stepScriptLocation}\r\n"
298 stressModeVars.each{ k, v ->
299 // Write out what we are writing to the script file
300 stepScript += "echo Setting ${k}=${v}\r\n"
301 // Write out the set itself to the script file`
302 stepScript += "echo set ${k}=${v} >> ${stepScriptLocation}\r\n"
306 stepScript += "echo Setting variables for ${stressModeName}\n"
307 stepScript += "echo \\#\\!/usr/bin/env bash > ${stepScriptLocation}\n"
308 stressModeVars.each{ k, v ->
309 // Write out what we are writing to the script file
310 stepScript += "echo Setting ${k}=${v}\n"
311 // Write out the set itself to the script file`
312 stepScript += "echo export ${k}=${v} >> ${stepScriptLocation}\n"
314 stepScript += "chmod +x ${stepScriptLocation}\n"
319 // Calculates the name of the build job based on some typical parameters.
321 def static getJobName(def configuration, def architecture, def os, def scenario, def isBuildOnly) {
322 // If the architecture is x64, do not add that info into the build name.
323 // Need to change around some systems and other builds to pick up the right builds
326 def suffix = scenario != 'default' ? "_${scenario}" : '';
331 switch (architecture) {
333 if (scenario == 'default') {
334 // For now we leave x64 off of the name for compatibility with other jobs
335 baseName = configuration.toLowerCase() + '_' + os.toLowerCase()
337 else if (scenario == 'formatting') {
338 // we don't care about the configuration for the formatting job. It runs all configs
339 baseName = architecture.toLowerCase() + '_' + os.toLowerCase()
342 baseName = architecture.toLowerCase() + '_' + configuration.toLowerCase() + '_' + os.toLowerCase()
346 if (os.toLowerCase() == "windows_nt") {
347 // These are cross builds
348 baseName = architecture.toLowerCase() + '_cross_' + configuration.toLowerCase() + '_' + os.toLowerCase()
351 // Defaults to a small page size set of machines.
352 baseName = architecture.toLowerCase() + '_' + configuration.toLowerCase() + '_' + "small_page_size"
356 // These are cross builds
359 baseName = 'armel_cross_' + configuration.toLowerCase() + '_' + os.toLowerCase()
362 baseName = architecture.toLowerCase() + '_cross_' + configuration.toLowerCase() + '_' + os.toLowerCase()
367 baseName = architecture.toLowerCase() + '_' + configuration.toLowerCase() + '_' + os.toLowerCase()
370 println("Unknown architecture: ${architecture}");
375 return baseName + suffix
378 def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def os, def configuration, def scenario, def isFlowJob, def isWindowsBuildOnlyJob, def bidailyCrossList) {
382 switch (architecture) {
386 if (architecture == 'x86' && os == 'Ubuntu') {
387 Utilities.addPeriodicTrigger(job, '@daily')
389 else if (isFlowJob || os == 'Windows_NT' || !(os in Constants.crossList)) {
390 Utilities.addGithubPushTrigger(job)
394 Utilities.addGithubPushTrigger(job)
397 Utilities.addGithubPushTrigger(job)
400 println("Unknown architecture: ${architecture}");
406 // Pri one gets a push trigger, and only for release
407 if (architecture == 'x64') {
408 if (configuration == 'Release') {
409 // We expect release jobs to be Windows, or in the cross list
410 assert (os == 'Windows_NT') || (os in Constants.crossList)
411 if (!os in bidailyCrossList) {
412 if (isFlowJob || os == 'Windows_NT') {
413 Utilities.addGithubPushTrigger(job)
418 Utilities.addPeriodicTrigger(job, 'H H/12 * * *')
425 //r2r jobs that aren't pri1 can only be triggered by phrase
428 assert !(os in bidailyCrossList)
429 //pri1 r2r gets a push trigger for checked/release
430 if (configuration == 'Checked' || configuration == 'Release') {
431 assert (os == 'Windows_NT') || (os in Constants.crossList)
432 if (architecture == 'x64' && os != 'OSX10.12') {
433 //Flow jobs should be Windows, Ubuntu, OSX0.12, or CentOS
434 if (isFlowJob || os == 'Windows_NT') {
435 Utilities.addGithubPushTrigger(job)
437 // OSX10.12 pri1r2r jobs should only run every 12 hours, not daily.
438 } else if (architecture == 'x64' && os == 'OSX10.12'){
440 Utilities.addPeriodicTrigger(job, 'H H/12 * * *')
443 // For x86, only add per-commit jobs for Windows
444 else if (architecture == 'x86' || architecture == 'x86lb') {
445 if (os == 'Windows_NT') {
446 Utilities.addGithubPushTrigger(job)
449 // arm64 pri1r2r jobs should only run every 12 hours.
450 else if (architecture == 'arm64') {
451 if (os == 'Windows_NT') {
452 Utilities.addPeriodicTrigger(job, 'H H/12 * * *')
453 // TODO: Add once external email sending is available again
454 // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
459 case 'r2r_jitstress1':
460 case 'r2r_jitstress2':
461 case 'r2r_jitstressregs1':
462 case 'r2r_jitstressregs2':
463 case 'r2r_jitstressregs3':
464 case 'r2r_jitstressregs4':
465 case 'r2r_jitstressregs8':
466 case 'r2r_jitstressregs0x10':
467 case 'r2r_jitstressregs0x80':
468 case 'r2r_jitstressregs0x1000':
469 case 'r2r_jitminopts':
470 case 'r2r_jitforcerelocs':
471 case 'gcstress15_pri1r2r':
472 assert !(os in bidailyCrossList)
474 // GCStress=C is currently not supported on OS X
475 if (os == 'OSX10.12' && isGCStressRelatedTesting(scenario)) {
479 //GC Stress 15 pri1 r2r gets a push trigger for checked/release
480 if (configuration == 'Checked' || configuration == 'Release') {
481 assert (os == 'Windows_NT') || (os in Constants.crossList)
482 if (architecture == 'x64') {
483 //Flow jobs should be Windows, Ubuntu, OSX10.12, or CentOS
484 if (isFlowJob || os == 'Windows_NT') {
485 // Add a weekly periodic trigger
486 Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
489 // For x86, only add per-commit jobs for Windows
490 else if (architecture == 'x86') {
491 if (os == 'Windows_NT') {
492 Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
498 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
499 assert configuration == 'Release'
500 assert architecture == 'x64'
501 Utilities.addPeriodicTrigger(job, '@daily')
502 // TODO: Add once external email sending is available again
503 // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
506 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
507 assert configuration == 'Release'
508 assert architecture == 'x64'
509 Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
510 // TODO: Add once external email sending is available again
511 // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
513 case 'standalone_gc':
514 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
515 assert (configuration == 'Release' || configuration == 'Checked')
516 // TODO: Add once external email sending is available again
517 // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
518 Utilities.addPeriodicTrigger(job, '@weekly')
520 case 'gc_reliability_framework':
521 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
522 assert (configuration == 'Release' || configuration == 'Checked')
523 // Only triggered by phrase.
526 assert !(os in bidailyCrossList)
527 // ILASM/ILDASM roundtrip one gets a daily build, and only for release
528 if (architecture == 'x64' && configuration == 'Release') {
529 // We don't expect to see a job generated except in these scenarios
530 assert (os == 'Windows_NT') || (os in Constants.crossList)
531 if (isFlowJob || os == 'Windows_NT') {
532 Utilities.addPeriodicTrigger(job, '@daily')
537 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
538 assert configuration == 'Checked'
539 assert (architecture == 'x64' || architecture == 'x86')
540 Utilities.addGithubPushTrigger(job)
543 assert (os == 'Ubuntu' || os == 'Windows_NT')
544 assert configuration == 'Release'
545 assert architecture == 'x64'
546 Utilities.addPeriodicTrigger(job, '@weekly')
549 assert (os == 'Windows_NT' || os == "Ubuntu")
550 assert architecture == 'x64'
551 Utilities.addGithubPushTrigger(job)
553 case 'jitstressregs1':
554 case 'jitstressregs2':
555 case 'jitstressregs3':
556 case 'jitstressregs4':
557 case 'jitstressregs8':
558 case 'jitstressregs0x10':
559 case 'jitstressregs0x80':
560 case 'jitstressregs0x1000':
565 case 'jitstress2_jitstressregs1':
566 case 'jitstress2_jitstressregs2':
567 case 'jitstress2_jitstressregs3':
568 case 'jitstress2_jitstressregs4':
569 case 'jitstress2_jitstressregs8':
570 case 'jitstress2_jitstressregs0x10':
571 case 'jitstress2_jitstressregs0x80':
572 case 'jitstress2_jitstressregs0x1000':
573 case 'tailcallstress':
575 case 'corefx_baseline':
576 case 'corefx_minopts':
577 case 'corefx_jitstress1':
578 case 'corefx_jitstress2':
579 case 'corefx_jitstressregs1':
580 case 'corefx_jitstressregs2':
581 case 'corefx_jitstressregs3':
582 case 'corefx_jitstressregs4':
583 case 'corefx_jitstressregs8':
584 case 'corefx_jitstressregs0x10':
585 case 'corefx_jitstressregs0x80':
586 case 'corefx_jitstressregs0x1000':
588 if (os != 'CentOS7.1' && !(os in bidailyCrossList)) {
589 assert (os == 'Windows_NT') || (os in Constants.crossList)
590 Utilities.addPeriodicTrigger(job, '@daily')
595 if (os != 'CentOS7.1' && !(os in bidailyCrossList)) {
596 assert (os == 'Windows_NT') || (os in Constants.crossList)
597 if (architecture == 'arm64') {
598 if (os == 'Windows_NT') {
599 Utilities.addPeriodicTrigger(job, '@daily')
601 // TODO: Add once external email sending is available again
602 // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
605 Utilities.addPeriodicTrigger(job, '@weekly')
610 case 'gcstress0xc_zapdisable':
611 case 'gcstress0xc_zapdisable_jitstress2':
612 case 'gcstress0xc_zapdisable_heapverify1':
613 case 'gcstress0xc_jitstress1':
614 case 'gcstress0xc_jitstress2':
615 case 'gcstress0xc_minopts_heapverify1':
616 // GCStress=C is currently not supported on OS X
617 if (os != 'CentOS7.1' && os != 'OSX10.12' && !(os in bidailyCrossList)) {
618 assert (os == 'Windows_NT') || (os in Constants.crossList)
619 if (architecture == 'arm64') {
620 // TODO: Enable a periodic trigger after tests are updated.
621 // Utilities.addPeriodicTrigger(job, '@daily')
622 // TODO: Add once external email sending is available again
623 // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
626 Utilities.addPeriodicTrigger(job, '@weekly')
632 // Testing on other operating systems TBD
633 assert (os == 'Windows_NT' || os == 'Ubuntu')
634 if (architecture == 'x64' || architecture == 'x86') {
635 if (configuration == 'Checked') {
636 Utilities.addPeriodicTrigger(job, '@daily')
642 println("Unknown scenario: ${scenario}");
649 // **************************
650 // Define the basic inner loop builds for PR and commit. This is basically just the set
651 // of coreclr builds over linux/osx 10.12/freebsd/windows and debug/release/checked. In addition, the windows
652 // builds will do a couple extra steps.
653 // **************************
655 // Adds a trigger for the PR build if one is needed. If isFlowJob is true, then this is the
656 // flow job that rolls up the build and test for non-windows OS's. // If the job is a windows build only job,
657 // it's just used for internal builds
658 // If you add a job with a trigger phrase, please add that phrase to coreclr/Documentation/project-docs/ci-trigger-phrases.md
659 def static addTriggers(def job, def branch, def isPR, def architecture, def os, def configuration, def scenario, def isFlowJob, def isWindowsBuildOnlyJob) {
660 if (isWindowsBuildOnlyJob) {
664 def bidailyCrossList = ['RHEL7.2', 'Debian8.4']
665 // Non pull request builds.
667 addNonPRTriggers(job, branch, isPR, architecture, os, configuration, scenario, isFlowJob, isWindowsBuildOnlyJob, bidailyCrossList)
670 // Pull request builds. Generally these fall into two categories: default triggers and on-demand triggers
671 // We generally only have a distinct set of default triggers but a bunch of on-demand ones.
672 def osGroup = getOSGroup(os)
673 switch (architecture) {
674 case 'x64': // editor brace matching: {
675 if (scenario == 'coverage') {
676 assert configuration == 'Release'
677 if (os == 'Ubuntu') {
678 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Coverage Build & Test", "(?i).*test\\W+coverage.*")
683 if (scenario == 'formatting') {
684 assert configuration == 'Checked'
685 if (os == 'Windows_NT' || os == 'Ubuntu') {
686 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Formatting")
692 // OpenSUSE, Debian & RedHat get trigger phrases for pri 0 build, and pri 1 build & test
695 if (scenario == 'default') {
697 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", "(?i).*test\\W+${os}.*")
699 else if (scenario == 'pri1' && isFlowJob) {
700 assert (configuration == 'Release')
701 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Pri 1 Build & Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
706 assert scenario == 'default'
707 // Distinguish with the other architectures (arm and x86)
708 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", "(?i).*test\\W+${os}\\W+${architecture}.*")
714 assert scenario == 'default'
715 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", "(?i).*test\\W+${os}\\W+.*")
718 if (scenario == 'illink') {
719 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
724 // Triggers on the non-flow jobs aren't necessary here
725 // Corefx testing uses non-flow jobs.
726 if (!isFlowJob && !isCorefxTesting(scenario)) {
731 // Ubuntu uses checked for default PR tests
732 if (configuration == 'Checked') {
734 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test")
738 if (configuration == 'Release') {
739 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
743 if (configuration == 'Checked') {
744 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Jit Diff Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
748 if (configuration == 'Release') {
749 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
753 if (configuration == 'Release' || configuration == 'Checked') {
754 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
758 if (configuration == 'Release' || configuration == 'Checked') {
759 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
762 case 'gcstress15_pri1r2r':
763 if (configuration == 'Release' || configuration == 'Checked') {
764 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
767 case 'r2r_jitstress1':
768 case 'r2r_jitstress2':
769 case 'r2r_jitstressregs1':
770 case 'r2r_jitstressregs2':
771 case 'r2r_jitstressregs3':
772 case 'r2r_jitstressregs4':
773 case 'r2r_jitstressregs8':
774 case 'r2r_jitstressregs0x10':
775 case 'r2r_jitstressregs0x80':
776 case 'r2r_jitstressregs0x1000':
777 case 'r2r_jitminopts':
778 case 'r2r_jitforcerelocs':
779 if (configuration == 'Release' || configuration == 'Checked') {
780 def displayStr = getR2RStressModeDisplayName(scenario)
781 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
785 if (configuration == 'Release') {
786 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
790 if (configuration == 'Release') {
791 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
794 case 'standalone_gc':
795 if (configuration == 'Release' || configuration == 'Checked') {
796 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
799 case 'gc_reliability_framework':
800 if (configuration == 'Release' || configuration == 'Checked') {
801 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Reliability Framework", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
808 case 'jitstressregs1':
809 case 'jitstressregs2':
810 case 'jitstressregs3':
811 case 'jitstressregs4':
812 case 'jitstressregs8':
813 case 'jitstressregs0x10':
814 case 'jitstressregs0x80':
815 case 'jitstressregs0x1000':
816 case 'jitstress2_jitstressregs1':
817 case 'jitstress2_jitstressregs2':
818 case 'jitstress2_jitstressregs3':
819 case 'jitstress2_jitstressregs4':
820 case 'jitstress2_jitstressregs8':
821 case 'jitstress2_jitstressregs0x10':
822 case 'jitstress2_jitstressregs0x80':
823 case 'jitstress2_jitstressregs0x1000':
824 case 'tailcallstress':
830 case 'gcstress0xc_zapdisable':
831 case 'gcstress0xc_zapdisable_jitstress2':
832 case 'gcstress0xc_zapdisable_heapverify1':
833 case 'gcstress0xc_jitstress1':
834 case 'gcstress0xc_jitstress2':
835 case 'gcstress0xc_minopts_heapverify1':
836 def displayStr = getStressModeDisplayName(scenario)
837 assert (os == 'Windows_NT') || (os in Constants.crossList)
838 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
839 "(?i).*test\\W+${os}\\W+${scenario}.*")
841 case 'corefx_baseline':
842 case 'corefx_minopts':
843 case 'corefx_jitstress1':
844 case 'corefx_jitstress2':
845 case 'corefx_jitstressregs1':
846 case 'corefx_jitstressregs2':
847 case 'corefx_jitstressregs3':
848 case 'corefx_jitstressregs4':
849 case 'corefx_jitstressregs8':
850 case 'corefx_jitstressregs0x10':
851 case 'corefx_jitstressregs0x80':
852 case 'corefx_jitstressregs0x1000':
853 def displayName = ('CoreFx ' + getStressModeDisplayName(scenario)).trim()
854 assert (os == 'Windows_NT') || (os in Constants.crossList)
855 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayName})",
856 "(?i).*test\\W+${os}\\W+${architecture}\\W+${scenario}.*")
859 println("Unknown scenario: ${scenario}");
867 if (configuration == 'Release') {
868 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
872 if (configuration == 'Checked' || configuration == 'Release') {
873 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
877 if (configuration == 'Checked' || configuration == 'Release') {
878 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
881 case 'gcstress15_pri1r2r':
882 if (configuration == 'Release' || configuration == 'Checked') {
883 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
886 case 'r2r_jitstress1':
887 case 'r2r_jitstress2':
888 case 'r2r_jitstressregs1':
889 case 'r2r_jitstressregs2':
890 case 'r2r_jitstressregs3':
891 case 'r2r_jitstressregs4':
892 case 'r2r_jitstressregs8':
893 case 'r2r_jitstressregs0x10':
894 case 'r2r_jitstressregs0x80':
895 case 'r2r_jitstressregs0x1000':
896 case 'r2r_jitminopts':
897 case 'r2r_jitforcerelocs':
898 if (configuration == 'Release' || configuration == 'Checked') {
899 def displayStr = getR2RStressModeDisplayName(scenario)
900 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
910 if (configuration == 'Debug') {
911 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test")
916 if (configuration == 'Release') {
917 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test")
921 if (configuration == 'Checked') {
922 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Jit Diff Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
926 if (configuration == 'Release') {
927 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
931 if (configuration == 'Checked' || configuration == 'Release') {
932 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
936 if (configuration == 'Checked' || configuration == 'Release') {
937 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
940 case 'gcstress15_pri1r2r':
941 if (configuration == 'Release' || configuration == 'Checked') {
942 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
945 case 'r2r_jitstress1':
946 case 'r2r_jitstress2':
947 case 'r2r_jitstressregs1':
948 case 'r2r_jitstressregs2':
949 case 'r2r_jitstressregs3':
950 case 'r2r_jitstressregs4':
951 case 'r2r_jitstressregs8':
952 case 'r2r_jitstressregs0x10':
953 case 'r2r_jitstressregs0x80':
954 case 'r2r_jitstressregs0x1000':
955 case 'r2r_jitminopts':
956 case 'r2r_jitforcerelocs':
957 if (configuration == 'Release' || configuration == 'Checked') {
958 def displayStr = getR2RStressModeDisplayName(scenario)
959 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
963 if (configuration == 'Release') {
964 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
968 if (configuration == 'Release') {
969 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
972 case 'standalone_gc':
973 if (configuration == 'Release' || configuration == 'Checked') {
974 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
977 case 'gc_reliability_framework':
978 if (configuration == 'Release' || configuration == 'Checked') {
979 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Reliability Framework", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
986 case 'jitstressregs1':
987 case 'jitstressregs2':
988 case 'jitstressregs3':
989 case 'jitstressregs4':
990 case 'jitstressregs8':
991 case 'jitstressregs0x10':
992 case 'jitstressregs0x80':
993 case 'jitstressregs0x1000':
994 case 'jitstress2_jitstressregs1':
995 case 'jitstress2_jitstressregs2':
996 case 'jitstress2_jitstressregs3':
997 case 'jitstress2_jitstressregs4':
998 case 'jitstress2_jitstressregs8':
999 case 'jitstress2_jitstressregs0x10':
1000 case 'jitstress2_jitstressregs0x80':
1001 case 'jitstress2_jitstressregs0x1000':
1002 case 'tailcallstress':
1008 case 'gcstress0xc_zapdisable':
1009 case 'gcstress0xc_zapdisable_jitstress2':
1010 case 'gcstress0xc_zapdisable_heapverify1':
1011 case 'gcstress0xc_jitstress1':
1012 case 'gcstress0xc_jitstress2':
1013 case 'gcstress0xc_minopts_heapverify1':
1014 def displayStr = getStressModeDisplayName(scenario)
1015 assert (os == 'Windows_NT') || (os in Constants.crossList)
1016 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
1017 "(?i).*test\\W+${os}\\W+${scenario}.*")
1019 case 'corefx_baseline':
1020 case 'corefx_minopts':
1021 case 'corefx_jitstress1':
1022 case 'corefx_jitstress2':
1023 case 'corefx_jitstressregs1':
1024 case 'corefx_jitstressregs2':
1025 case 'corefx_jitstressregs3':
1026 case 'corefx_jitstressregs4':
1027 case 'corefx_jitstressregs8':
1028 case 'corefx_jitstressregs0x10':
1029 case 'corefx_jitstressregs0x80':
1030 case 'corefx_jitstressregs0x1000':
1031 def displayName = ('CoreFx ' + getStressModeDisplayName(scenario)).trim()
1032 assert (os == 'Windows_NT') || (os in Constants.crossList)
1033 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayName})",
1034 "(?i).*test\\W+${os}\\W+${architecture}\\W+${scenario}.*")
1037 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1040 println("Unknown scenario: ${scenario}");
1046 assert scenario == 'default'
1047 if (configuration == 'Checked') {
1048 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build")
1052 println("Unknown os: ${os}");
1057 // editor brace matching: }
1058 case 'arm': // editor brace matching: {
1059 assert scenario == 'default'
1063 if ((os == 'Ubuntu' && configuration == 'Release') || (os == 'Ubuntu16.04' && configuration == 'Debug')) {
1064 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build")
1067 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build", "(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
1071 architecture='armel'
1072 // Removing the regex will cause this to run on each PR.
1073 if (configuration == 'Release' || configuration == 'Debug') {
1074 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build")
1077 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build", "(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
1081 if (configuration == 'Debug' || configuration == 'Release')
1083 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build")
1087 println("NYI os: ${os}");
1092 // editor brace matching: }
1093 case 'arm64': // editor brace matching: {
1094 assert (scenario == 'default') || (scenario == 'pri1r2r') || (scenario == 'gcstress0x3') || (scenario == 'gcstress0xc')
1096 // Set up a private trigger
1097 def contextString = "${os} ${architecture} Cross ${configuration}"
1098 if (scenario != 'default')
1099 contextString += " ${scenario}"
1100 contextString += " Build"
1101 // Debug builds only.
1102 if (configuration != 'Debug') {
1103 contextString += " and Test"
1137 if (configuration == 'Release') {
1138 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
1142 if (configuration == 'Checked' || configuration == 'Release') {
1143 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1147 if (configuration == 'Checked' || configuration == 'Release') {
1148 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1151 case 'gcstress15_pri1r2r':
1152 if (configuration == 'Release' || configuration == 'Checked') {
1153 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1156 case 'r2r_jitstress1':
1157 case 'r2r_jitstress2':
1158 case 'r2r_jitstressregs1':
1159 case 'r2r_jitstressregs2':
1160 case 'r2r_jitstressregs3':
1161 case 'r2r_jitstressregs4':
1162 case 'r2r_jitstressregs8':
1163 case 'r2r_jitstressregs0x10':
1164 case 'r2r_jitstressregs0x80':
1165 case 'r2r_jitstressregs0x1000':
1166 case 'r2r_jitminopts':
1167 case 'r2r_jitforcerelocs':
1168 if (configuration == 'Release' || configuration == 'Checked') {
1169 def displayStr = getR2RStressModeDisplayName(scenario)
1170 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1179 // For now only run Debug jobs on PR Trigger.
1180 if (configuration != 'Debug') {
1181 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString,
1182 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*", null, arm64Users)
1185 // Add "Checked Build And Test" and "Debug Build" to the above users' PRs since many of them
1186 // are at higher risk of ARM64-breaking changes.
1187 Utilities.addDefaultPrivateGithubPRTriggerForBranch(job, branch, contextString, null, arm64Users)
1193 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString,
1194 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*", null, arm64Users)
1199 println("NYI os: ${os}");
1204 // editor brace matching: }
1205 case 'x86': // editor brace matching: {
1206 assert ((os == 'Windows_NT') || ((os == 'Ubuntu') && (scenario == 'default')))
1207 if (os == 'Ubuntu') {
1208 // on-demand only for ubuntu x86
1209 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build",
1210 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*")
1215 if (configuration == 'Checked') {
1216 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test")
1218 else if (configuration == 'Release') {
1219 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test",
1220 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*")
1224 if (configuration == 'Release') {
1225 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test")
1229 if (configuration == 'Release') {
1230 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test",
1231 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1235 if (configuration == 'Checked' || configuration == 'Release') {
1236 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test",
1237 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1241 if (configuration == 'Checked' || configuration == 'Release') {
1242 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test",
1243 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1246 case 'gcstress15_pri1r2r':
1247 if (configuration == 'Release' || configuration == 'Checked') {
1248 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test",
1249 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1252 case 'r2r_jitstress1':
1253 case 'r2r_jitstress2':
1254 case 'r2r_jitstressregs1':
1255 case 'r2r_jitstressregs2':
1256 case 'r2r_jitstressregs3':
1257 case 'r2r_jitstressregs4':
1258 case 'r2r_jitstressregs8':
1259 case 'r2r_jitstressregs0x10':
1260 case 'r2r_jitstressregs0x80':
1261 case 'r2r_jitstressregs0x1000':
1262 case 'r2r_jitminopts':
1263 case 'r2r_jitforcerelocs':
1264 if (configuration == 'Release' || configuration == 'Checked') {
1265 def displayStr = getR2RStressModeDisplayName(scenario)
1266 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test",
1267 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1271 if (configuration == 'Release') {
1272 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test",
1273 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1277 if (configuration == 'Release') {
1278 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator",
1279 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1282 case 'standalone_gc':
1283 if (configuration == 'Release' || configuration == 'Checked') {
1284 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC",
1285 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1292 case 'jitstressregs1':
1293 case 'jitstressregs2':
1294 case 'jitstressregs3':
1295 case 'jitstressregs4':
1296 case 'jitstressregs8':
1297 case 'jitstressregs0x10':
1298 case 'jitstressregs0x80':
1299 case 'jitstressregs0x1000':
1300 case 'jitstress2_jitstressregs1':
1301 case 'jitstress2_jitstressregs2':
1302 case 'jitstress2_jitstressregs3':
1303 case 'jitstress2_jitstressregs4':
1304 case 'jitstress2_jitstressregs8':
1305 case 'jitstress2_jitstressregs0x10':
1306 case 'jitstress2_jitstressregs0x80':
1307 case 'jitstress2_jitstressregs0x1000':
1308 case 'tailcallstress':
1314 case 'gcstress0xc_zapdisable':
1315 case 'gcstress0xc_zapdisable_jitstress2':
1316 case 'gcstress0xc_zapdisable_heapverify1':
1317 case 'gcstress0xc_jitstress1':
1318 case 'gcstress0xc_jitstress2':
1319 case 'gcstress0xc_minopts_heapverify1':
1320 def displayStr = getStressModeDisplayName(scenario)
1321 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
1322 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1324 case 'corefx_baseline':
1325 case 'corefx_minopts':
1326 case 'corefx_jitstress1':
1327 case 'corefx_jitstress2':
1328 case 'corefx_jitstressregs1':
1329 case 'corefx_jitstressregs2':
1330 case 'corefx_jitstressregs3':
1331 case 'corefx_jitstressregs4':
1332 case 'corefx_jitstressregs8':
1333 case 'corefx_jitstressregs0x10':
1334 case 'corefx_jitstressregs0x80':
1335 case 'corefx_jitstressregs0x1000':
1336 def displayName = ('CoreFx ' + getStressModeDisplayName(scenario)).trim()
1337 assert (os == 'Windows_NT') || (os in Constants.crossList)
1338 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayName})",
1339 "(?i).*test\\W+${os}\\W+${architecture}\\W+${scenario}.*")
1342 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1345 println("Unknown scenario: ${os} ${architecture} ${scenario}");
1350 // editor brace matching: }
1351 case 'x86lb': // editor brace matching: {
1352 assert (os == 'Windows_NT')
1353 assert (scenario == 'default' || Constants.r2rJitStressScenarios.indexOf(scenario) !=1)
1356 def jit = 'legacy_backend'
1359 if (configuration == 'Checked') {
1360 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} Build and Test",
1361 "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}.*")
1365 println("Unknown scenario: ${os} ${arch} ${jit} ${scenario}");
1370 // editor brace matching: }
1372 println("Unknown architecture: ${architecture}");
1378 def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR, def architecture, def configuration, def os, def enableCorefxTesting, def isBuildOnly) {
1379 def buildCommands = [];
1380 def osGroup = getOSGroup(os)
1381 def lowerConfiguration = configuration.toLowerCase()
1383 // Calculate the build steps, archival, and xunit results
1385 case 'Windows_NT': // editor brace matching: {
1386 switch (architecture) {
1390 def arch = architecture
1392 if (architecture == 'x86lb') {
1396 if (scenario == 'illink') {
1397 buildCommands += "tests\\scripts\\build_illink.cmd clone ${arch}"
1400 if (Constants.jitStressModeScenarios.containsKey(scenario) ||
1401 scenario == 'default' ||
1402 scenario == 'r2r' ||
1403 scenario == 'jitdiff' ||
1404 scenario == 'ilrt' ||
1405 scenario == 'illink' ||
1406 Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
1407 buildOpts += enableCorefxTesting ? ' skiptests' : ''
1408 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${arch} ${buildOpts}"
1411 // For Pri 1 tests, we must shorten the output test binary path names.
1412 // if __TestIntermediateDir is already set, build-test.cmd will
1413 // output test binaries to that directory. If it is not set, the
1414 // binaries are sent to a default directory whose name is about
1415 // 35 characters long.
1417 else if (scenarioNeedsPri1Build(scenario)) {
1418 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${arch} ${buildOpts} -priority=1"
1420 else if (isLongGc(scenario)) {
1421 buildCommands += "build.cmd ${lowerConfiguration} ${arch} ${buildOpts} skiptests"
1422 buildCommands += "set __TestIntermediateDir=int&&build-test.cmd ${lowerConfiguration} ${arch}"
1424 else if (scenario == 'standalone_gc') {
1425 buildCommands += "build.cmd ${lowerConfiguration} ${arch} ${buildOpts} buildstandalonegc"
1427 else if (scenario == 'formatting') {
1428 buildCommands += "python -u tests\\scripts\\format.py -c %WORKSPACE% -o Windows_NT -a ${arch}"
1429 Utilities.addArchival(newJob, "format.patch", "", true, false)
1433 println("Unknown scenario: ${scenario}")
1437 // If we are running a stress mode, we should write out the set of key
1438 // value env pairs to a file at this point and then we'll pass that to runtest.cmd
1441 //If this is a crossgen build, pass 'crossgen' to runtest.cmd
1442 def crossgenStr = ''
1443 def runcrossgentestsStr = ''
1444 def runjitstressStr = ''
1445 def runjitstressregsStr = ''
1446 def runjitmioptsStr = ''
1447 def runjitforcerelocsStr = ''
1448 def runjitdisasmStr = ''
1449 def runilasmroundtripStr = ''
1450 def gcstressStr = ''
1451 def runtestArguments = ''
1452 def gcTestArguments = ''
1453 def illinkArguments = ''
1455 if (scenario == 'r2r' ||
1456 scenario == 'pri1r2r' ||
1457 scenario == 'gcstress15_pri1r2r' ||
1458 Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
1459 crossgenStr = 'crossgen'
1460 runcrossgentestsStr = 'runcrossgentests'
1462 if (scenario == 'r2r_jitstress1'){
1463 runjitstressStr = 'jitstress 1'
1465 else if (scenario == 'r2r_jitstress2') {
1466 runjitstressStr = 'jitstress 2'
1468 else if (scenario == 'r2r_jitstressregs1'){
1469 runjitstressregsStr = 'jitstressregs 1'
1471 else if (scenario == 'r2r_jitstressregs2') {
1472 runjitstressregsStr = 'jitstressregs 2'
1474 else if (scenario == 'r2r_jitstressregs3') {
1475 runjitstressregsStr = 'jitstressregs 3'
1477 else if (scenario == 'r2r_jitstressregs4') {
1478 runjitstressregsStr = 'jitstressregs 4'
1480 else if (scenario == 'r2r_jitstressregs8') {
1481 runjitstressregsStr = 'jitstressregs 8'
1483 else if (scenario == 'r2r_jitstressregs0x10') {
1484 runjitstressregsStr = 'jitstressregs 0x10'
1486 else if (scenario == 'r2r_jitstressregs0x80') {
1487 runjitstressregsStr = 'jitstressregs 0x80'
1489 else if (scenario == 'r2r_jitstressregs0x1000') {
1490 runjitstressregsStr = 'jitstressregs 0x1000'
1492 else if (scenario == 'r2r_jitminopts') {
1493 runjitmioptsStr = 'jitminopts'
1495 else if (scenario == 'r2r_jitforcerelocs') {
1496 runjitforcerelocsStr = 'jitforcerelocs'
1499 if (scenario == 'gcstress15_pri1r2r')
1501 gcstressStr = 'gcstresslevel 0xF'
1504 if (scenario == 'jitdiff')
1506 runjitdisasmStr = 'jitdisasm crossgen'
1509 if (scenario == 'ilrt')
1511 runilasmroundtripStr = 'ilasmroundtrip'
1514 if (isLongGc(scenario)) {
1515 gcTestArguments = "${scenario} sequential"
1518 if (scenario == 'illink')
1520 illinkArguments = "link %WORKSPACE%\\linker\\linker\\bin\\netcore_Release\\netcoreapp2.0\\win10-${arch}\\publish\\illink.exe"
1523 runtestArguments = "${lowerConfiguration} ${arch} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${runjitdisasmStr} ${runilasmroundtripStr} ${gcTestArguments} ${illinkArguments} collectdumps"
1525 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
1526 def stepScriptLocation = "%WORKSPACE%\\SetStressModes.bat"
1527 buildCommands += genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], stepScriptLocation)
1529 if (enableCorefxTesting) {
1530 def workspaceRelativeFxRoot = "_/fx"
1531 def absoluteFxRoot = "%WORKSPACE%\\_\\fx"
1533 buildCommands += "python -u %WORKSPACE%\\tests\\scripts\\run-corefx-tests.py -arch ${arch} -build_type ${configuration} -fx_root ${absoluteFxRoot} -fx_branch ${branch} -env_script ${stepScriptLocation}"
1535 setTestJobTimeOut(newJob, scenario)
1537 // Archive and process (only) the test results
1538 Utilities.addArchival(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1539 Utilities.addXUnitDotNETResults(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1542 buildCommands += "%WORKSPACE%\\tests\\runtest.cmd ${runtestArguments} TestEnv ${stepScriptLocation}"
1545 else if (isGcReliabilityFramework(scenario)) {
1546 buildCommands += "tests\\runtest.cmd ${runtestArguments} GenerateLayoutOnly"
1547 buildCommands += "tests\\scripts\\run-gc-reliability-framework.cmd ${arch} ${configuration}"
1549 else if (architecture == 'x64' || architecture == 'x86') {
1550 buildCommands += "tests\\runtest.cmd ${runtestArguments}"
1552 else if (architecture == 'x86lb') {
1553 buildCommands += "tests\\runtest.cmd ${runtestArguments} TestEnv %WORKSPACE%\\tests\\legacyjit_x86_testenv.cmd"
1557 if (!enableCorefxTesting) {
1558 // Run the rest of the build
1559 // Build the mscorlib for the other OS's
1560 buildCommands += "build.cmd ${lowerConfiguration} ${arch} linuxmscorlib"
1561 buildCommands += "build.cmd ${lowerConfiguration} ${arch} freebsdmscorlib"
1562 buildCommands += "build.cmd ${lowerConfiguration} ${arch} osxmscorlib"
1564 if (arch == "x64") {
1565 buildCommands += "build.cmd ${lowerConfiguration} arm64 linuxmscorlib"
1568 // Zip up the tests directory so that we don't use so much space/time copying
1569 // 10s of thousands of files around.
1570 buildCommands += "powershell -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${arch}.${configuration}', '.\\bin\\tests\\tests.zip')\"";
1572 if (!Constants.jitStressModeScenarios.containsKey(scenario)) {
1573 // For windows, pull full test results and test drops for x86/x64.
1574 // No need to pull for stress mode scenarios (downstream builds use the default scenario)
1575 Utilities.addArchival(newJob, "bin/Product/**,bin/tests/tests.zip", "bin/Product/**/.nuget/**")
1578 if (scenario == 'jitdiff') {
1579 // retrive jit-dasm output for base commit, and run jit-diff
1581 // if this is a build only job, we want to keep the default (build) artifacts for the flow job
1582 Utilities.addArchival(newJob, "bin/tests/${osGroup}.${arch}.${configuration}/dasm/**")
1587 Utilities.addXUnitDotNETResults(newJob, 'bin/**/TestRun*.xml', true)
1588 setTestJobTimeOut(newJob, scenario)
1593 assert (scenario == 'default')
1596 setTestJobTimeOut(newJob, scenario)
1598 if ( lowerConfiguration == "debug" ) {
1599 // For Debug builds, we will do a P1 test build
1600 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} -priority=1"
1603 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture}"
1606 Utilities.addArchival(newJob, "bin/Product/**", "bin/Product/**/.nuget/**")
1609 assert (scenario == 'default') || (scenario == 'pri1r2r') || (scenario == 'gcstress0x3') || (scenario == 'gcstress0xc')
1612 setTestJobTimeOut(newJob, scenario)
1614 // Debug runs take too long to run. So build job only.
1615 if (lowerConfiguration == "debug") {
1616 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} toolset_dir C:\\ats2"
1619 if ((scenario != 'gcstress0x3') && (scenario != 'gcstress0xc'))
1621 // Up the timeout for arm64 checked testing only.
1622 // Keep the longer timeout for gcstress.
1623 Utilities.setJobTimeout(newJob, 240)
1626 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} toolset_dir C:\\ats2 -priority=1"
1627 // Test build and run are launched together.
1628 buildCommands += "python tests\\scripts\\arm64_post_build.py -repo_root %WORKSPACE% -arch ${architecture} -build_type ${lowerConfiguration} -scenario ${scenario} -key_location C:\\tools\\key.txt"
1629 //Utilities.addXUnitDotNETResults(newJob, 'bin/tests/testResults.xml')
1633 Utilities.addArchival(newJob, "bin/Product/**", "bin/Product/**/.nuget/**")
1636 println("Unknown architecture: ${architecture}");
1641 // editor brace matching: }
1650 case 'OpenSUSE42.1':
1652 case 'Fedora24': // editor brace matching: {
1653 switch (architecture) {
1656 if (architecture == 'x86' && os == 'Ubuntu') {
1657 // build and PAL test
1658 buildCommands += "./tests/scripts/x86_ci_script.sh --buildConfig=${lowerConfiguration}"
1659 Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
1663 if (scenario == 'formatting') {
1664 buildCommands += "python tests/scripts/format.py -c \${WORKSPACE} -o Linux -a ${architecture}"
1665 Utilities.addArchival(newJob, "format.patch", "", true, false)
1669 if (scenario == 'illink') {
1670 assert(os == 'Ubuntu')
1671 buildCommands += "./tests/scripts/build_illink.sh --clone --arch=${architecture}"
1674 def standaloneGc = ''
1675 if (scenario == 'standalone_gc') {
1676 standaloneGc = 'buildstandalonegc'
1679 if (!enableCorefxTesting) {
1680 // We run pal tests on all OS but generate mscorlib (and thus, nuget packages)
1681 // only on supported OS platforms.
1682 if (os == 'FreeBSD')
1684 buildCommands += "./build.sh skipmscorlib verbose ${lowerConfiguration} ${architecture} ${standaloneGc}"
1688 def bootstrapRid = Utilities.getBoostrapPublishRid(os)
1689 def bootstrapRidEnv = bootstrapRid != null ? "__PUBLISH_RID=${bootstrapRid} " : ''
1690 buildCommands += "${bootstrapRidEnv}./build.sh verbose ${lowerConfiguration} ${architecture} ${standaloneGc}"
1692 buildCommands += "src/pal/tests/palsuite/runpaltests.sh \${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration} \${WORKSPACE}/bin/paltestout"
1695 setTestJobTimeOut(newJob, scenario)
1696 // Basic archiving of the build
1697 Utilities.addArchival(newJob, "bin/Product/**,bin/obj/*/tests/**/*.dylib,bin/obj/*/tests/**/*.so", "bin/Product/**/.nuget/**")
1699 Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
1702 // Corefx stress testing
1703 assert os == 'Ubuntu'
1704 assert architecture == 'x64'
1705 assert lowerConfiguration == 'checked'
1706 assert Constants.jitStressModeScenarios.containsKey(scenario)
1709 buildCommands += "./build.sh verbose ${lowerConfiguration} ${architecture}"
1711 def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
1712 buildCommands += genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], scriptFileName)
1714 // Build and text corefx
1715 def workspaceRelativeFxRoot = "_/fx"
1716 def absoluteFxRoot = "\$WORKSPACE/${workspaceRelativeFxRoot}"
1718 buildCommands += "python -u \$WORKSPACE/tests/scripts/run-corefx-tests.py -arch ${architecture} -build_type ${configuration} -fx_root ${absoluteFxRoot} -fx_branch ${branch} -env_script ${scriptFileName}"
1720 setTestJobTimeOut(newJob, scenario)
1722 // Archive and process (only) the test results
1723 Utilities.addArchival(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1724 Utilities.addXUnitDotNETResults(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1728 def standaloneGc = ''
1729 if (scenario == 'standalone_gc') {
1730 standaloneGc = 'buildstandalonegc'
1733 if (!enableCorefxTesting) {
1734 buildCommands += "ROOTFS_DIR=/opt/arm64-xenial-rootfs ./build.sh skipmscorlib verbose ${lowerConfiguration} ${architecture} cross clang3.8 skipnuget ${standaloneGc}"
1736 // HACK -- Arm64 does not have corefx jobs yet.
1737 buildCommands += "git clone https://github.com/dotnet/corefx fx"
1738 buildCommands += "ROOTFS_DIR=/opt/arm64-xenial-rootfs-corefx ./fx/build-native.sh -release -buildArch=arm64 -- verbose cross clang3.8"
1739 buildCommands += "mkdir ./bin/Product/Linux.arm64.${configuration}/corefxNative"
1740 buildCommands += "cp fx/bin/Linux.arm64.Release/native/* ./bin/Product/Linux.arm64.${configuration}/corefxNative"
1743 setTestJobTimeOut(newJob, scenario)
1744 // Basic archiving of the build
1745 Utilities.addArchival(newJob, "bin/Product/**,bin/obj/*/tests/**/*.dylib,bin/obj/*/tests/**/*.so", "bin/Product/**/.nuget/**")
1749 // Cross builds for ARM runs on Ubuntu, Ubuntu16.04 and Tizen currently
1750 assert (os == 'Ubuntu') || (os == 'Ubuntu16.04') || (os == 'Tizen')
1752 // default values for Ubuntu
1754 def linuxCodeName="trusty"
1755 if (os == 'Ubuntu16.04') {
1756 linuxCodeName="xenial"
1758 else if (os == 'Tizen') {
1760 linuxCodeName="tizen"
1763 // Unzip the Windows test binaries first. Exit with 0
1764 buildCommands += "unzip -q -o ./bin/tests/tests.zip -d ./bin/tests/Windows_NT.x64.${configuration} || exit 0"
1766 // Unpack the corefx binaries
1767 buildCommands += "mkdir ./bin/CoreFxBinDir"
1768 buildCommands += "tar -xf ./bin/build.tar.gz -C ./bin/CoreFxBinDir"
1769 if (os != 'Tizen') {
1770 buildCommands += "chmod a+x ./bin/CoreFxBinDir/corerun"
1772 // Test environment emulation using docker and qemu has some problem to use lttng library.
1773 // We should remove libcoreclrtraceptprovider.so to avoid test hang.
1774 if (os == 'Ubuntu') {
1775 buildCommands += "rm -f -v ./bin/CoreFxBinDir/libcoreclrtraceptprovider.so"
1778 // Call the ARM CI script to cross build and test using docker
1779 buildCommands += """./tests/scripts/arm32_ci_script.sh \\
1782 --linuxCodeName=${linuxCodeName} \\
1783 --buildConfig=${lowerConfiguration} \\
1784 --testRootDir=./bin/tests/Windows_NT.x64.${configuration} \\
1785 --coreFxBinDir=./bin/CoreFxBinDir \\
1786 --testDirFile=./tests/testsRunningInsideARM.txt"""
1788 // Basic archiving of the build, no pal tests
1789 Utilities.addArchival(newJob, "bin/Product/**", "bin/Product/**/.nuget/**")
1792 println("Unknown architecture: ${architecture}");
1797 // editor brace matching: }
1799 println("Unknown os: ${os}");
1804 return buildCommands
1807 // Additional scenario which can alter behavior
1809 def combinedScenarios = Constants.basicScenarios + Constants.jitStressModeScenarios.keySet()
1810 combinedScenarios.each { scenario ->
1811 [true, false].each { isPR ->
1812 Constants.architectureList.each { architecture ->
1813 Constants.configurationList.each { configuration ->
1814 Constants.osList.each { os ->
1815 // If the OS is Windows_NT_BuildOnly, set the isBuildOnly flag to true
1816 // and reset the os to Windows_NT
1817 def isBuildOnly = false
1818 if (os == 'Windows_NT_BuildOnly') {
1823 // WinArm32 is only built for Debug and Release
1824 if (os == 'Windows_NT' && architecture == 'arm')
1826 if (configuration == 'Checked')
1831 // Tizen is only supported for arm architecture
1832 if (os == 'Tizen' && architecture != 'arm') {
1836 // Skip totally unimplemented (in CI) configurations.
1837 switch (architecture) {
1839 if (os == 'Ubuntu16.04') {
1843 // Windows and Ubuntu only
1844 if ((os != 'Windows_NT' && os != 'Ubuntu') || isBuildOnly) {
1849 if ((os != 'Ubuntu') && (os != 'Ubuntu16.04') && (os != 'Tizen') && (os != 'Windows_NT')) {
1854 if ((os != 'Ubuntu') && (os != 'Windows_NT')) {
1859 if (os != 'Windows_NT') {
1864 // Everything implemented
1867 println("Unknown architecture: ${architecture}")
1872 // Skip scenarios (blanket skipping for jit stress modes, which are good most everywhere
1873 // with checked builds
1874 def enableCorefxTesting = false
1875 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
1876 if (configuration != 'Checked') {
1880 enableCorefxTesting = isCorefxTesting(scenario)
1882 // Since these are just execution time differences,
1883 // skip platforms that don't execute the tests here (Windows_NT only)
1884 def isEnabledOS = (os == 'Windows_NT') || (os == 'Ubuntu' && enableCorefxTesting)
1885 if (!isEnabledOS || isBuildOnly) {
1889 switch (architecture) {
1891 if ((scenario != 'gcstress0x3') && (scenario != 'gcstress0xc')) {
1897 // x86 ubuntu: default only
1898 if ((os == 'Ubuntu') && (architecture == 'x86')) {
1901 // Windows: Everything implemented
1904 // No stress modes for legacy jit.
1905 // (There's no technical reason we couldn't allow these.)
1912 // If this is a r2r jitstress, jitstressregs, jitminopts, or forcerelocs scenario
1913 // and configuration is not Checked, bail out.
1914 if (configuration != 'Checked' && Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
1921 // The pri1 build isn't necessary except for Windows_NT. Non-Windows NT uses
1922 // the default scenario build
1923 if (os != 'Windows_NT') {
1927 if (architecture != 'x64') {
1932 // The ilrt build isn't necessary except for Windows_NT. Non-Windows NT uses
1933 // the default scenario build
1934 if (os != 'Windows_NT') {
1938 if (architecture != 'x64') {
1942 if (configuration != 'Release') {
1947 if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
1950 if (architecture != 'x64') {
1953 if (configuration != 'Checked') {
1958 // The r2r build isn't necessary except for Windows_NT. Non-Windows NT uses
1959 // the default scenario build
1960 if (os != 'Windows_NT') {
1963 if (architecture != 'x64') {
1968 // The pri1r2r build isn't necessary except for Windows_NT. Non-Windows NT uses
1969 // the default scenario build
1970 if (os != 'Windows_NT') {
1973 if (architecture != 'x64') {
1974 if (architecture != 'arm64' || configuration == 'Debug') {
1979 case 'gcstress15_pri1r2r':
1980 case 'r2r_jitstress1':
1981 case 'r2r_jitstress2':
1982 case 'r2r_jitstressregs1':
1983 case 'r2r_jitstressregs2':
1984 case 'r2r_jitstressregs3':
1985 case 'r2r_jitstressregs4':
1986 case 'r2r_jitstressregs8':
1987 case 'r2r_jitstressregs0x10':
1988 case 'r2r_jitstressregs0x80':
1989 case 'r2r_jitstressregs0x1000':
1990 case 'r2r_jitminopts':
1991 case 'r2r_jitforcerelocs':
1992 // The above builds are not necessary except for Windows_NT. Non-Windows NT uses
1993 // the default scenario build
1994 if (os != 'Windows_NT') {
1997 if (architecture != 'x64' && architecture != 'x86') {
2003 if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
2006 if (architecture != 'x64') {
2009 if (configuration != 'Release') {
2013 case 'gc_reliability_framework':
2014 case 'standalone_gc':
2015 if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
2019 if (architecture != 'x64') {
2023 if (configuration != 'Release' && configuration != 'Checked') {
2027 // We need Windows x64 Release bits for the code coverage build
2029 if (os != 'Windows_NT') {
2032 if (architecture != 'x64') {
2035 if (configuration != 'Release') {
2039 // We only run Windows and Ubuntu x64 Checked for formatting right now
2041 if (os != 'Windows_NT' && os != 'Ubuntu') {
2044 if (architecture != 'x64') {
2047 if (configuration != 'Checked') {
2055 if (os != 'Windows_NT' && (os != 'Ubuntu' || architecture != 'x64')) {
2058 if (architecture != 'x64' && architecture != 'x86') {
2069 println("Unknown scenario: ${scenario}")
2076 def lowerConfiguration = configuration.toLowerCase()
2077 def jobName = getJobName(configuration, architecture, os, scenario, isBuildOnly)
2078 def folderName = getJobFolder(scenario)
2080 // Create the new job
2081 def newJob = job(Utilities.getFullJobName(project, jobName, isPR, folderName)) {}
2083 def machineAffinityOptions = architecture == 'arm64' ? ['is_build_only': true] : null
2084 setMachineAffinity(newJob, os, architecture, machineAffinityOptions)
2086 // Add all the standard options
2087 Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
2088 addTriggers(newJob, branch, isPR, architecture, os, configuration, scenario, false, isBuildOnly)
2090 def buildCommands = calculateBuildCommands(newJob, scenario, branch, isPR, architecture, configuration, os, enableCorefxTesting, isBuildOnly)
2091 def osGroup = getOSGroup(os)
2095 if (os == 'Windows_NT') {
2096 buildCommands.each { buildCommand ->
2097 batchFile(buildCommand)
2101 // Setup corefx and Windows test binaries for Linux cross build for ubuntu-arm, ubuntu16.04-arm and tizen-armel
2102 if ( architecture == 'arm' && ( os == 'Ubuntu' || os == 'Ubuntu16.04' || os == 'Tizen')) {
2103 // Cross build for ubuntu-arm, ubuntu16.04-arm and tizen-armel
2104 // Define the Windows Tests and Corefx build job names
2105 def WindowTestsName = projectFolder + '/' +
2106 Utilities.getFullJobName(project,
2107 getJobName(lowerConfiguration,
2113 def corefxFolder = Utilities.getFolderName('dotnet/corefx') + '/' +
2114 Utilities.getFolderName(branch)
2116 // Copy the Windows test binaries and the Corefx build binaries
2117 copyArtifacts(WindowTestsName) {
2118 includePatterns('bin/tests/tests.zip')
2120 latestSuccessful(true)
2125 def corefx_os = 'linux'
2126 if (os == 'Tizen') {
2131 // Let's use release CoreFX to test checked CoreCLR,
2132 // because we do not generate checked CoreFX in CoreFX CI yet.
2133 def corefx_lowerConfiguration = lowerConfiguration
2134 if ( lowerConfiguration == 'checked' ) {
2135 corefx_lowerConfiguration='release'
2138 copyArtifacts("${corefxFolder}/${corefx_os}_${arm_abi}_cross_${corefx_lowerConfiguration}") {
2139 includePatterns('bin/build.tar.gz')
2141 latestSuccessful(true)
2146 buildCommands.each { buildCommand ->
2160 // Create the Linux/OSX/CentOS coreclr test leg for debug and release and each scenario
2161 combinedScenarios.each { scenario ->
2162 [true, false].each { isPR ->
2163 // Architectures. x64 only at this point
2164 ['x64', 'arm64'].each { architecture ->
2165 // Put the OS's supported for coreclr cross testing here
2166 Constants.crossList.each { os ->
2167 if (architecture == 'arm64') {
2168 if (os != "Ubuntu") {
2173 Constants.configurationList.each { configuration ->
2175 if (architecture == 'arm64') {
2176 if (scenario != 'default' && scenario != 'pri1r2r' && scenario != 'gcstress0x3' && scenario != 'gcstress0xc') {
2181 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
2182 if (configuration != 'Checked') {
2185 if (isCorefxTesting(scenario)) {
2188 //Skip stress modes for these scenarios
2189 if (os == 'RHEL7.2' || os == 'Debian8.4') {
2193 // If this is a r2r jitstress, jitstressregs, jitminopts or forcerelocs scenario
2194 // and configuration is not Checked, bail out.
2195 else if (configuration != 'Checked' && Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
2198 // For CentOS, we only want Checked/Release pri1 builds.
2199 else if (os == 'CentOS7.1') {
2200 if (scenario != 'pri1' &&
2201 scenario != 'r2r' &&
2202 scenario != 'pri1r2r' &&
2203 scenario != 'gcstress15_pri1r2r' &&
2204 Constants.r2rJitStressScenarios.indexOf(scenario) == -1) {
2207 if (configuration != 'Checked' && configuration != 'Release') {
2211 // For RedHat and Debian, we only do Release pri1 builds.
2212 else if (os == 'RHEL7.2' || os == 'Debian8.4') {
2213 if (scenario != 'pri1') {
2216 if (configuration != 'Release') {
2228 if (configuration != 'Release') {
2233 if (configuration != 'Checked') {
2237 //Skip configs that aren't Checked or Release (so just Debug, for now)
2238 if (configuration != 'Checked' && configuration != 'Release') {
2243 //Skip configs that aren't Checked or Release (so just Debug, for now)
2244 if (configuration != 'Checked' && configuration != 'Release') {
2248 case 'gcstress15_pri1r2r':
2249 case 'r2r_jitstress1':
2250 case 'r2r_jitstress2':
2251 case 'r2r_jitstressregs1':
2252 case 'r2r_jitstressregs2':
2253 case 'r2r_jitstressregs3':
2254 case 'r2r_jitstressregs4':
2255 case 'r2r_jitstressregs8':
2256 case 'r2r_jitstressregs0x10':
2257 case 'r2r_jitstressregs0x80':
2258 case 'r2r_jitstressregs0x1000':
2259 case 'r2r_jitminopts':
2260 case 'r2r_jitforcerelocs':
2261 //Skip configs that aren't Checked or Release (so just Debug, for now)
2262 if (configuration != 'Checked' && configuration != 'Release') {
2268 // Long GC tests take a long time on non-Release builds
2269 if (configuration != 'Release') {
2273 case 'gc_reliability_framework':
2274 case 'standalone_gc':
2275 if (configuration != 'Release' && configuration != 'Checked') {
2280 //We only want Ubuntu Release for coverage
2281 if (os != 'Ubuntu') {
2284 if (configuration != 'Release') {
2290 if (os != 'Windows_NT' && os != 'Ubuntu') {
2298 println("Unknown scenario: ${scenario}")
2304 def lowerConfiguration = configuration.toLowerCase()
2305 def osGroup = getOSGroup(os)
2306 def jobName = getJobName(configuration, architecture, os, scenario, false) + "_tst"
2308 // Unless this is a coverage test run, we want to copy over the default build of coreclr.
2309 def inputScenario = 'default'
2310 if (scenario == 'coverage') {
2311 inputScenario = 'coverage'
2313 def inputCoreCLRBuildName = projectFolder + '/' +
2314 Utilities.getFullJobName(project, getJobName(configuration, architecture, os, inputScenario, false), isPR)
2315 // If this is a stress scenario, there isn't any difference in the build job
2316 // so we didn't create a build only job for windows_nt specific to that stress mode. Just copy
2317 // from the default scenario
2318 def testBuildScenario = scenario
2319 if (scenarioNeedsPri1Build(scenario)) {
2320 testBuildScenario = 'pri1'
2322 else if ( testBuildScenario == 'r2r' || Constants.r2rJitStressScenarios.indexOf(testBuildScenario) != -1 || isLongGc(testBuildScenario)) {
2323 testBuildScenario = 'default'
2325 def inputWindowTestsBuildName = ''
2326 def inputWindowsTestBuildArch = architecture
2327 if (architecture == "arm64") {
2328 // Use the x64 test build for arm64 unix
2329 inputWindowsTestBuildArch = "x64"
2331 if (Constants.jitStressModeScenarios.containsKey(testBuildScenario)) {
2332 inputWindowTestsBuildName = projectFolder + '/' +
2333 Utilities.getFullJobName(project, getJobName(configuration, inputWindowsTestBuildArch, 'windows_nt', 'default', true), isPR)
2336 inputWindowTestsBuildName = projectFolder + '/' +
2337 Utilities.getFullJobName(project, getJobName(configuration, inputWindowsTestBuildArch, 'windows_nt', testBuildScenario, true), isPR)
2339 // Enable Server GC for Ubuntu PR builds
2340 def serverGCString = ''
2342 // Whether or not this test run should be run sequentially instead
2343 // of in parallel. Only used for long GC tests.
2344 def sequentialString = ''
2346 // Whether or not this test run should run a specific playlist.
2347 // Only used for long GC tests.
2349 // A note - runtest.sh does have "--long-gc" and "--gcsimulator" options
2350 // for running long GC and GCSimulator tests, respectively. We don't use them
2351 // here because using a playlist file produces much more readable output on the CI machines
2352 // and reduces running time.
2353 def playlistString = ''
2355 if (os == 'Ubuntu' && isPR){
2356 serverGCString = '--useServerGC'
2359 // pass --crossgen to runtest.sh for crossgen builds
2360 def crossgenStr = ''
2361 def runcrossgentestsStr = ''
2362 def runjitstressStr = ''
2363 def runjitstressregsStr = ''
2364 def runjitmioptsStr = ''
2365 def runjitforcerelocsStr = ''
2366 def runjitdisasmStr = ''
2367 def runilasmroundtripStr = ''
2368 def gcstressStr = ''
2370 def layoutOnlyStr =''
2372 if (scenario == 'r2r' ||
2373 scenario == 'pri1r2r' ||
2374 scenario == 'gcstress15_pri1r2r' ||
2375 Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
2376 crossgenStr = '--crossgen'
2377 runcrossgentestsStr = '--runcrossgentests'
2379 if (scenario == 'r2r_jitstress1'){
2380 runjitstressStr = '--jitstress=1'
2382 else if (scenario == 'r2r_jitstress2') {
2383 runjitstressStr = '--jitstress=2'
2385 else if (scenario == 'r2r_jitstressregs1'){
2386 runjitstressregsStr = '--jitstressregs=1'
2388 else if (scenario == 'r2r_jitstressregs2') {
2389 runjitstressregsStr = '--jitstressregs=2'
2391 else if (scenario == 'r2r_jitstressregs3') {
2392 runjitstressregsStr = '--jitstressregs=3'
2394 else if (scenario == 'r2r_jitstressregs4') {
2395 runjitstressregsStr = '--jitstressregs=4'
2397 else if (scenario == 'r2r_jitstressregs8') {
2398 runjitstressregsStr = '--jitstressregs=8'
2400 else if (scenario == 'r2r_jitstressregs0x10') {
2401 runjitstressregsStr = '--jitstressregs=0x10'
2403 else if (scenario == 'r2r_jitstressregs0x80') {
2404 runjitstressregsStr = '--jitstressregs=0x80'
2406 else if (scenario == 'r2r_jitstressregs0x1000') {
2407 runjitstressregsStr = '--jitstressregs=0x1000'
2409 else if (scenario == 'r2r_jitminopts') {
2410 runjitmioptsStr = '--jitminopts'
2412 else if (scenario == 'r2r_jitforcerelocs') {
2413 runjitforcerelocsStr = '--jitforcerelocs'
2416 if (scenario == 'gcstress15_pri1r2r')
2418 gcstressStr = '--gcstresslevel=0xF'
2421 if (scenario == 'jitdiff')
2423 runjitdisasmStr = '--jitdisasm --crossgen'
2426 if (scenario == 'illink')
2428 illinkStr = '--link=\$WORKSPACE/linker/linker/bin/netcore_Release/netcoreapp2.0/ubuntu-x64/publish/illink'
2431 if (isLongGc(scenario)) {
2432 // Long GC tests behave very poorly when they are not
2433 // the only test running (many of them allocate until OOM).
2434 sequentialString = '--sequential'
2436 // The Long GC playlist contains all of the tests that are
2437 // going to be run. The GCSimulator playlist contains all of
2438 // the GC simulator tests.
2439 if (scenario == 'longgc') {
2440 playlistString = '--long-gc --playlist=./tests/longRunningGcTests.txt'
2442 else if (scenario == 'gcsimulator') {
2443 playlistString = '--gcsimulator --playlist=./tests/gcSimulatorTests.txt'
2447 if (isGcReliabilityFramework(scenario)) {
2448 layoutOnlyStr = '--build-overlay-only'
2451 def folder = getJobFolder(scenario)
2452 def newJob = job(Utilities.getFullJobName(project, jobName, isPR, folder)) {
2453 // Add parameters for the inputs
2456 stringParam('CORECLR_WINDOWS_BUILD', '', 'Build number to copy CoreCLR windows test binaries from')
2457 stringParam('CORECLR_BUILD', '', "Build number to copy CoreCLR ${osGroup} binaries from")
2461 // Set up the copies
2463 // Coreclr build containing the tests and mscorlib
2465 copyArtifacts(inputWindowTestsBuildName) {
2466 excludePatterns('**/testResults.xml', '**/*.ni.dll')
2468 buildNumber('${CORECLR_WINDOWS_BUILD}')
2472 if (scenario == 'coverage') {
2474 // Move coreclr to clr directory
2475 shell("rm -rf .clr; mkdir .clr; mv * .clr; mv .git .clr; mv .clr clr")
2478 shell("./clr/build.sh coverage verbose ${lowerConfiguration} ${architecture}")
2480 // Remove folders from obj that we don't expect to be covered. May update this later.
2481 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/ToolBox")
2482 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/debug")
2483 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/ilasm")
2484 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/ildasm")
2485 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/dlls/dbgshim")
2486 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/dlls/mscordac")
2487 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/dlls/mscordbi")
2490 shell("./clr/src/pal/tests/palsuite/runpaltests.sh \$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration} \$(pwd)/clr/bin/paltestout")
2492 // Remove obj files for PAL tests so they're not included in coverage results
2493 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/pal/tests")
2495 // Unzip the tests first. Exit with 0
2496 shell("unzip -q -o ./clr/bin/tests/tests.zip -d ./clr/bin/tests/Windows_NT.${architecture}.${configuration} || exit 0")
2499 shell("git clone https://github.com/dotnet/corefx fx")
2501 // Build Linux corefx
2502 shell("./fx/build-native.sh -release -buildArch=x64 -os=Linux")
2503 shell("./fx/build-managed.sh -release -buildArch=x64 -osgroup=Linux -skiptests")
2506 def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
2507 def createScriptCmds = genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios['heapverify1'], scriptFileName)
2508 shell("${createScriptCmds}")
2509 testEnvOpt = "--test-env=" + scriptFileName
2512 shell("""./fx/run-test.sh \\
2513 --coreclr-bins \$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration} \\
2514 --mscorlib-bins \$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration} \\
2515 --corefx-tests \$(pwd)/fx/bin/tests/${osGroup}.AnyCPU.${configuration} \\
2516 --corefx-native-bins \$(pwd)/fx/bin/${osGroup}.${architecture}.${configuration} \\
2517 --configurationGroup Release""")
2520 // Run coreclr tests w/ workstation GC
2521 shell("""./clr/tests/runtest.sh \\
2522 --testRootDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2523 --testNativeBinDir=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2524 --coreClrBinDir=\"\$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2525 --mscorlibDir=\"\$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2526 --coreFxBinDir=\"\$(pwd)/fx/bin/runtime/netcoreapp-${osGroup}-Release-${architecture}\" \\
2527 --crossgen --runcrossgentests""")
2529 // Run coreclr tests w/ server GC & HeapVerify enabled
2530 shell("""./clr/tests/runtest.sh \\
2531 --testRootDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2532 --testNativeBinDir=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2533 --coreOverlayDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}/Tests/coreoverlay\" \\
2534 --useServerGC ${testEnvOpt}""")
2536 // Run long-running coreclr GC tests & produce coverage reports
2537 shell("""./clr/tests/runtest.sh \\
2538 --testRootDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2539 --testNativeBinDir=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2540 --coreOverlayDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}/Tests/coreoverlay\" \\
2541 --long-gc --playlist=\"\$(pwd)/clr/tests/longRunningGcTests.txt\" --coreclr-coverage\\
2542 --coreclr-objs=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}\" \\
2543 --coreclr-src=\"\$(pwd)/clr/src\" \\
2544 --coverage-output-dir=\"\${WORKSPACE}/coverage\" """)
2549 // Coreclr build we are trying to test
2551 copyArtifacts(inputCoreCLRBuildName) {
2552 excludePatterns('**/testResults.xml', '**/*.ni.dll')
2554 buildNumber('${CORECLR_BUILD}')
2558 def corefxFolder = Utilities.getFolderName('dotnet/corefx') + '/' + Utilities.getFolderName(branch)
2560 // Corefx components. We now have full stack builds on all distros we test here, so we can copy straight from CoreFX jobs.
2562 if (os == 'Ubuntu') {
2563 osJobName = 'ubuntu14.04'
2566 osJobName = os.toLowerCase()
2568 copyArtifacts("${corefxFolder}/${osJobName}_release") {
2569 includePatterns('bin/build.tar.gz')
2571 latestSuccessful(true)
2575 shell ("mkdir ./bin/CoreFxBinDir")
2576 // Unpack the corefx binaries
2577 shell("tar -xf ./bin/build.tar.gz -C ./bin/CoreFxBinDir")
2579 // HACK -- Arm64 does not have corefx jobs yet.
2580 // Clone corefx and build the native packages overwriting the x64 packages.
2581 if (architecture == 'arm64') {
2582 shell("cp ./bin/Product/Linux.arm64.${configuration}/corefxNative/* ./bin/CoreFxBinDir")
2583 shell("chmod +x ./bin/Product/Linux.arm64.${configuration}/corerun")
2586 // Unzip the tests first. Exit with 0
2587 shell("unzip -q -o ./bin/tests/tests.zip -d ./bin/tests/Windows_NT.${architecture}.${configuration} || exit 0")
2589 // Execute the tests
2590 // If we are running a stress mode, we'll set those variables first
2592 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
2593 def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
2594 def createScriptCmds = genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], scriptFileName)
2595 shell("${createScriptCmds}")
2596 testEnvOpt = "--test-env=" + scriptFileName
2599 if (isGCStressRelatedTesting(scenario)) {
2600 shell('./init-tools.sh')
2603 shell("""./tests/runtest.sh \\
2604 --testRootDir=\"\${WORKSPACE}/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2605 --testNativeBinDir=\"\${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2606 --coreClrBinDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2607 --mscorlibDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2608 --coreFxBinDir=\"\${WORKSPACE}/bin/CoreFxBinDir\" \\
2609 --limitedDumpGeneration \\
2610 ${testEnvOpt} ${serverGCString} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} \\
2611 ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${runjitdisasmStr} ${runilasmroundtripStr} \\
2612 ${illinkStr} ${sequentialString} ${playlistString} ${layoutOnlyStr}""")
2614 if (isGcReliabilityFramework(scenario)) {
2615 // runtest.sh doesn't actually execute the reliability framework - do it here.
2616 if (serverGCString != '') {
2617 shell("export COMPlus_gcServer=1")
2620 shell("./tests/scripts/run-gc-reliability-framework.sh ${architecture} ${configuration}")
2626 if (scenario == 'coverage') {
2627 // Publish coverage reports
2628 Utilities.addHtmlPublisher(newJob, '${WORKSPACE}/coverage/Coverage/reports', 'Code Coverage Report', 'coreclr.html')
2629 // TODO: Add once external email sending is available again
2630 // addEmailPublisher(newJob, 'clrcoverage@microsoft.com')
2633 if (scenario == 'jitdiff') {
2634 Utilities.addArchival(newJob, "bin/tests/${osGroup}.${architecture}.${configuration}/dasm/**")
2637 // Experimental: If on Ubuntu 14.04, then attempt to pull in crash dump links
2638 if (os in ['Ubuntu']) {
2639 SummaryBuilder summaries = new SummaryBuilder()
2640 summaries.addLinksSummaryFromFile('Crash dumps from this run:', 'dumplings.txt')
2641 summaries.emit(newJob)
2644 setMachineAffinity(newJob, os, architecture)
2645 Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
2646 // Set timeouts to 240.
2647 setTestJobTimeOut(newJob, scenario)
2649 if (architecture == 'arm64') {
2650 Utilities.setJobTimeout(newJob, 480)
2653 Utilities.addXUnitDotNETResults(newJob, '**/coreclrtests.xml')
2655 // Create a build flow to join together the build and tests required to run this
2657 // Windows CoreCLR build and Linux CoreCLR build (in parallel) ->
2658 // Linux CoreCLR test
2659 def flowJobName = getJobName(configuration, architecture, os, scenario, false) + "_flow"
2660 def fullTestJobName = projectFolder + '/' + newJob.name
2661 // Add a reference to the input jobs for report purposes
2662 JobReport.Report.addReference(inputCoreCLRBuildName)
2663 JobReport.Report.addReference(inputWindowTestsBuildName)
2664 JobReport.Report.addReference(fullTestJobName)
2667 // If this is a coverage job, we don't copy any input coreCLR build - instead, we build it as part of the flow job,
2668 // so that coverage data can be preserved.
2669 if (scenario == 'coverage') {
2670 newFlowJob = buildFlowJob(Utilities.getFullJobName(project, flowJobName, isPR, folder)) {
2672 // Build the input Windows job
2673 windowsBuildJob = build(params, '${inputWindowTestsBuildName}')
2675 // And then build the test build
2676 build(params + [CORECLR_WINDOWS_BUILD: windowsBuildJob.build.number], '${fullTestJobName}')
2679 // Normal jobs copy a Windows build & a non-Windows build
2681 newFlowJob = buildFlowJob(Utilities.getFullJobName(project, flowJobName, isPR, folder)) {
2683 // Build the input jobs in parallel
2685 { coreclrBuildJob = build(params, '${inputCoreCLRBuildName}') },
2686 { windowsBuildJob = build(params, '${inputWindowTestsBuildName}') }
2689 // And then build the test build
2690 build(params + [CORECLR_BUILD: coreclrBuildJob.build.number,
2691 CORECLR_WINDOWS_BUILD: windowsBuildJob.build.number], '${fullTestJobName}')
2696 setMachineAffinity(newFlowJob, os, architecture)
2697 Utilities.standardJobSetup(newFlowJob, project, isPR, "*/${branch}")
2698 addTriggers(newFlowJob, branch, isPR, architecture, os, configuration, scenario, true, false)
2705 JobReport.Report.generateJobReport(out)
2707 // Make the call to generate the help job
2708 Utilities.createHelperJob(this, project, branch,
2709 "Welcome to the ${project} Repository", // This is prepended to the help message
2710 "Have a nice day!") // This is appended to the help message. You might put known issues here.
2712 Utilities.addCROSSCheck(this, project, branch)