1 // Import the utility functionality.
3 import jobs.generation.*
5 // The input project name (e.g. dotnet/coreclr)
6 def project = GithubProject
7 // The input branch name (e.g. master)
8 def branch = GithubBranchName
9 def projectFolder = Utilities.getFolderName(project) + '/' + Utilities.getFolderName(branch)
11 // Create a folder for JIT stress jobs and associated folder views
13 Utilities.addStandardFolderView(this, 'jitstress', project)
15 // Create a folder for testing via illink
17 Utilities.addStandardFolderView(this, 'illink', project)
19 def static getOSGroup(def os) {
20 def osGroupMap = ['Ubuntu':'Linux',
22 'Ubuntu16.04': 'Linux',
23 'Ubuntu16.10': 'Linux',
27 'Windows_NT':'Windows_NT',
30 def osGroup = osGroupMap.get(os, null)
31 assert osGroup != null : "Could not find os group for ${os}"
35 // We use this class (vs variables) so that the static functions can access data here.
38 // Innerloop build OS's
39 // The Windows_NT_BuildOnly OS is a way to speed up the Non-NT builds temporarily by avoiding
40 // test execution in the build flow runs. It generates the exact same build
41 // as Windows_NT but without the tests.
47 'Windows_NT_BuildOnly',
55 def static crossList = ['Ubuntu', 'OSX10.12', 'CentOS7.1', 'RHEL7.2', 'Debian8.4']
57 // This is a set of JIT stress modes combined with the set of variables that
58 // need to be set to actually enable that stress mode. The key of the map is the stress mode and
59 // the values are the environment variables
60 def static jitStressModeScenarios = [
61 'minopts' : ['COMPlus_JITMinOpts' : '1'],
62 'tieredcompilation' : ['COMPlus_EXPERIMENTAL_TieredCompilation' : '1'],
63 'forcerelocs' : ['COMPlus_ForceRelocs' : '1'],
64 'jitstress1' : ['COMPlus_JitStress' : '1'],
65 'jitstress2' : ['COMPlus_JitStress' : '2'],
66 'jitstressregs1' : ['COMPlus_JitStressRegs' : '1'],
67 'jitstressregs2' : ['COMPlus_JitStressRegs' : '2'],
68 'jitstressregs3' : ['COMPlus_JitStressRegs' : '3'],
69 'jitstressregs4' : ['COMPlus_JitStressRegs' : '4'],
70 'jitstressregs8' : ['COMPlus_JitStressRegs' : '8'],
71 'jitstressregs0x10' : ['COMPlus_JitStressRegs' : '0x10'],
72 'jitstressregs0x80' : ['COMPlus_JitStressRegs' : '0x80'],
73 'jitstressregs0x1000' : ['COMPlus_JitStressRegs' : '0x1000'],
74 'jitstress2_jitstressregs1' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '1'],
75 'jitstress2_jitstressregs2' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '2'],
76 'jitstress2_jitstressregs3' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '3'],
77 'jitstress2_jitstressregs4' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '4'],
78 'jitstress2_jitstressregs8' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '8'],
79 'jitstress2_jitstressregs0x10' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '0x10'],
80 'jitstress2_jitstressregs0x80' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '0x80'],
81 'jitstress2_jitstressregs0x1000' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '0x1000'],
82 'tailcallstress' : ['COMPlus_TailcallStress' : '1'],
83 'jitsse2only' : ['COMPlus_EnableAVX' : '0', 'COMPlus_EnableSSE3_4' : '0'],
84 'corefx_baseline' : [ : ], // corefx baseline
85 'corefx_minopts' : ['COMPlus_JITMinOpts' : '1'],
86 'corefx_tieredcompilation' : ['COMPlus_EXPERIMENTAL_TieredCompilation' : '1'],
87 'corefx_jitstress1' : ['COMPlus_JitStress' : '1'],
88 'corefx_jitstress2' : ['COMPlus_JitStress' : '2'],
89 'corefx_jitstressregs1' : ['COMPlus_JitStressRegs' : '1'],
90 'corefx_jitstressregs2' : ['COMPlus_JitStressRegs' : '2'],
91 'corefx_jitstressregs3' : ['COMPlus_JitStressRegs' : '3'],
92 'corefx_jitstressregs4' : ['COMPlus_JitStressRegs' : '4'],
93 'corefx_jitstressregs8' : ['COMPlus_JitStressRegs' : '8'],
94 'corefx_jitstressregs0x10' : ['COMPlus_JitStressRegs' : '0x10'],
95 'corefx_jitstressregs0x80' : ['COMPlus_JitStressRegs' : '0x80'],
96 'corefx_jitstressregs0x1000' : ['COMPlus_JitStressRegs' : '0x1000'],
97 'gcstress0x3' : ['COMPlus_GCStress' : '0x3'],
98 'gcstress0xc' : ['COMPlus_GCStress' : '0xC'],
99 'zapdisable' : ['COMPlus_ZapDisable' : '1', 'COMPlus_ReadyToRun' : '0'],
100 'heapverify1' : ['COMPlus_HeapVerify' : '1'],
101 'gcstress0xc_zapdisable' : ['COMPlus_GCStress' : '0xC', 'COMPlus_ZapDisable' : '1', 'COMPlus_ReadyToRun' : '0'],
102 'gcstress0xc_zapdisable_jitstress2' : ['COMPlus_GCStress' : '0xC', 'COMPlus_ZapDisable' : '1', 'COMPlus_ReadyToRun' : '0', 'COMPlus_JitStress' : '2'],
103 'gcstress0xc_zapdisable_heapverify1' : ['COMPlus_GCStress' : '0xC', 'COMPlus_ZapDisable' : '1', 'COMPlus_ReadyToRun' : '0', 'COMPlus_HeapVerify' : '1'],
104 'gcstress0xc_jitstress1' : ['COMPlus_GCStress' : '0xC', 'COMPlus_JitStress' : '1'],
105 'gcstress0xc_jitstress2' : ['COMPlus_GCStress' : '0xC', 'COMPlus_JitStress' : '2'],
106 'gcstress0xc_minopts_heapverify1' : ['COMPlus_GCStress' : '0xC', 'COMPlus_JITMinOpts' : '1', 'COMPlus_HeapVerify' : '1']
109 // This is a set of r2r jit stress scenarios
110 def static r2rJitStressScenarios = [
113 'r2r_jitstressregs1',
114 'r2r_jitstressregs2',
115 'r2r_jitstressregs3',
116 'r2r_jitstressregs4',
117 'r2r_jitstressregs8',
118 'r2r_jitstressregs0x10',
119 'r2r_jitstressregs0x80',
120 'r2r_jitstressregs0x1000',
122 'r2r_jitforcerelocs']
124 // This is the basic set of scenarios
125 def static basicScenarios = [
131 'gcstress15_pri1r2r',
138 'gc_reliability_framework',
139 'illink'] + r2rJitStressScenarios
141 def static configurationList = ['Debug', 'Checked', 'Release']
143 // This is the set of architectures
144 def static architectureList = ['arm', 'arm64', 'x64', 'x86', 'x86lb']
147 def static setMachineAffinity(def job, def os, def architecture, def options = null) {
148 if (architecture == 'arm64' && os == 'Windows_NT') {
149 Utilities.setMachineAffinity(job, os, 'latest-arm64');
150 } else if (architecture == 'arm64' && os != 'Windows_NT' && options == null) {
151 Utilities.setMachineAffinity(job, os, 'arm64-small-page-size');
152 } else if (architecture == 'arm64' && os != 'Windows_NT' && options['large_pages'] == true) {
153 Utilities.setMachineAffinity(job, os, 'arm64-huge-page-size');
154 } else if (architecture == 'arm64' && os != 'Windows_NT' && options['is_build_only'] == true) {
155 Utilities.setMachineAffinity(job, os, 'arm64-cross-latest');
156 } else if ((architecture == 'arm') && (os == 'Ubuntu' || os == 'Ubuntu16.04' || os == 'Tizen')) {
157 Utilities.setMachineAffinity(job, 'Ubuntu', 'arm-cross-latest');
158 } else if ((architecture == 'arm') && (os == 'Windows_NT') && options['use_arm64_build_machine'] == true) {
159 Utilities.setMachineAffinity(job, os, 'latest-arm64');
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) || isLongGc(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 // We would normally want a per-push trigger, but with limited hardware we can't keep up
398 Utilities.addPeriodicTrigger(job, "H H/4 * * *")
401 println("Unknown architecture: ${architecture}");
407 // Pri one gets a push trigger, and only for release
408 if (architecture == 'x64') {
409 if (configuration == 'Release') {
410 // We expect release jobs to be Windows, or in the cross list
411 assert (os == 'Windows_NT') || (os in Constants.crossList)
412 if (!os in bidailyCrossList) {
413 if (isFlowJob || os == 'Windows_NT') {
414 Utilities.addGithubPushTrigger(job)
419 Utilities.addPeriodicTrigger(job, 'H H/12 * * *')
426 //r2r jobs that aren't pri1 can only be triggered by phrase
429 assert !(os in bidailyCrossList)
430 //pri1 r2r gets a push trigger for checked/release
431 if (configuration == 'Checked' || configuration == 'Release') {
432 assert (os == 'Windows_NT') || (os in Constants.crossList)
433 if (architecture == 'x64' && os != 'OSX10.12') {
434 //Flow jobs should be Windows, Ubuntu, OSX0.12, or CentOS
435 if (isFlowJob || os == 'Windows_NT') {
436 Utilities.addGithubPushTrigger(job)
438 // OSX10.12 pri1r2r jobs should only run every 12 hours, not daily.
439 } else if (architecture == 'x64' && os == 'OSX10.12'){
441 Utilities.addPeriodicTrigger(job, 'H H/12 * * *')
444 // For x86, only add per-commit jobs for Windows
445 else if (architecture == 'x86' || architecture == 'x86lb') {
446 if (os == 'Windows_NT') {
447 Utilities.addGithubPushTrigger(job)
450 // arm64 pri1r2r jobs should only run every 12 hours.
451 else if (architecture == 'arm64') {
452 if (os == 'Windows_NT') {
453 Utilities.addPeriodicTrigger(job, 'H H/12 * * *')
454 // TODO: Add once external email sending is available again
455 // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
460 case 'r2r_jitstress1':
461 case 'r2r_jitstress2':
462 case 'r2r_jitstressregs1':
463 case 'r2r_jitstressregs2':
464 case 'r2r_jitstressregs3':
465 case 'r2r_jitstressregs4':
466 case 'r2r_jitstressregs8':
467 case 'r2r_jitstressregs0x10':
468 case 'r2r_jitstressregs0x80':
469 case 'r2r_jitstressregs0x1000':
470 case 'r2r_jitminopts':
471 case 'r2r_jitforcerelocs':
472 case 'gcstress15_pri1r2r':
473 assert !(os in bidailyCrossList)
475 // GCStress=C is currently not supported on OS X
476 if (os == 'OSX10.12' && isGCStressRelatedTesting(scenario)) {
480 //GC Stress 15 pri1 r2r gets a push trigger for checked/release
481 if (configuration == 'Checked' || configuration == 'Release') {
482 assert (os == 'Windows_NT') || (os in Constants.crossList)
483 if (architecture == 'x64') {
484 //Flow jobs should be Windows, Ubuntu, OSX10.12, or CentOS
485 if (isFlowJob || os == 'Windows_NT') {
486 // Add a weekly periodic trigger
487 Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
490 // For x86, only add per-commit jobs for Windows
491 else if (architecture == 'x86') {
492 if (os == 'Windows_NT') {
493 Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
499 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
500 assert configuration == 'Release'
501 assert architecture == 'x64'
502 Utilities.addPeriodicTrigger(job, '@daily')
503 // TODO: Add once external email sending is available again
504 // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
507 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
508 assert configuration == 'Release'
509 assert architecture == 'x64'
510 Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
511 // TODO: Add once external email sending is available again
512 // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
514 case 'standalone_gc':
515 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
516 assert (configuration == 'Release' || configuration == 'Checked')
517 // TODO: Add once external email sending is available again
518 // addEmailPublisher(job, 'dotnetgctests@microsoft.com')
519 Utilities.addPeriodicTrigger(job, '@weekly')
521 case 'gc_reliability_framework':
522 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
523 assert (configuration == 'Release' || configuration == 'Checked')
524 // Only triggered by phrase.
527 assert !(os in bidailyCrossList)
528 // ILASM/ILDASM roundtrip one gets a daily build, and only for release
529 if (architecture == 'x64' && configuration == 'Release') {
530 // We don't expect to see a job generated except in these scenarios
531 assert (os == 'Windows_NT') || (os in Constants.crossList)
532 if (isFlowJob || os == 'Windows_NT') {
533 Utilities.addPeriodicTrigger(job, '@daily')
538 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX10.12')
539 assert configuration == 'Checked'
540 assert (architecture == 'x64' || architecture == 'x86')
541 Utilities.addGithubPushTrigger(job)
544 assert (os == 'Ubuntu' || os == 'Windows_NT')
545 assert configuration == 'Release'
546 assert architecture == 'x64'
547 Utilities.addPeriodicTrigger(job, '@weekly')
550 assert (os == 'Windows_NT' || os == "Ubuntu")
551 assert architecture == 'x64'
552 Utilities.addGithubPushTrigger(job)
554 case 'jitstressregs1':
555 case 'jitstressregs2':
556 case 'jitstressregs3':
557 case 'jitstressregs4':
558 case 'jitstressregs8':
559 case 'jitstressregs0x10':
560 case 'jitstressregs0x80':
561 case 'jitstressregs0x1000':
566 case 'jitstress2_jitstressregs1':
567 case 'jitstress2_jitstressregs2':
568 case 'jitstress2_jitstressregs3':
569 case 'jitstress2_jitstressregs4':
570 case 'jitstress2_jitstressregs8':
571 case 'jitstress2_jitstressregs0x10':
572 case 'jitstress2_jitstressregs0x80':
573 case 'jitstress2_jitstressregs0x1000':
574 case 'tailcallstress':
576 case 'corefx_baseline':
577 case 'corefx_minopts':
578 case 'corefx_jitstress1':
579 case 'corefx_jitstress2':
580 case 'corefx_jitstressregs1':
581 case 'corefx_jitstressregs2':
582 case 'corefx_jitstressregs3':
583 case 'corefx_jitstressregs4':
584 case 'corefx_jitstressregs8':
585 case 'corefx_jitstressregs0x10':
586 case 'corefx_jitstressregs0x80':
587 case 'corefx_jitstressregs0x1000':
589 if (os != 'CentOS7.1' && !(os in bidailyCrossList)) {
590 assert (os == 'Windows_NT') || (os in Constants.crossList)
591 Utilities.addPeriodicTrigger(job, '@daily')
596 if (os != 'CentOS7.1' && !(os in bidailyCrossList)) {
597 assert (os == 'Windows_NT') || (os in Constants.crossList)
598 if (architecture == 'arm64') {
599 if (os == 'Windows_NT') {
600 Utilities.addPeriodicTrigger(job, '@daily')
602 // TODO: Add once external email sending is available again
603 // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
606 Utilities.addPeriodicTrigger(job, '@weekly')
611 case 'gcstress0xc_zapdisable':
612 case 'gcstress0xc_zapdisable_jitstress2':
613 case 'gcstress0xc_zapdisable_heapverify1':
614 case 'gcstress0xc_jitstress1':
615 case 'gcstress0xc_jitstress2':
616 case 'gcstress0xc_minopts_heapverify1':
617 // GCStress=C is currently not supported on OS X
618 if (os != 'CentOS7.1' && os != 'OSX10.12' && !(os in bidailyCrossList)) {
619 assert (os == 'Windows_NT') || (os in Constants.crossList)
620 if (architecture == 'arm64') {
621 // TODO: Enable a periodic trigger after tests are updated.
622 // Utilities.addPeriodicTrigger(job, '@daily')
623 // TODO: Add once external email sending is available again
624 // addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
627 Utilities.addPeriodicTrigger(job, '@weekly')
633 // Testing on other operating systems TBD
634 assert (os == 'Windows_NT' || os == 'Ubuntu')
635 if (architecture == 'x64' || architecture == 'x86') {
636 if (configuration == 'Checked') {
637 Utilities.addPeriodicTrigger(job, '@daily')
642 case 'tieredcompilation':
643 case 'corefx_tieredcompilation':
644 // No periodic jobs just yet, still testing
648 println("Unknown scenario: ${scenario}");
655 // **************************
656 // Define the basic inner loop builds for PR and commit. This is basically just the set
657 // of coreclr builds over linux/osx 10.12/windows and debug/release/checked. In addition, the windows
658 // builds will do a couple extra steps.
659 // **************************
661 // Adds a trigger for the PR build if one is needed. If isFlowJob is true, then this is the
662 // flow job that rolls up the build and test for non-windows OS's. // If the job is a windows build only job,
663 // it's just used for internal builds
664 // If you add a job with a trigger phrase, please add that phrase to coreclr/Documentation/project-docs/ci-trigger-phrases.md
665 def static addTriggers(def job, def branch, def isPR, def architecture, def os, def configuration, def scenario, def isFlowJob, def isWindowsBuildOnlyJob) {
666 if (isWindowsBuildOnlyJob) {
670 def bidailyCrossList = ['RHEL7.2', 'Debian8.4']
671 // Non pull request builds.
673 addNonPRTriggers(job, branch, isPR, architecture, os, configuration, scenario, isFlowJob, isWindowsBuildOnlyJob, bidailyCrossList)
703 // Pull request builds. Generally these fall into two categories: default triggers and on-demand triggers
704 // We generally only have a distinct set of default triggers but a bunch of on-demand ones.
705 def osGroup = getOSGroup(os)
706 switch (architecture) {
707 case 'x64': // editor brace matching: {
708 if (scenario == 'coverage') {
709 assert configuration == 'Release'
710 if (os == 'Ubuntu') {
711 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Coverage Build & Test", "(?i).*test\\W+coverage.*")
716 if (scenario == 'formatting') {
717 assert configuration == 'Checked'
718 if (os == 'Windows_NT' || os == 'Ubuntu') {
719 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Formatting")
725 // OpenSUSE, Debian & RedHat get trigger phrases for pri 0 build, and pri 1 build & test
728 if (scenario == 'default') {
730 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", "(?i).*test\\W+${os}.*")
732 else if (scenario == 'pri1' && isFlowJob) {
733 assert (configuration == 'Release')
734 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Pri 1 Build & Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
739 assert scenario == 'default'
740 // Distinguish with the other architectures (arm and x86)
741 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", "(?i).*test\\W+${os}\\W+${architecture}.*")
746 assert scenario == 'default'
747 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", "(?i).*test\\W+${os}\\W+.*")
750 if (scenario == 'illink') {
751 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
756 // Triggers on the non-flow jobs aren't necessary here
757 // Corefx testing uses non-flow jobs.
758 if (!isFlowJob && !isCorefxTesting(scenario)) {
763 // Ubuntu uses checked for default PR tests
764 if (configuration == 'Checked') {
766 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test")
770 if (configuration == 'Release') {
771 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
775 if (configuration == 'Checked') {
776 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Jit Diff Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
780 if (configuration == 'Release') {
781 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
785 if (configuration == 'Release' || configuration == 'Checked') {
786 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
790 if (configuration == 'Release' || configuration == 'Checked') {
791 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
794 case 'gcstress15_pri1r2r':
795 if (configuration == 'Release' || configuration == 'Checked') {
796 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
799 case 'r2r_jitstress1':
800 case 'r2r_jitstress2':
801 case 'r2r_jitstressregs1':
802 case 'r2r_jitstressregs2':
803 case 'r2r_jitstressregs3':
804 case 'r2r_jitstressregs4':
805 case 'r2r_jitstressregs8':
806 case 'r2r_jitstressregs0x10':
807 case 'r2r_jitstressregs0x80':
808 case 'r2r_jitstressregs0x1000':
809 case 'r2r_jitminopts':
810 case 'r2r_jitforcerelocs':
811 if (configuration == 'Release' || configuration == 'Checked') {
812 def displayStr = getR2RStressModeDisplayName(scenario)
813 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
817 if (configuration == 'Release') {
818 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
822 if (configuration == 'Release') {
823 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
826 case 'standalone_gc':
827 if (configuration == 'Release' || configuration == 'Checked') {
828 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
831 case 'gc_reliability_framework':
832 if (configuration == 'Release' || configuration == 'Checked') {
833 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Reliability Framework", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
837 case 'tieredcompilation':
841 case 'jitstressregs1':
842 case 'jitstressregs2':
843 case 'jitstressregs3':
844 case 'jitstressregs4':
845 case 'jitstressregs8':
846 case 'jitstressregs0x10':
847 case 'jitstressregs0x80':
848 case 'jitstressregs0x1000':
849 case 'jitstress2_jitstressregs1':
850 case 'jitstress2_jitstressregs2':
851 case 'jitstress2_jitstressregs3':
852 case 'jitstress2_jitstressregs4':
853 case 'jitstress2_jitstressregs8':
854 case 'jitstress2_jitstressregs0x10':
855 case 'jitstress2_jitstressregs0x80':
856 case 'jitstress2_jitstressregs0x1000':
857 case 'tailcallstress':
863 case 'gcstress0xc_zapdisable':
864 case 'gcstress0xc_zapdisable_jitstress2':
865 case 'gcstress0xc_zapdisable_heapverify1':
866 case 'gcstress0xc_jitstress1':
867 case 'gcstress0xc_jitstress2':
868 case 'gcstress0xc_minopts_heapverify1':
869 def displayStr = getStressModeDisplayName(scenario)
870 assert (os == 'Windows_NT') || (os in Constants.crossList)
871 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
872 "(?i).*test\\W+${os}\\W+${scenario}.*")
874 case 'corefx_baseline':
875 case 'corefx_minopts':
876 case 'corefx_tieredcompilation':
877 case 'corefx_jitstress1':
878 case 'corefx_jitstress2':
879 case 'corefx_jitstressregs1':
880 case 'corefx_jitstressregs2':
881 case 'corefx_jitstressregs3':
882 case 'corefx_jitstressregs4':
883 case 'corefx_jitstressregs8':
884 case 'corefx_jitstressregs0x10':
885 case 'corefx_jitstressregs0x80':
886 case 'corefx_jitstressregs0x1000':
887 def displayName = ('CoreFx ' + getStressModeDisplayName(scenario)).trim()
888 assert (os == 'Windows_NT') || (os in Constants.crossList)
889 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayName})",
890 "(?i).*test\\W+${os}\\W+${architecture}\\W+${scenario}.*")
893 println("Unknown scenario: ${scenario}");
901 if (configuration == 'Release') {
902 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
906 if (configuration == 'Checked' || configuration == 'Release') {
907 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
911 if (configuration == 'Checked' || configuration == 'Release') {
912 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
915 case 'gcstress15_pri1r2r':
916 if (configuration == 'Release' || configuration == 'Checked') {
917 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
920 case 'r2r_jitstress1':
921 case 'r2r_jitstress2':
922 case 'r2r_jitstressregs1':
923 case 'r2r_jitstressregs2':
924 case 'r2r_jitstressregs3':
925 case 'r2r_jitstressregs4':
926 case 'r2r_jitstressregs8':
927 case 'r2r_jitstressregs0x10':
928 case 'r2r_jitstressregs0x80':
929 case 'r2r_jitstressregs0x1000':
930 case 'r2r_jitminopts':
931 case 'r2r_jitforcerelocs':
932 if (configuration == 'Release' || configuration == 'Checked') {
933 def displayStr = getR2RStressModeDisplayName(scenario)
934 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
944 if (configuration == 'Debug') {
945 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test")
950 if (configuration == 'Release') {
951 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test")
955 if (configuration == 'Checked') {
956 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Jit Diff Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
960 if (configuration == 'Release') {
961 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
965 if (configuration == 'Checked' || configuration == 'Release') {
966 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
970 if (configuration == 'Checked' || configuration == 'Release') {
971 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
974 case 'gcstress15_pri1r2r':
975 if (configuration == 'Release' || configuration == 'Checked') {
976 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
979 case 'r2r_jitstress1':
980 case 'r2r_jitstress2':
981 case 'r2r_jitstressregs1':
982 case 'r2r_jitstressregs2':
983 case 'r2r_jitstressregs3':
984 case 'r2r_jitstressregs4':
985 case 'r2r_jitstressregs8':
986 case 'r2r_jitstressregs0x10':
987 case 'r2r_jitstressregs0x80':
988 case 'r2r_jitstressregs0x1000':
989 case 'r2r_jitminopts':
990 case 'r2r_jitforcerelocs':
991 if (configuration == 'Release' || configuration == 'Checked') {
992 def displayStr = getR2RStressModeDisplayName(scenario)
993 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
997 if (configuration == 'Release') {
998 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1002 if (configuration == 'Release') {
1003 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1006 case 'standalone_gc':
1007 if (configuration == 'Release' || configuration == 'Checked') {
1008 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1011 case 'gc_reliability_framework':
1012 if (configuration == 'Release' || configuration == 'Checked') {
1013 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Reliability Framework", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1017 case 'tieredcompilation':
1021 case 'jitstressregs1':
1022 case 'jitstressregs2':
1023 case 'jitstressregs3':
1024 case 'jitstressregs4':
1025 case 'jitstressregs8':
1026 case 'jitstressregs0x10':
1027 case 'jitstressregs0x80':
1028 case 'jitstressregs0x1000':
1029 case 'jitstress2_jitstressregs1':
1030 case 'jitstress2_jitstressregs2':
1031 case 'jitstress2_jitstressregs3':
1032 case 'jitstress2_jitstressregs4':
1033 case 'jitstress2_jitstressregs8':
1034 case 'jitstress2_jitstressregs0x10':
1035 case 'jitstress2_jitstressregs0x80':
1036 case 'jitstress2_jitstressregs0x1000':
1037 case 'tailcallstress':
1043 case 'gcstress0xc_zapdisable':
1044 case 'gcstress0xc_zapdisable_jitstress2':
1045 case 'gcstress0xc_zapdisable_heapverify1':
1046 case 'gcstress0xc_jitstress1':
1047 case 'gcstress0xc_jitstress2':
1048 case 'gcstress0xc_minopts_heapverify1':
1049 def displayStr = getStressModeDisplayName(scenario)
1050 assert (os == 'Windows_NT') || (os in Constants.crossList)
1051 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
1052 "(?i).*test\\W+${os}\\W+${scenario}.*")
1054 case 'corefx_baseline':
1055 case 'corefx_minopts':
1056 case 'corefx_tieredcompilation':
1057 case 'corefx_jitstress1':
1058 case 'corefx_jitstress2':
1059 case 'corefx_jitstressregs1':
1060 case 'corefx_jitstressregs2':
1061 case 'corefx_jitstressregs3':
1062 case 'corefx_jitstressregs4':
1063 case 'corefx_jitstressregs8':
1064 case 'corefx_jitstressregs0x10':
1065 case 'corefx_jitstressregs0x80':
1066 case 'corefx_jitstressregs0x1000':
1067 def displayName = ('CoreFx ' + getStressModeDisplayName(scenario)).trim()
1068 assert (os == 'Windows_NT') || (os in Constants.crossList)
1069 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayName})",
1070 "(?i).*test\\W+${os}\\W+${architecture}\\W+${scenario}.*")
1073 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1076 println("Unknown scenario: ${scenario}");
1082 println("Unknown os: ${os}");
1087 // editor brace matching: }
1088 case 'arm': // editor brace matching: {
1092 assert scenario == 'default'
1095 azureVMAgentPostBuildAction {
1096 agentPostBuildAction('Delete agent if the build was not successful (when idle).')
1100 if ((os == 'Ubuntu' && configuration == 'Release') || (os == 'Ubuntu16.04' && configuration == 'Debug')) {
1101 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build")
1104 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build", "(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
1108 architecture='armel'
1111 azureVMAgentPostBuildAction {
1112 agentPostBuildAction('Delete agent if the build was not successful (when idle).')
1116 // Removing the regex will cause this to run on each PR.
1117 if (configuration == 'Release' || configuration == 'Debug') {
1118 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build")
1121 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build", "(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
1125 // Set up a private trigger
1126 def contextString = "${os} ${architecture} Cross ${configuration}"
1127 if (scenario != 'default')
1128 contextString += " ${scenario}"
1129 contextString += " Build"
1130 // Debug builds only.
1131 if (configuration != 'Debug') {
1132 contextString += " and Test"
1136 // For now only run Debug and Release build jobs on PR Trigger. Note this is not a private trigger.
1137 if (configuration == 'Debug' || configuration == 'Release')
1139 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString,
1140 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*", null, arm64Users)
1144 // Checked jobs will run on private trigger and run tests.
1145 Utilities.addDefaultPrivateGithubPRTriggerForBranch(job, branch, contextString, null, arm64Users)
1151 // Stress jobs will will run on private trigger and run tests.
1152 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString,
1153 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*", null, arm64Users)
1158 println("NYI os: ${os}");
1163 // editor brace matching: }
1164 case 'arm64': // editor brace matching: {
1165 assert (scenario == 'default') || (scenario == 'pri1r2r') || (scenario == 'gcstress0x3') || (scenario == 'gcstress0xc')
1167 // Set up a private trigger
1168 def contextString = "${os} ${architecture} Cross ${configuration}"
1169 if (scenario != 'default')
1170 contextString += " ${scenario}"
1171 contextString += " Build"
1172 // Debug builds only.
1173 if (configuration != 'Debug') {
1174 contextString += " and Test"
1182 if (configuration == 'Release') {
1183 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
1187 if (configuration == 'Checked' || configuration == 'Release') {
1188 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1192 if (configuration == 'Checked' || configuration == 'Release') {
1193 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1196 case 'gcstress15_pri1r2r':
1197 if (configuration == 'Release' || configuration == 'Checked') {
1198 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1201 case 'r2r_jitstress1':
1202 case 'r2r_jitstress2':
1203 case 'r2r_jitstressregs1':
1204 case 'r2r_jitstressregs2':
1205 case 'r2r_jitstressregs3':
1206 case 'r2r_jitstressregs4':
1207 case 'r2r_jitstressregs8':
1208 case 'r2r_jitstressregs0x10':
1209 case 'r2r_jitstressregs0x80':
1210 case 'r2r_jitstressregs0x1000':
1211 case 'r2r_jitminopts':
1212 case 'r2r_jitforcerelocs':
1213 if (configuration == 'Release' || configuration == 'Checked') {
1214 def displayStr = getR2RStressModeDisplayName(scenario)
1215 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
1224 if (isFlowJob == true) {
1225 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration}", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*")
1228 // For now only run Debug jobs on PR Trigger.
1229 else if (configuration != 'Debug') {
1230 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString,
1231 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*", null, arm64Users)
1234 // Add "Checked Build And Test" and "Debug Build" to the above users' PRs since many of them
1235 // are at higher risk of ARM64-breaking changes.
1236 Utilities.addDefaultPrivateGithubPRTriggerForBranch(job, branch, contextString, null, arm64Users)
1242 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString,
1243 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*", null, arm64Users)
1248 println("NYI os: ${os}");
1253 // editor brace matching: }
1254 case 'x86': // editor brace matching: {
1255 assert ((os == 'Windows_NT') || ((os == 'Ubuntu') && (scenario == 'default')))
1256 if (os == 'Ubuntu') {
1257 // on-demand only for ubuntu x86
1258 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build",
1259 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*")
1264 if (configuration == 'Checked') {
1265 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test")
1267 else if (configuration == 'Release') {
1268 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test",
1269 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}.*")
1273 if (configuration == 'Release') {
1274 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test")
1278 if (configuration == 'Release') {
1279 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test",
1280 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1284 if (configuration == 'Checked' || configuration == 'Release') {
1285 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test",
1286 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1290 if (configuration == 'Checked' || configuration == 'Release') {
1291 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test",
1292 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1295 case 'gcstress15_pri1r2r':
1296 if (configuration == 'Release' || configuration == 'Checked') {
1297 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test",
1298 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1301 case 'r2r_jitstress1':
1302 case 'r2r_jitstress2':
1303 case 'r2r_jitstressregs1':
1304 case 'r2r_jitstressregs2':
1305 case 'r2r_jitstressregs3':
1306 case 'r2r_jitstressregs4':
1307 case 'r2r_jitstressregs8':
1308 case 'r2r_jitstressregs0x10':
1309 case 'r2r_jitstressregs0x80':
1310 case 'r2r_jitstressregs0x1000':
1311 case 'r2r_jitminopts':
1312 case 'r2r_jitforcerelocs':
1313 if (configuration == 'Release' || configuration == 'Checked') {
1314 def displayStr = getR2RStressModeDisplayName(scenario)
1315 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ${displayStr} R2R Build & Test",
1316 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1320 if (configuration == 'Release') {
1321 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test",
1322 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1326 if (configuration == 'Release') {
1327 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator",
1328 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1331 case 'standalone_gc':
1332 if (configuration == 'Release' || configuration == 'Checked') {
1333 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Standalone GC",
1334 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1338 case 'tieredcompilation':
1342 case 'jitstressregs1':
1343 case 'jitstressregs2':
1344 case 'jitstressregs3':
1345 case 'jitstressregs4':
1346 case 'jitstressregs8':
1347 case 'jitstressregs0x10':
1348 case 'jitstressregs0x80':
1349 case 'jitstressregs0x1000':
1350 case 'jitstress2_jitstressregs1':
1351 case 'jitstress2_jitstressregs2':
1352 case 'jitstress2_jitstressregs3':
1353 case 'jitstress2_jitstressregs4':
1354 case 'jitstress2_jitstressregs8':
1355 case 'jitstress2_jitstressregs0x10':
1356 case 'jitstress2_jitstressregs0x80':
1357 case 'jitstress2_jitstressregs0x1000':
1358 case 'tailcallstress':
1364 case 'gcstress0xc_zapdisable':
1365 case 'gcstress0xc_zapdisable_jitstress2':
1366 case 'gcstress0xc_zapdisable_heapverify1':
1367 case 'gcstress0xc_jitstress1':
1368 case 'gcstress0xc_jitstress2':
1369 case 'gcstress0xc_minopts_heapverify1':
1370 def displayStr = getStressModeDisplayName(scenario)
1371 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
1372 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1374 case 'corefx_baseline':
1375 case 'corefx_minopts':
1376 case 'corefx_tieredcompilation':
1377 case 'corefx_jitstress1':
1378 case 'corefx_jitstress2':
1379 case 'corefx_jitstressregs1':
1380 case 'corefx_jitstressregs2':
1381 case 'corefx_jitstressregs3':
1382 case 'corefx_jitstressregs4':
1383 case 'corefx_jitstressregs8':
1384 case 'corefx_jitstressregs0x10':
1385 case 'corefx_jitstressregs0x80':
1386 case 'corefx_jitstressregs0x1000':
1387 def displayName = ('CoreFx ' + getStressModeDisplayName(scenario)).trim()
1388 assert (os == 'Windows_NT') || (os in Constants.crossList)
1389 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayName})",
1390 "(?i).*test\\W+${os}\\W+${architecture}\\W+${scenario}.*")
1393 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
1396 println("Unknown scenario: ${os} ${architecture} ${scenario}");
1401 // editor brace matching: }
1402 case 'x86lb': // editor brace matching: {
1403 assert (os == 'Windows_NT')
1404 assert (scenario == 'default' || Constants.r2rJitStressScenarios.indexOf(scenario) !=1)
1407 def jit = 'legacy_backend'
1410 if (configuration == 'Checked') {
1411 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} Build and Test",
1412 "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}.*")
1416 println("Unknown scenario: ${os} ${arch} ${jit} ${scenario}");
1421 // editor brace matching: }
1423 println("Unknown architecture: ${architecture}");
1429 def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR, def architecture, def configuration, def os, def enableCorefxTesting, def isBuildOnly) {
1430 def buildCommands = [];
1431 def osGroup = getOSGroup(os)
1432 def lowerConfiguration = configuration.toLowerCase()
1434 // Calculate the build steps, archival, and xunit results
1436 case 'Windows_NT': // editor brace matching: {
1437 switch (architecture) {
1441 def arch = architecture
1443 if (architecture == 'x86lb') {
1447 if (scenario == 'illink') {
1448 buildCommands += "tests\\scripts\\build_illink.cmd clone ${arch}"
1451 // If it is a release build for windows, ensure PGO is used, else fail the build
1452 if ((lowerConfiguration == 'release') && (scenario in Constants.basicScenarios) && (architecture != 'x86lb')) {
1453 buildOpts += ' enforcepgo'
1456 if (Constants.jitStressModeScenarios.containsKey(scenario) ||
1457 scenario == 'default' ||
1458 scenario == 'r2r' ||
1459 scenario == 'jitdiff' ||
1460 scenario == 'ilrt' ||
1461 scenario == 'illink' ||
1462 Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
1463 buildOpts += enableCorefxTesting ? ' skiptests' : ''
1464 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${arch} ${buildOpts}"
1467 // For Pri 1 tests, we must shorten the output test binary path names.
1468 // if __TestIntermediateDir is already set, build-test.cmd will
1469 // output test binaries to that directory. If it is not set, the
1470 // binaries are sent to a default directory whose name is about
1471 // 35 characters long.
1473 else if (scenarioNeedsPri1Build(scenario)) {
1474 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${arch} ${buildOpts} -priority=1"
1476 else if (isLongGc(scenario)) {
1477 buildCommands += "build.cmd ${lowerConfiguration} ${arch} ${buildOpts} skiptests"
1478 buildCommands += "set __TestIntermediateDir=int&&build-test.cmd ${lowerConfiguration} ${arch}"
1480 else if (scenario == 'standalone_gc') {
1481 buildCommands += "build.cmd ${lowerConfiguration} ${arch} ${buildOpts} buildstandalonegc"
1483 else if (scenario == 'formatting') {
1484 buildCommands += "python -u tests\\scripts\\format.py -c %WORKSPACE% -o Windows_NT -a ${arch}"
1485 Utilities.addArchival(newJob, "format.patch", "", true, false)
1489 println("Unknown scenario: ${scenario}")
1493 // If we are running a stress mode, we should write out the set of key
1494 // value env pairs to a file at this point and then we'll pass that to runtest.cmd
1497 //If this is a crossgen build, pass 'crossgen' to runtest.cmd
1498 def crossgenStr = ''
1499 def runcrossgentestsStr = ''
1500 def runjitstressStr = ''
1501 def runjitstressregsStr = ''
1502 def runjitmioptsStr = ''
1503 def runjitforcerelocsStr = ''
1504 def runjitdisasmStr = ''
1505 def runilasmroundtripStr = ''
1506 def gcstressStr = ''
1507 def runtestArguments = ''
1508 def gcTestArguments = ''
1509 def illinkArguments = ''
1511 if (scenario == 'r2r' ||
1512 scenario == 'pri1r2r' ||
1513 scenario == 'gcstress15_pri1r2r' ||
1514 Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
1515 crossgenStr = 'crossgen'
1516 runcrossgentestsStr = 'runcrossgentests'
1518 if (scenario == 'r2r_jitstress1'){
1519 runjitstressStr = 'jitstress 1'
1521 else if (scenario == 'r2r_jitstress2') {
1522 runjitstressStr = 'jitstress 2'
1524 else if (scenario == 'r2r_jitstressregs1'){
1525 runjitstressregsStr = 'jitstressregs 1'
1527 else if (scenario == 'r2r_jitstressregs2') {
1528 runjitstressregsStr = 'jitstressregs 2'
1530 else if (scenario == 'r2r_jitstressregs3') {
1531 runjitstressregsStr = 'jitstressregs 3'
1533 else if (scenario == 'r2r_jitstressregs4') {
1534 runjitstressregsStr = 'jitstressregs 4'
1536 else if (scenario == 'r2r_jitstressregs8') {
1537 runjitstressregsStr = 'jitstressregs 8'
1539 else if (scenario == 'r2r_jitstressregs0x10') {
1540 runjitstressregsStr = 'jitstressregs 0x10'
1542 else if (scenario == 'r2r_jitstressregs0x80') {
1543 runjitstressregsStr = 'jitstressregs 0x80'
1545 else if (scenario == 'r2r_jitstressregs0x1000') {
1546 runjitstressregsStr = 'jitstressregs 0x1000'
1548 else if (scenario == 'r2r_jitminopts') {
1549 runjitmioptsStr = 'jitminopts'
1551 else if (scenario == 'r2r_jitforcerelocs') {
1552 runjitforcerelocsStr = 'jitforcerelocs'
1555 if (scenario == 'gcstress15_pri1r2r')
1557 gcstressStr = 'gcstresslevel 0xF'
1560 if (scenario == 'jitdiff')
1562 runjitdisasmStr = 'jitdisasm crossgen'
1565 if (scenario == 'ilrt')
1567 runilasmroundtripStr = 'ilasmroundtrip'
1570 if (isLongGc(scenario)) {
1571 gcTestArguments = "${scenario} sequential"
1574 if (scenario == 'illink')
1576 illinkArguments = "link %WORKSPACE%\\linker\\linker\\bin\\netcore_Release\\netcoreapp2.0\\win10-${arch}\\publish\\illink.exe"
1579 runtestArguments = "${lowerConfiguration} ${arch} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${runjitdisasmStr} ${runilasmroundtripStr} ${gcTestArguments} ${illinkArguments} collectdumps"
1581 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
1582 def stepScriptLocation = "%WORKSPACE%\\SetStressModes.bat"
1583 buildCommands += genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], stepScriptLocation)
1585 if (enableCorefxTesting) {
1586 def workspaceRelativeFxRoot = "_/fx"
1587 def absoluteFxRoot = "%WORKSPACE%\\_\\fx"
1589 buildCommands += "python -u %WORKSPACE%\\tests\\scripts\\run-corefx-tests.py -arch ${arch} -build_type ${configuration} -fx_root ${absoluteFxRoot} -fx_branch ${branch} -env_script ${stepScriptLocation}"
1591 setTestJobTimeOut(newJob, scenario)
1593 // Archive and process (only) the test results
1594 Utilities.addArchival(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1595 Utilities.addXUnitDotNETResults(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1597 //Archive additional build stuff to diagnose why my attempt at fault injection isn't causing CI to fail
1598 Utilities.addArchival(newJob, "SetStressModes.bat", "", true, false)
1599 Utilities.addArchival(newJob, "${workspaceRelativeFxRoot}/bin/testhost/**", "", true, false)
1602 buildCommands += "%WORKSPACE%\\tests\\runtest.cmd ${runtestArguments} TestEnv ${stepScriptLocation}"
1605 else if (isGcReliabilityFramework(scenario)) {
1606 buildCommands += "tests\\runtest.cmd ${runtestArguments} GenerateLayoutOnly"
1607 buildCommands += "tests\\scripts\\run-gc-reliability-framework.cmd ${arch} ${configuration}"
1609 else if (architecture == 'x64' || architecture == 'x86') {
1610 buildCommands += "tests\\runtest.cmd ${runtestArguments}"
1612 else if (architecture == 'x86lb') {
1613 buildCommands += "tests\\runtest.cmd ${runtestArguments} TestEnv %WORKSPACE%\\tests\\legacyjit_x86_testenv.cmd"
1617 if (!enableCorefxTesting) {
1618 // Run the rest of the build
1619 // Build the mscorlib for the other OS's
1620 buildCommands += "build.cmd ${lowerConfiguration} ${arch} linuxmscorlib"
1621 buildCommands += "build.cmd ${lowerConfiguration} ${arch} osxmscorlib"
1623 if (arch == "x64") {
1624 buildCommands += "build.cmd ${lowerConfiguration} arm64 linuxmscorlib"
1627 // Zip up the tests directory so that we don't use so much space/time copying
1628 // 10s of thousands of files around.
1629 buildCommands += "powershell -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${arch}.${configuration}', '.\\bin\\tests\\tests.zip')\"";
1631 if (!Constants.jitStressModeScenarios.containsKey(scenario)) {
1632 // For windows, pull full test results and test drops for x86/x64.
1633 // No need to pull for stress mode scenarios (downstream builds use the default scenario)
1634 Utilities.addArchival(newJob, "bin/Product/**,bin/tests/tests.zip", "bin/Product/**/.nuget/**")
1637 if (scenario == 'jitdiff') {
1638 // retrive jit-dasm output for base commit, and run jit-diff
1640 // if this is a build only job, we want to keep the default (build) artifacts for the flow job
1641 Utilities.addArchival(newJob, "bin/tests/${osGroup}.${arch}.${configuration}/dasm/**")
1646 Utilities.addXUnitDotNETResults(newJob, 'bin/**/TestRun*.xml', true)
1647 setTestJobTimeOut(newJob, scenario)
1652 def validArmWindowsScenarios = [ "default",
1656 "tieredcompilation",
1664 "gcstress0xc_jitstress1",
1665 "gcstress0xc_jitstress2"]
1667 assert validArmWindowsScenarios.contains(scenario)
1670 setTestJobTimeOut(newJob, scenario)
1672 if ( lowerConfiguration == "debug" ) {
1673 // For Debug builds, we will do a P1 test build
1674 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} -priority=1"
1676 else if (lowerConfiguration == "checked") {
1678 if ((scenario != 'gcstress0x3') && (scenario != 'gcstress0xc'))
1680 // Up the timeout for arm checked testing only.
1681 // Keep the longer timeout for gcstress.
1682 Utilities.setJobTimeout(newJob, 240)
1685 def machineAffinityOptions = ['use_arm64_build_machine' : true]
1686 setMachineAffinity(newJob, os, architecture, machineAffinityOptions)
1687 // For checked runs we will also run testing.
1688 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} -priority=1"
1689 buildCommands += "python tests\\scripts\\arm64_post_build.py -repo_root %WORKSPACE% -arch ${architecture} -build_type ${lowerConfiguration} -scenario ${scenario} -key_location C:\\tools\\key.txt"
1691 else if (lowerConfiguration == "release") {
1692 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture}"
1695 Utilities.addArchival(newJob, "bin/Product/**", "bin/Product/**/.nuget/**")
1698 assert (scenario == 'default') || (scenario == 'pri1r2r') || (scenario == 'gcstress0x3') || (scenario == 'gcstress0xc')
1701 setTestJobTimeOut(newJob, scenario)
1703 // Debug runs take too long to run. So build job only.
1704 if (lowerConfiguration == "debug") {
1705 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} toolset_dir C:\\ats2"
1708 if ((scenario != 'gcstress0x3') && (scenario != 'gcstress0xc'))
1710 // Up the timeout for arm64 checked testing only.
1711 // Keep the longer timeout for gcstress.
1712 Utilities.setJobTimeout(newJob, 240)
1715 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} toolset_dir C:\\ats2 -priority=1"
1716 // Test build and run are launched together.
1717 buildCommands += "python tests\\scripts\\arm64_post_build.py -repo_root %WORKSPACE% -arch ${architecture} -build_type ${lowerConfiguration} -scenario ${scenario} -key_location C:\\tools\\key.txt"
1718 //Utilities.addXUnitDotNETResults(newJob, 'bin/tests/testResults.xml')
1722 Utilities.addArchival(newJob, "bin/Product/**", "bin/Product/**/.nuget/**")
1725 println("Unknown architecture: ${architecture}");
1730 // editor brace matching: }
1739 case 'Fedora24': // editor brace matching: {
1740 switch (architecture) {
1743 if (architecture == 'x86' && os == 'Ubuntu') {
1744 // build and PAL test
1745 buildCommands += "./tests/scripts/x86_ci_script.sh --buildConfig=${lowerConfiguration}"
1746 Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
1750 if (scenario == 'formatting') {
1751 buildCommands += "python tests/scripts/format.py -c \${WORKSPACE} -o Linux -a ${architecture}"
1752 Utilities.addArchival(newJob, "format.patch", "", true, false)
1756 if (scenario == 'illink') {
1757 assert(os == 'Ubuntu')
1758 buildCommands += "./tests/scripts/build_illink.sh --clone --arch=${architecture}"
1761 def standaloneGc = ''
1762 if (scenario == 'standalone_gc') {
1763 standaloneGc = 'buildstandalonegc'
1766 if (!enableCorefxTesting) {
1767 // We run pal tests on all OS but generate mscorlib (and thus, nuget packages)
1768 // only on supported OS platforms.
1769 def bootstrapRid = Utilities.getBoostrapPublishRid(os)
1770 def bootstrapRidEnv = bootstrapRid != null ? "__PUBLISH_RID=${bootstrapRid} " : ''
1771 buildCommands += "${bootstrapRidEnv}./build.sh verbose ${lowerConfiguration} ${architecture} ${standaloneGc}"
1772 buildCommands += "src/pal/tests/palsuite/runpaltests.sh \${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration} \${WORKSPACE}/bin/paltestout"
1775 setTestJobTimeOut(newJob, scenario)
1776 // Basic archiving of the build
1777 Utilities.addArchival(newJob, "bin/Product/**,bin/obj/*/tests/**/*.dylib,bin/obj/*/tests/**/*.so", "bin/Product/**/.nuget/**")
1779 Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
1782 // Corefx stress testing
1783 assert os == 'Ubuntu'
1784 assert architecture == 'x64'
1785 assert lowerConfiguration == 'checked'
1786 assert Constants.jitStressModeScenarios.containsKey(scenario)
1789 buildCommands += "./build.sh verbose ${lowerConfiguration} ${architecture}"
1791 def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
1792 buildCommands += genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], scriptFileName)
1794 // Build and text corefx
1795 def workspaceRelativeFxRoot = "_/fx"
1796 def absoluteFxRoot = "\$WORKSPACE/${workspaceRelativeFxRoot}"
1798 buildCommands += "python -u \$WORKSPACE/tests/scripts/run-corefx-tests.py -arch ${architecture} -build_type ${configuration} -fx_root ${absoluteFxRoot} -fx_branch ${branch} -env_script ${scriptFileName}"
1800 setTestJobTimeOut(newJob, scenario)
1802 // Archive and process (only) the test results
1803 Utilities.addArchival(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1804 Utilities.addXUnitDotNETResults(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
1808 def standaloneGc = ''
1809 if (scenario == 'standalone_gc') {
1810 standaloneGc = 'buildstandalonegc'
1813 if (!enableCorefxTesting) {
1814 buildCommands += "ROOTFS_DIR=/opt/arm64-xenial-rootfs ./build.sh verbose ${lowerConfiguration} ${architecture} cross clang3.8 ${standaloneGc}"
1816 // HACK -- Arm64 does not have corefx jobs yet.
1817 buildCommands += "git clone https://github.com/dotnet/corefx fx"
1818 buildCommands += "ROOTFS_DIR=/opt/arm64-xenial-rootfs-corefx ./fx/build-native.sh -release -buildArch=arm64 -- verbose cross clang3.8"
1819 buildCommands += "mkdir ./bin/Product/Linux.arm64.${configuration}/corefxNative"
1820 buildCommands += "cp fx/bin/Linux.arm64.Release/native/* ./bin/Product/Linux.arm64.${configuration}/corefxNative"
1823 setTestJobTimeOut(newJob, scenario)
1824 // Basic archiving of the build
1825 Utilities.addArchival(newJob, "bin/Product/**,bin/obj/*/tests/**/*.dylib,bin/obj/*/tests/**/*.so", "bin/Product/**/.nuget/**")
1829 // Cross builds for ARM runs on Ubuntu, Ubuntu16.04 and Tizen currently
1830 assert (os == 'Ubuntu') || (os == 'Ubuntu16.04') || (os == 'Tizen')
1832 // default values for Ubuntu
1834 def linuxCodeName="trusty"
1835 if (os == 'Ubuntu16.04') {
1836 linuxCodeName="xenial"
1838 else if (os == 'Tizen') {
1840 linuxCodeName="tizen"
1843 // Unzip the Windows test binaries first. Exit with 0
1844 buildCommands += "unzip -q -o ./bin/tests/tests.zip -d ./bin/tests/Windows_NT.x64.${configuration} || exit 0"
1846 // Unpack the corefx binaries
1847 buildCommands += "mkdir ./bin/CoreFxBinDir"
1848 buildCommands += "tar -xf ./bin/build.tar.gz -C ./bin/CoreFxBinDir"
1849 if (os != 'Tizen') {
1850 buildCommands += "chmod a+x ./bin/CoreFxBinDir/corerun"
1852 // Test environment emulation using docker and qemu has some problem to use lttng library.
1853 // We should remove libcoreclrtraceptprovider.so to avoid test hang.
1854 if (os == 'Ubuntu') {
1855 buildCommands += "rm -f -v ./bin/CoreFxBinDir/libcoreclrtraceptprovider.so"
1858 // Call the ARM CI script to cross build and test using docker
1859 buildCommands += """./tests/scripts/arm32_ci_script.sh \\
1862 --linuxCodeName=${linuxCodeName} \\
1863 --buildConfig=${lowerConfiguration} \\
1864 --testRootDir=./bin/tests/Windows_NT.x64.${configuration} \\
1865 --coreFxBinDir=./bin/CoreFxBinDir \\
1866 --testDirFile=./tests/testsRunningInsideARM.txt"""
1868 // Basic archiving of the build, no pal tests
1869 Utilities.addArchival(newJob, "bin/Product/**", "bin/Product/**/.nuget/**")
1872 println("Unknown architecture: ${architecture}");
1877 // editor brace matching: }
1879 println("Unknown os: ${os}");
1884 return buildCommands
1887 // Additional scenario which can alter behavior
1889 def combinedScenarios = Constants.basicScenarios + Constants.jitStressModeScenarios.keySet()
1890 combinedScenarios.each { scenario ->
1891 [true, false].each { isPR ->
1892 Constants.architectureList.each { architecture ->
1893 Constants.configurationList.each { configuration ->
1894 Constants.osList.each { os ->
1895 // If the OS is Windows_NT_BuildOnly, set the isBuildOnly flag to true
1896 // and reset the os to Windows_NT
1897 def isBuildOnly = false
1898 if (os == 'Windows_NT_BuildOnly') {
1903 // Tizen is only supported for arm architecture
1904 if (os == 'Tizen' && architecture != 'arm') {
1908 // Skip totally unimplemented (in CI) configurations.
1909 switch (architecture) {
1911 if (os == 'Ubuntu16.04') {
1915 // Windows and Ubuntu only
1916 if ((os != 'Windows_NT' && os != 'Ubuntu') || isBuildOnly) {
1921 if ((os != 'Ubuntu') && (os != 'Ubuntu16.04') && (os != 'Tizen') && (os != 'Windows_NT')) {
1926 if ((os != 'Ubuntu') && (os != 'Windows_NT')) {
1931 if (os != 'Windows_NT') {
1936 // Everything implemented
1939 println("Unknown architecture: ${architecture}")
1944 // Skip scenarios (blanket skipping for jit stress modes, which are good most everywhere
1945 // with checked builds
1946 def enableCorefxTesting = false
1947 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
1948 if (configuration != 'Checked') {
1952 enableCorefxTesting = isCorefxTesting(scenario)
1954 // Since these are just execution time differences,
1955 // skip platforms that don't execute the tests here (Windows_NT only)
1956 def isEnabledOS = (os == 'Windows_NT') || (os == 'Ubuntu' && enableCorefxTesting)
1957 if (!isEnabledOS || isBuildOnly) {
1961 switch (architecture) {
1963 if ((scenario != 'gcstress0x3') &&
1964 (scenario != 'gcstress0xc') &&
1965 (scenario != 'jitstress1') &&
1966 (scenario != 'jitstress2') &&
1967 (scenario != 'jitstressregs1') &&
1968 (scenario != 'jitstressregs2') &&
1969 (scenario != 'gcstress0xc_jitstress1') &&
1970 (scenario != 'gcstress0xc_jitstress2') &&
1971 (scenario != 'minopts') &&
1972 (scenario != 'tieredcompilation') &&
1973 (scenario != 'tailcallstress') &&
1974 (scenario != 'zapdisable')) {
1979 if ((scenario != 'gcstress0x3') && (scenario != 'gcstress0xc')) {
1985 // x86 ubuntu: default only
1986 if ((os == 'Ubuntu') && (architecture == 'x86')) {
1989 // Windows: Everything implemented
1992 // No stress modes for legacy jit.
1993 // (There's no technical reason we couldn't allow these.)
2000 // If this is a r2r jitstress, jitstressregs, jitminopts, or forcerelocs scenario
2001 // and configuration is not Checked, bail out.
2002 if (configuration != 'Checked' && Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
2009 // The pri1 build isn't necessary except for Windows_NT. Non-Windows NT uses
2010 // the default scenario build
2011 if (os != 'Windows_NT') {
2015 if (architecture != 'x64') {
2020 // The ilrt build isn't necessary except for Windows_NT2003. Non-Windows NT uses
2021 // the default scenario build
2022 if (os != 'Windows_NT') {
2026 if (architecture != 'x64') {
2030 if (configuration != 'Release') {
2035 if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
2038 if (architecture != 'x64') {
2041 if (configuration != 'Checked') {
2046 // The r2r build isn't necessary except for Windows_NT. Non-Windows NT uses
2047 // the default scenario build
2048 if (os != 'Windows_NT') {
2051 if (architecture != 'x64') {
2056 // The pri1r2r build isn't necessary except for Windows_NT. Non-Windows NT uses
2057 // the default scenario build
2058 if (os != 'Windows_NT') {
2061 if (architecture != 'x64') {
2062 if ((architecture != 'arm64' && architecture != 'arm') || (configuration == 'Debug')) {
2067 case 'gcstress15_pri1r2r':
2068 case 'r2r_jitstress1':
2069 case 'r2r_jitstress2':
2070 case 'r2r_jitstressregs1':
2071 case 'r2r_jitstressregs2':
2072 case 'r2r_jitstressregs3':
2073 case 'r2r_jitstressregs4':
2074 case 'r2r_jitstressregs8':
2075 case 'r2r_jitstressregs0x10':
2076 case 'r2r_jitstressregs0x80':
2077 case 'r2r_jitstressregs0x1000':
2078 case 'r2r_jitminopts':
2079 case 'r2r_jitforcerelocs':
2080 // The above builds are not necessary except for Windows_NT. Non-Windows NT uses
2081 // the default scenario build
2082 if (os != 'Windows_NT') {
2085 if (architecture != 'x64' && architecture != 'x86') {
2091 if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
2094 if (architecture != 'x64') {
2097 if (configuration != 'Release') {
2101 case 'gc_reliability_framework':
2102 case 'standalone_gc':
2103 if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX10.12') {
2107 if (architecture != 'x64') {
2111 if (configuration != 'Release' && configuration != 'Checked') {
2115 // We need Windows x64 Release bits for the code coverage build
2117 if (os != 'Windows_NT') {
2120 if (architecture != 'x64') {
2123 if (configuration != 'Release') {
2127 // We only run Windows and Ubuntu x64 Checked for formatting right now
2129 if (os != 'Windows_NT' && os != 'Ubuntu') {
2132 if (architecture != 'x64') {
2135 if (configuration != 'Checked') {
2143 if (os != 'Windows_NT' && (os != 'Ubuntu' || architecture != 'x64')) {
2146 if (architecture != 'x64' && architecture != 'x86') {
2157 println("Unknown scenario: ${scenario}")
2164 def lowerConfiguration = configuration.toLowerCase()
2165 def jobName = getJobName(configuration, architecture, os, scenario, isBuildOnly)
2166 def folderName = getJobFolder(scenario)
2168 // Create the new job
2169 def newJob = job(Utilities.getFullJobName(project, jobName, isPR, folderName)) {}
2171 def machineAffinityOptions = architecture == 'arm64' ? ['is_build_only': true] : null
2172 machineAffinityOptions = architecture == 'arm' ? ['use_arm64_build_machine': false] : machineAffinityOptions
2173 setMachineAffinity(newJob, os, architecture, machineAffinityOptions)
2175 // Add all the standard options
2176 Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
2177 addTriggers(newJob, branch, isPR, architecture, os, configuration, scenario, false, isBuildOnly)
2179 def buildCommands = calculateBuildCommands(newJob, scenario, branch, isPR, architecture, configuration, os, enableCorefxTesting, isBuildOnly)
2180 def osGroup = getOSGroup(os)
2184 if (os == 'Windows_NT') {
2185 buildCommands.each { buildCommand ->
2186 batchFile(buildCommand)
2190 // Setup corefx and Windows test binaries for Linux cross build for ubuntu-arm, ubuntu16.04-arm and tizen-armel
2191 if ( architecture == 'arm' && ( os == 'Ubuntu' || os == 'Ubuntu16.04' || os == 'Tizen')) {
2192 // Cross build for ubuntu-arm, ubuntu16.04-arm and tizen-armel
2193 // Define the Windows Tests and Corefx build job names
2194 def WindowTestsName = projectFolder + '/' +
2195 Utilities.getFullJobName(project,
2196 getJobName(lowerConfiguration,
2202 def corefxFolder = Utilities.getFolderName('dotnet/corefx') + '/' +
2203 Utilities.getFolderName(branch)
2205 // Copy the Windows test binaries and the Corefx build binaries
2206 copyArtifacts(WindowTestsName) {
2207 includePatterns('bin/tests/tests.zip')
2209 latestSuccessful(true)
2214 def corefx_os = 'linux'
2215 if (os == 'Tizen') {
2220 // Let's use release CoreFX to test checked CoreCLR,
2221 // because we do not generate checked CoreFX in CoreFX CI yet.
2222 def corefx_lowerConfiguration = lowerConfiguration
2223 if ( lowerConfiguration == 'checked' ) {
2224 corefx_lowerConfiguration='release'
2227 copyArtifacts("${corefxFolder}/${corefx_os}_${arm_abi}_cross_${corefx_lowerConfiguration}") {
2228 includePatterns('bin/build.tar.gz')
2230 latestSuccessful(true)
2235 buildCommands.each { buildCommand ->
2249 // Create the Linux/OSX/CentOS coreclr test leg for debug and release and each scenario
2250 combinedScenarios.each { scenario ->
2251 [true, false].each { isPR ->
2252 // Architectures. x64 only at this point
2253 ['x64', 'arm64'].each { architecture ->
2254 // Put the OS's supported for coreclr cross testing here
2255 Constants.crossList.each { os ->
2256 if (architecture == 'arm64') {
2257 if (os != "Ubuntu") {
2262 Constants.configurationList.each { configuration ->
2264 if (architecture == 'arm64') {
2265 if (scenario != 'default' && scenario != 'pri1r2r' && scenario != 'gcstress0x3' && scenario != 'gcstress0xc') {
2270 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
2271 if (configuration != 'Checked') {
2274 if (isCorefxTesting(scenario)) {
2277 //Skip stress modes for these scenarios
2278 if (os == 'RHEL7.2' || os == 'Debian8.4') {
2282 // If this is a r2r jitstress, jitstressregs, jitminopts or forcerelocs scenario
2283 // and configuration is not Checked, bail out.
2284 else if (configuration != 'Checked' && Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
2287 // For CentOS, we only want Checked/Release pri1 builds.
2288 else if (os == 'CentOS7.1') {
2289 if (scenario != 'pri1' &&
2290 scenario != 'r2r' &&
2291 scenario != 'pri1r2r' &&
2292 scenario != 'gcstress15_pri1r2r' &&
2293 Constants.r2rJitStressScenarios.indexOf(scenario) == -1) {
2296 if (configuration != 'Checked' && configuration != 'Release') {
2300 // For RedHat and Debian, we only do Release pri1 builds.
2301 else if (os == 'RHEL7.2' || os == 'Debian8.4') {
2302 if (scenario != 'pri1') {
2305 if (configuration != 'Release') {
2317 if (configuration != 'Release') {
2322 if (configuration != 'Checked') {
2326 //Skip configs that aren't Checked or Release (so just Debug, for now)
2327 if (configuration != 'Checked' && configuration != 'Release') {
2332 //Skip configs that aren't Checked or Release (so just Debug, for now)
2333 if (configuration != 'Checked' && configuration != 'Release') {
2337 case 'gcstress15_pri1r2r':
2338 case 'r2r_jitstress1':
2339 case 'r2r_jitstress2':
2340 case 'r2r_jitstressregs1':
2341 case 'r2r_jitstressregs2':
2342 case 'r2r_jitstressregs3':
2343 case 'r2r_jitstressregs4':
2344 case 'r2r_jitstressregs8':
2345 case 'r2r_jitstressregs0x10':
2346 case 'r2r_jitstressregs0x80':
2347 case 'r2r_jitstressregs0x1000':
2348 case 'r2r_jitminopts':
2349 case 'r2r_jitforcerelocs':
2350 //Skip configs that aren't Checked or Release (so just Debug, for now)
2351 if (configuration != 'Checked' && configuration != 'Release') {
2357 // Long GC tests take a long time on non-Release builds
2358 if (configuration != 'Release') {
2362 case 'gc_reliability_framework':
2363 case 'standalone_gc':
2364 if (configuration != 'Release' && configuration != 'Checked') {
2369 //We only want Ubuntu Release for coverage
2370 if (os != 'Ubuntu') {
2373 if (configuration != 'Release') {
2379 if (os != 'Windows_NT' && os != 'Ubuntu') {
2387 println("Unknown scenario: ${scenario}")
2393 def lowerConfiguration = configuration.toLowerCase()
2394 def osGroup = getOSGroup(os)
2395 def jobName = getJobName(configuration, architecture, os, scenario, false) + "_tst"
2397 // Unless this is a coverage test run, we want to copy over the default build of coreclr.
2398 def inputScenario = 'default'
2399 if (scenario == 'coverage') {
2400 inputScenario = 'coverage'
2402 def inputCoreCLRBuildName = projectFolder + '/' +
2403 Utilities.getFullJobName(project, getJobName(configuration, architecture, os, inputScenario, false), isPR)
2404 // If this is a stress scenario, there isn't any difference in the build job
2405 // so we didn't create a build only job for windows_nt specific to that stress mode. Just copy
2406 // from the default scenario
2407 def testBuildScenario = scenario
2408 if (scenarioNeedsPri1Build(scenario)) {
2409 testBuildScenario = 'pri1'
2411 else if ( testBuildScenario == 'r2r' || Constants.r2rJitStressScenarios.indexOf(testBuildScenario) != -1 || isLongGc(testBuildScenario)) {
2412 testBuildScenario = 'default'
2414 def inputWindowTestsBuildName = ''
2415 def inputWindowsTestBuildArch = architecture
2416 if (architecture == "arm64") {
2417 // Use the x64 test build for arm64 unix
2418 inputWindowsTestBuildArch = "x64"
2420 if (Constants.jitStressModeScenarios.containsKey(testBuildScenario)) {
2421 inputWindowTestsBuildName = projectFolder + '/' +
2422 Utilities.getFullJobName(project, getJobName(configuration, inputWindowsTestBuildArch, 'windows_nt', 'default', true), isPR)
2425 inputWindowTestsBuildName = projectFolder + '/' +
2426 Utilities.getFullJobName(project, getJobName(configuration, inputWindowsTestBuildArch, 'windows_nt', testBuildScenario, true), isPR)
2428 // Enable Server GC for Ubuntu PR builds
2429 def serverGCString = ''
2431 // Whether or not this test run should be run sequentially instead
2432 // of in parallel. Only used for long GC tests.
2433 def sequentialString = ''
2435 // Whether or not this test run should run a specific playlist.
2436 // Only used for long GC tests.
2438 // A note - runtest.sh does have "--long-gc" and "--gcsimulator" options
2439 // for running long GC and GCSimulator tests, respectively. We don't use them
2440 // here because using a playlist file produces much more readable output on the CI machines
2441 // and reduces running time.
2442 def playlistString = ''
2444 if (os == 'Ubuntu' && isPR){
2445 serverGCString = '--useServerGC'
2448 // pass --crossgen to runtest.sh for crossgen builds
2449 def crossgenStr = ''
2450 def runcrossgentestsStr = ''
2451 def runjitstressStr = ''
2452 def runjitstressregsStr = ''
2453 def runjitmioptsStr = ''
2454 def runjitforcerelocsStr = ''
2455 def runjitdisasmStr = ''
2456 def runilasmroundtripStr = ''
2457 def gcstressStr = ''
2459 def layoutOnlyStr =''
2461 if (scenario == 'r2r' ||
2462 scenario == 'pri1r2r' ||
2463 scenario == 'gcstress15_pri1r2r' ||
2464 Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
2465 crossgenStr = '--crossgen'
2466 runcrossgentestsStr = '--runcrossgentests'
2468 if (scenario == 'r2r_jitstress1'){
2469 runjitstressStr = '--jitstress=1'
2471 else if (scenario == 'r2r_jitstress2') {
2472 runjitstressStr = '--jitstress=2'
2474 else if (scenario == 'r2r_jitstressregs1'){
2475 runjitstressregsStr = '--jitstressregs=1'
2477 else if (scenario == 'r2r_jitstressregs2') {
2478 runjitstressregsStr = '--jitstressregs=2'
2480 else if (scenario == 'r2r_jitstressregs3') {
2481 runjitstressregsStr = '--jitstressregs=3'
2483 else if (scenario == 'r2r_jitstressregs4') {
2484 runjitstressregsStr = '--jitstressregs=4'
2486 else if (scenario == 'r2r_jitstressregs8') {
2487 runjitstressregsStr = '--jitstressregs=8'
2489 else if (scenario == 'r2r_jitstressregs0x10') {
2490 runjitstressregsStr = '--jitstressregs=0x10'
2492 else if (scenario == 'r2r_jitstressregs0x80') {
2493 runjitstressregsStr = '--jitstressregs=0x80'
2495 else if (scenario == 'r2r_jitstressregs0x1000') {
2496 runjitstressregsStr = '--jitstressregs=0x1000'
2498 else if (scenario == 'r2r_jitminopts') {
2499 runjitmioptsStr = '--jitminopts'
2501 else if (scenario == 'r2r_jitforcerelocs') {
2502 runjitforcerelocsStr = '--jitforcerelocs'
2505 if (scenario == 'gcstress15_pri1r2r')
2507 gcstressStr = '--gcstresslevel=0xF'
2510 if (scenario == 'jitdiff')
2512 runjitdisasmStr = '--jitdisasm --crossgen'
2515 if (scenario == 'illink')
2517 illinkStr = '--link=\$WORKSPACE/linker/linker/bin/netcore_Release/netcoreapp2.0/ubuntu-x64/publish/illink'
2520 if (isLongGc(scenario)) {
2521 // Long GC tests behave very poorly when they are not
2522 // the only test running (many of them allocate until OOM).
2523 sequentialString = '--sequential'
2525 // The Long GC playlist contains all of the tests that are
2526 // going to be run. The GCSimulator playlist contains all of
2527 // the GC simulator tests.
2528 if (scenario == 'longgc') {
2529 playlistString = '--long-gc --playlist=./tests/longRunningGcTests.txt'
2531 else if (scenario == 'gcsimulator') {
2532 playlistString = '--gcsimulator --playlist=./tests/gcSimulatorTests.txt'
2536 if (isGcReliabilityFramework(scenario)) {
2537 layoutOnlyStr = '--build-overlay-only'
2540 def folder = getJobFolder(scenario)
2541 def newJob = job(Utilities.getFullJobName(project, jobName, isPR, folder)) {
2542 // Add parameters for the inputs
2545 stringParam('CORECLR_WINDOWS_BUILD', '', 'Build number to copy CoreCLR windows test binaries from')
2546 stringParam('CORECLR_BUILD', '', "Build number to copy CoreCLR ${osGroup} binaries from")
2550 // Set up the copies
2552 // Coreclr build containing the tests and mscorlib
2554 copyArtifacts(inputWindowTestsBuildName) {
2555 excludePatterns('**/testResults.xml', '**/*.ni.dll')
2557 buildNumber('${CORECLR_WINDOWS_BUILD}')
2561 if (scenario == 'coverage') {
2563 // Move coreclr to clr directory
2564 shell("rm -rf .clr; mkdir .clr; mv * .clr; mv .git .clr; mv .clr clr")
2567 shell("./clr/build.sh coverage verbose ${lowerConfiguration} ${architecture}")
2569 // Remove folders from obj that we don't expect to be covered. May update this later.
2570 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/ToolBox")
2571 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/debug")
2572 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/ilasm")
2573 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/ildasm")
2574 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/dlls/dbgshim")
2575 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/dlls/mscordac")
2576 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/dlls/mscordbi")
2579 shell("./clr/src/pal/tests/palsuite/runpaltests.sh \$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration} \$(pwd)/clr/bin/paltestout")
2581 // Remove obj files for PAL tests so they're not included in coverage results
2582 shell("rm -rf ./clr/bin/obj/Linux.x64.Release/src/pal/tests")
2584 // Unzip the tests first. Exit with 0
2585 shell("unzip -q -o ./clr/bin/tests/tests.zip -d ./clr/bin/tests/Windows_NT.${architecture}.${configuration} || exit 0")
2588 shell("git clone https://github.com/dotnet/corefx fx")
2590 // Build Linux corefx
2591 shell("./fx/build-native.sh -release -buildArch=x64 -os=Linux")
2592 shell("./fx/build-managed.sh -release -buildArch=x64 -osgroup=Linux -skiptests")
2595 def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
2596 def createScriptCmds = genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios['heapverify1'], scriptFileName)
2597 shell("${createScriptCmds}")
2598 testEnvOpt = "--test-env=" + scriptFileName
2601 shell("""./fx/run-test.sh \\
2602 --coreclr-bins \$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration} \\
2603 --mscorlib-bins \$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration} \\
2604 --corefx-tests \$(pwd)/fx/bin/tests/${osGroup}.AnyCPU.${configuration} \\
2605 --corefx-native-bins \$(pwd)/fx/bin/${osGroup}.${architecture}.${configuration} \\
2606 --configurationGroup Release""")
2609 // Run coreclr tests w/ workstation GC
2610 shell("""./clr/tests/runtest.sh \\
2611 --testRootDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2612 --testNativeBinDir=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2613 --coreClrBinDir=\"\$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2614 --mscorlibDir=\"\$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2615 --coreFxBinDir=\"\$(pwd)/fx/bin/runtime/netcoreapp-${osGroup}-Release-${architecture}\" \\
2616 --crossgen --runcrossgentests""")
2618 // Run coreclr tests w/ server GC & HeapVerify enabled
2619 shell("""./clr/tests/runtest.sh \\
2620 --testRootDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2621 --testNativeBinDir=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2622 --coreOverlayDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}/Tests/coreoverlay\" \\
2623 --useServerGC ${testEnvOpt}""")
2625 // Run long-running coreclr GC tests & produce coverage reports
2626 shell("""./clr/tests/runtest.sh \\
2627 --testRootDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2628 --testNativeBinDir=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2629 --coreOverlayDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}/Tests/coreoverlay\" \\
2630 --long-gc --playlist=\"\$(pwd)/clr/tests/longRunningGcTests.txt\" --coreclr-coverage\\
2631 --coreclr-objs=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}\" \\
2632 --coreclr-src=\"\$(pwd)/clr/src\" \\
2633 --coverage-output-dir=\"\${WORKSPACE}/coverage\" """)
2638 // Coreclr build we are trying to test
2640 copyArtifacts(inputCoreCLRBuildName) {
2641 excludePatterns('**/testResults.xml', '**/*.ni.dll')
2643 buildNumber('${CORECLR_BUILD}')
2647 def corefxFolder = Utilities.getFolderName('dotnet/corefx') + '/' + Utilities.getFolderName(branch)
2649 // Corefx components. We now have full stack builds on all distros we test here, so we can copy straight from CoreFX jobs.
2651 if (os == 'Ubuntu') {
2652 osJobName = 'ubuntu14.04'
2655 osJobName = os.toLowerCase()
2657 copyArtifacts("${corefxFolder}/${osJobName}_release") {
2658 includePatterns('bin/build.tar.gz')
2660 latestSuccessful(true)
2664 shell ("mkdir ./bin/CoreFxBinDir")
2665 // Unpack the corefx binaries
2666 shell("tar -xf ./bin/build.tar.gz -C ./bin/CoreFxBinDir")
2668 // HACK -- Arm64 does not have corefx jobs yet.
2669 // Clone corefx and build the native packages overwriting the x64 packages.
2670 if (architecture == 'arm64') {
2671 shell("cp ./bin/Product/Linux.arm64.${configuration}/corefxNative/* ./bin/CoreFxBinDir")
2672 shell("chmod +x ./bin/Product/Linux.arm64.${configuration}/corerun")
2675 // Unzip the tests first. Exit with 0
2676 shell("unzip -q -o ./bin/tests/tests.zip -d ./bin/tests/Windows_NT.${architecture}.${configuration} || exit 0")
2678 // Execute the tests
2679 // If we are running a stress mode, we'll set those variables first
2681 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
2682 def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
2683 def createScriptCmds = genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], scriptFileName)
2684 shell("${createScriptCmds}")
2685 testEnvOpt = "--test-env=" + scriptFileName
2688 if (isGCStressRelatedTesting(scenario)) {
2689 shell('./init-tools.sh')
2692 shell("""./tests/runtest.sh \\
2693 --testRootDir=\"\${WORKSPACE}/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2694 --testNativeBinDir=\"\${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2695 --coreClrBinDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2696 --mscorlibDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2697 --coreFxBinDir=\"\${WORKSPACE}/bin/CoreFxBinDir\" \\
2698 --limitedDumpGeneration \\
2699 ${testEnvOpt} ${serverGCString} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} \\
2700 ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${runjitdisasmStr} ${runilasmroundtripStr} \\
2701 ${illinkStr} ${sequentialString} ${playlistString} ${layoutOnlyStr}""")
2703 if (isGcReliabilityFramework(scenario)) {
2704 // runtest.sh doesn't actually execute the reliability framework - do it here.
2705 if (serverGCString != '') {
2706 shell("export COMPlus_gcServer=1")
2709 shell("./tests/scripts/run-gc-reliability-framework.sh ${architecture} ${configuration}")
2715 if (scenario == 'coverage') {
2716 // Publish coverage reports
2717 Utilities.addHtmlPublisher(newJob, '${WORKSPACE}/coverage/Coverage/reports', 'Code Coverage Report', 'coreclr.html')
2718 // TODO: Add once external email sending is available again
2719 // addEmailPublisher(newJob, 'clrcoverage@microsoft.com')
2722 if (scenario == 'jitdiff') {
2723 Utilities.addArchival(newJob, "bin/tests/${osGroup}.${architecture}.${configuration}/dasm/**")
2726 // Experimental: If on Ubuntu 14.04, then attempt to pull in crash dump links
2727 if (os in ['Ubuntu']) {
2728 SummaryBuilder summaries = new SummaryBuilder()
2729 summaries.addLinksSummaryFromFile('Crash dumps from this run:', 'dumplings.txt')
2730 summaries.emit(newJob)
2733 setMachineAffinity(newJob, os, architecture)
2734 Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
2735 // Set timeouts to 240.
2736 setTestJobTimeOut(newJob, scenario)
2738 if (architecture == 'arm64') {
2739 Utilities.setJobTimeout(newJob, 240)
2742 Utilities.addXUnitDotNETResults(newJob, '**/coreclrtests.xml')
2744 // Create a build flow to join together the build and tests required to run this
2746 // Windows CoreCLR build and Linux CoreCLR build (in parallel) ->
2747 // Linux CoreCLR test
2748 def flowJobName = getJobName(configuration, architecture, os, scenario, false) + "_flow"
2749 def fullTestJobName = projectFolder + '/' + newJob.name
2750 // Add a reference to the input jobs for report purposes
2751 JobReport.Report.addReference(inputCoreCLRBuildName)
2752 JobReport.Report.addReference(inputWindowTestsBuildName)
2753 JobReport.Report.addReference(fullTestJobName)
2756 // If this is a coverage job, we don't copy any input coreCLR build - instead, we build it as part of the flow job,
2757 // so that coverage data can be preserved.
2758 if (scenario == 'coverage') {
2759 newFlowJob = buildFlowJob(Utilities.getFullJobName(project, flowJobName, isPR, folder)) {
2761 // Build the input Windows job
2762 windowsBuildJob = build(params, '${inputWindowTestsBuildName}')
2764 // And then build the test build
2765 build(params + [CORECLR_WINDOWS_BUILD: windowsBuildJob.build.number], '${fullTestJobName}')
2768 // Normal jobs copy a Windows build & a non-Windows build
2770 newFlowJob = buildFlowJob(Utilities.getFullJobName(project, flowJobName, isPR, folder)) {
2772 // Build the input jobs in parallel
2774 { coreclrBuildJob = build(params, '${inputCoreCLRBuildName}') },
2775 { windowsBuildJob = build(params, '${inputWindowTestsBuildName}') }
2778 // And then build the test build
2779 build(params + [CORECLR_BUILD: coreclrBuildJob.build.number,
2780 CORECLR_WINDOWS_BUILD: windowsBuildJob.build.number], '${fullTestJobName}')
2785 setMachineAffinity(newFlowJob, os, architecture)
2786 Utilities.standardJobSetup(newFlowJob, project, isPR, "*/${branch}")
2787 addTriggers(newFlowJob, branch, isPR, architecture, os, configuration, scenario, true, false)
2794 JobReport.Report.generateJobReport(out)
2796 // Make the call to generate the help job
2797 Utilities.createHelperJob(this, project, branch,
2798 "Welcome to the ${project} Repository", // This is prepended to the help message
2799 "Have a nice day!") // This is appended to the help message. You might put known issues here.
2801 Utilities.addCROSSCheck(this, project, branch)