1 // Import the utility functionality.
3 import jobs.generation.Utilities;
4 import jobs.generation.JobReport;
6 // The input project name (e.g. dotnet/coreclr)
7 def project = GithubProject
8 // The input branch name (e.g. master)
9 def branch = GithubBranchName
10 def projectFolder = Utilities.getFolderName(project) + '/' + Utilities.getFolderName(branch)
12 def static getOSGroup(def os) {
13 def osGroupMap = ['Ubuntu':'Linux',
15 'Ubuntu16.04': 'Linux',
19 'Windows_NT':'Windows_NT',
22 'OpenSUSE13.2': 'Linux',
23 'LinuxARMEmulator': 'Linux']
24 def osGroup = osGroupMap.get(os, null)
25 assert osGroup != null : "Could not find os group for ${os}"
29 // We use this class (vs variables) so that the static functions can access data here.
31 // Innerloop build OS's
32 // The Windows_NT_BuildOnly OS is a way to speed up the Non-NT builds temporarily by avoiding
33 // test execution in the build flow runs. It generates the exact same build
34 // as Windows_NT but without the tests.
35 def static osList = ['Ubuntu', 'Debian8.4', 'OSX', 'Windows_NT', 'Windows_NT_BuildOnly', 'FreeBSD', 'CentOS7.1', 'OpenSUSE13.2', 'RHEL7.2', 'LinuxARMEmulator', 'Ubuntu16.04', 'Fedora23']
36 def static crossList = ['Ubuntu', 'OSX', 'CentOS7.1', 'RHEL7.2', 'Debian8.4', 'OpenSUSE13.2']
37 // This is a set of JIT stress modes combined with the set of variables that
38 // need to be set to actually enable that stress mode. The key of the map is the stress mode and
39 // the values are the environment variables
40 def static jitStressModeScenarios = ['minopts' : ['COMPlus_JITMinOpts' : '1'], 'forcerelocs' : ['COMPlus_ForceRelocs' : '1'],
41 'jitstress1' : ['COMPlus_JitStress' : '1'], 'jitstress2' : ['COMPlus_JitStress' : '2'],
42 'jitstressregs1' : ['COMPlus_JitStressRegs' : '1'], 'jitstressregs2' : ['COMPlus_JitStressRegs' : '2'],
43 'jitstressregs3' : ['COMPlus_JitStressRegs' : '3'], 'jitstressregs4' : ['COMPlus_JitStressRegs' : '4'],
44 'jitstressregs8' : ['COMPlus_JitStressRegs' : '8'], 'jitstressregs0x10' : ['COMPlus_JitStressRegs' : '0x10'],
45 'jitstressregs0x80' : ['COMPlus_JitStressRegs' : '0x80'],
46 'jitstress2_jitstressregs1' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '1'],
47 'jitstress2_jitstressregs2' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '2'],
48 'jitstress2_jitstressregs3' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '3'],
49 'jitstress2_jitstressregs4' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '4'],
50 'jitstress2_jitstressregs8' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '8'],
51 'jitstress2_jitstressregs0x10' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '0x10'],
52 'jitstress2_jitstressregs0x80' : ['COMPlus_JitStress' : '2', 'COMPlus_JitStressRegs' : '0x80'],
53 'corefx_baseline' : [ : ], // corefx baseline
54 'corefx_minopts' : ['COMPlus_JITMinOpts' : '1'],
55 'corefx_jitstress1' : ['COMPlus_JitStress' : '1'],
56 'corefx_jitstress2' : ['COMPlus_JitStress' : '2'],
57 'corefx_jitstressregs1' : ['COMPlus_JitStressRegs' : '1'], 'corefx_jitstressregs2' : ['COMPlus_JitStressRegs' : '2'],
58 'corefx_jitstressregs3' : ['COMPlus_JitStressRegs' : '3'], 'corefx_jitstressregs4' : ['COMPlus_JitStressRegs' : '4'],
59 'corefx_jitstressregs8' : ['COMPlus_JitStressRegs' : '8'], 'corefx_jitstressregs0x10' : ['COMPlus_JitStressRegs' : '0x10'],
60 'corefx_jitstressregs0x80' : ['COMPlus_JitStressRegs' : '0x80'],
61 'gcstress0x3' : ['COMPlus_GCStress' : '0x3'], 'gcstress0xc' : ['COMPlus_GCStress' : '0xC'],
62 'zapdisable' : ['COMPlus_ZapDisable' : '0xC'],
63 'heapverify1' : ['COMPlus_HeapVerify' : '1'],
64 'gcstress0xc_zapdisable' : ['COMPlus_GCStress' : '0xC', 'COMPlus_ZapDisable' : '1'],
65 'gcstress0xc_zapdisable_jitstress2' : ['COMPlus_GCStress' : '0xC', 'COMPlus_ZapDisable' : '1', 'COMPlus_JitStress' : '2'],
66 'gcstress0xc_zapdisable_heapverify1' : ['COMPlus_GCStress' : '0xC', 'COMPlus_ZapDisable' : '1', 'COMPlus_HeapVerify' : '1'],
67 'gcstress0xc_jitstress1' : ['COMPlus_GCStress' : '0xC', 'COMPlus_JitStress' : '1'],
68 'gcstress0xc_jitstress2' : ['COMPlus_GCStress' : '0xC', 'COMPlus_JitStress' : '2'],
69 'gcstress0xc_minopts_heapverify1' : ['COMPlus_GCStress' : '0xC', 'COMPlus_JITMinOpts' : '1', 'COMPlus_HeapVerify' : '1']
71 // This is a set of r2r jit stress scenarios
72 def static r2rJitStressScenarios = ['r2r_jitstress1', 'r2r_jitstress2', 'r2r_jitstressregs1', 'r2r_jitstressregs2', 'r2r_jitstressregs3',
73 'r2r_jitstressregs4', 'r2r_jitstressregs8', 'r2r_jitstressregsx10', 'r2r_jitstressregsx80',
74 'r2r_jitminopts', 'r2r_jitforcerelocs']
75 // This is the basic set of scenarios
76 def static basicScenarios = ['default', 'pri1', 'ilrt', 'r2r', 'pri1r2r', 'gcstress15_pri1r2r', 'longgc', 'coverage', 'gcsimulator'] + r2rJitStressScenarios
77 def static configurationList = ['Debug', 'Checked', 'Release']
78 // This is the set of architectures
79 def static architectureList = ['arm', 'arm64', 'x64', 'x86ryujit', 'x86lb']
82 def static setMachineAffinity(def job, def os, def architecture) {
83 if (architecture == 'arm64' && os == 'Windows_NT') {
84 // For cross compilation
88 } else if ((architecture == 'arm' || architecture == 'arm64') && os == 'Ubuntu') {
89 Utilities.setMachineAffinity(job, os, 'arm-cross-latest');
91 Utilities.setMachineAffinity(job, os, 'latest-or-auto');
95 def static isGCStressRelatedTesting(def scenario) {
96 // The 'gcstress15_pri1r2r' scenario is a basic scenario.
97 // Detect it and make it a GCStress related.
98 if (scenario == 'gcstress15_pri1r2r')
103 def gcStressTestEnvVars = [ 'COMPlus_GCStress', 'COMPlus_ZapDisable', 'COMPlus_HeapVerify']
104 def scenarioName = scenario.toLowerCase()
105 def isGCStressTesting = false
106 Constants.jitStressModeScenarios[scenario].each{ k, v ->
107 if (k in gcStressTestEnvVars) {
108 isGCStressTesting = true;
111 return isGCStressTesting
114 def static isCorefxTesting(def scenario) {
115 def corefx_prefix = 'corefx_'
116 if (scenario.length() < corefx_prefix.length()) {
119 return scenario.substring(0,corefx_prefix.length()) == corefx_prefix
122 def static isR2R(def scenario) {
123 return (scenario == 'r2r' || scenario == 'pri1r2r')
126 def static isCoverage(def scenario) {
127 return (scenario == 'coverage')
130 def static isLongGc(def scenario) {
131 return (scenario == 'longgc' || scenario == 'gcsimulator')
134 def static setTestJobTimeOut(newJob, scenario) {
135 if (isGCStressRelatedTesting(scenario)) {
136 Utilities.setJobTimeout(newJob, 4320)
138 else if (isCorefxTesting(scenario)) {
139 Utilities.setJobTimeout(newJob, 360)
141 else if (Constants.jitStressModeScenarios.containsKey(scenario)) {
142 Utilities.setJobTimeout(newJob, 240)
144 else if (isR2R(scenario)) {
145 Utilities.setJobTimeout(newJob, 240)
147 else if (isCoverage(scenario)) {
148 Utilities.setJobTimeout(newJob, 1440)
150 else if (isLongGc(scenario)) {
151 Utilities.setJobTimeout(newJob, 1440)
153 // Non-test jobs use the default timeout value.
156 def static getStressModeDisplayName(def scenario) {
158 Constants.jitStressModeScenarios[scenario].each{ k, v ->
159 def prefixLength = 'COMPlus_'.length()
160 if (k.length() >= prefixLength) {
161 def modeName = k.substring(prefixLength, k.length())
162 displayStr += ' ' + modeName + '=' + v
168 // Generates the string for creating a file that sets environment variables
169 // that makes it possible to run stress modes. Writes the script to a file called
170 // SetStressModes.[sh/cmd]
171 def static genStressModeScriptStep(def os, def stressModeName, def stressModeVars, def stepScriptLocation) {
173 if (os == 'Windows_NT') {
174 stepScript += "echo Creating TestEnv Script for ${stressModeName}\r\n"
175 stepScript += "del ${stepScriptLocation}\r\n"
176 stressModeVars.each{ k, v ->
177 // Write out what we are writing to the script file
178 stepScript += "echo Setting ${k}=${v}\r\n"
179 // Write out the set itself to the script file`
180 stepScript += "echo set ${k}=${v} >> ${stepScriptLocation}\r\n"
184 stepScript += "echo Setting variables for ${stressModeName}\n"
185 stepScript += "echo \\#\\!/usr/bin/env bash > ${stepScriptLocation}\n"
186 stressModeVars.each{ k, v ->
187 // Write out what we are writing to the script file
188 stepScript += "echo Setting ${k}=${v}\n"
189 // Write out the set itself to the script file`
190 stepScript += "echo export ${k}=${v} >> ${stepScriptLocation}\n"
192 stepScript += "chmod +x ${stepScriptLocation}\n"
197 // Corefx doesn't have a support to pass stress mode environment variables. This function
198 // generates commands to set or export environment variables
199 def static getStressModeEnvSetCmd(def os, def stressModeName) {
200 def envVars = Constants.jitStressModeScenarios[stressModeName]
202 if (os == 'Windows_NT') {
203 envVars.each{ VarName, Value ->
205 setEnvVars += "set ${VarName}=${Value}\n"
210 envVars.each{ VarName, Value ->
212 setEnvVars += "export ${VarName}=${Value}\n"
219 // Calculates the name of the build job based on some typical parameters.
221 def static getJobName(def configuration, def architecture, def os, def scenario, def isBuildOnly) {
222 // If the architecture is x64, do not add that info into the build name.
223 // Need to change around some systems and other builds to pick up the right builds
226 def suffix = scenario != 'default' ? "_${scenario}" : '';
231 switch (architecture) {
233 if (scenario == 'default') {
234 // For now we leave x64 off of the name for compatibility with other jobs
235 baseName = configuration.toLowerCase() + '_' + os.toLowerCase()
238 baseName = architecture.toLowerCase() + '_' + configuration.toLowerCase() + '_' + os.toLowerCase()
243 // These are cross builds
244 baseName = architecture.toLowerCase() + '_cross_' + configuration.toLowerCase() + '_' + os.toLowerCase()
247 baseName = 'x86_ryujit_' + configuration.toLowerCase() + '_' + os.toLowerCase()
250 baseName = 'x86_lb_' + configuration.toLowerCase() + '_' + os.toLowerCase()
253 println("Unknown architecture: ${architecture}");
258 return baseName + suffix
261 static void addEmailPublisher(def job, def recipient) {
264 extendedEmail(recipient, '$DEFAULT_SUBJECT', '$DEFAULT_CONTENT') {
265 trigger('Aborted', '$PROJECT_DEFAULT_SUBJECT', '$PROJECT_DEFAULT_CONTENT', null, true, true, true, true)
266 trigger('Failure', '$PROJECT_DEFAULT_SUBJECT', '$PROJECT_DEFAULT_CONTENT', null, true, true, true, true)
272 // **************************
273 // Define the basic inner loop builds for PR and commit. This is basically just the set
274 // of coreclr builds over linux/osx/freebsd/windows and debug/release/checked. In addition, the windows
275 // builds will do a couple extra steps.
276 // **************************
278 // Adds a trigger for the PR build if one is needed. If isFlowJob is true, then this is the
279 // flow job that rolls up the build and test for non-windows OS's. // If the job is a windows build only job,
280 // it's just used for internal builds
281 // If you add a job with a trigger phrase, please add that phrase to coreclr/Documentation/project-docs/ci-trigger-phrases.md
282 def static addTriggers(def job, def branch, def isPR, def architecture, def os, def configuration, def scenario, def isFlowJob, def isWindowsBuildOnlyJob, def isLinuxEmulatorBuild) {
283 if (isWindowsBuildOnlyJob) {
287 def bidailyCrossList = ['RHEL7.2', 'Debian8.4', 'OpenSUSE13.2']
288 // Non pull request builds.
293 switch (architecture) {
297 if (isFlowJob || os == 'Windows_NT' || !(os in Constants.crossList)) {
298 Utilities.addGithubPushTrigger(job)
302 Utilities.addGithubPushTrigger(job)
305 if (os == 'Windows_NT') {
306 Utilities.addGithubPushTrigger(job)
307 addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
311 println("Unknown architecture: ${architecture}");
317 // Pri one gets a push trigger, and only for release
318 if (architecture == 'x64') {
319 if (configuration == 'Release') {
320 // We expect release jobs to be Windows, or in the cross list
321 assert (os == 'Windows_NT') || (os in Constants.crossList)
322 if (!os in bidailyCrossList) {
323 if (isFlowJob || os == 'Windows_NT') {
324 Utilities.addGithubPushTrigger(job)
329 Utilities.addPeriodicTrigger(job, 'H H/12 * * *')
336 //r2r jobs that aren't pri1 can only be triggered by phrase
339 assert !(os in bidailyCrossList)
340 //pri1 r2r gets a push trigger for checked/release
341 if (configuration == 'Checked' || configuration == 'Release') {
342 assert (os == 'Windows_NT') || (os in Constants.crossList)
343 if (architecture == 'x64' && os != 'OSX') {
344 //Flow jobs should be Windows, Ubuntu, OSX, or CentOS
345 if (isFlowJob || os == 'Windows_NT') {
346 Utilities.addGithubPushTrigger(job)
348 // OSX pri1r2r jobs should only run every 12 hours, not daily.
349 } else if (architecture == 'x64' && os == 'OSX'){
351 Utilities.addPeriodicTrigger(job, 'H H/12 * * *')
354 // For x86, only add per-commit jobs for Windows
355 else if (architecture == 'x86ryujit' || architecture == 'x86lb') {
356 if (os == 'Windows_NT') {
357 Utilities.addGithubPushTrigger(job)
360 // arm64 pri1r2r jobs should only run every 12 hours.
361 else if (architecture == 'arm64') {
362 if (os == 'Windows_NT') {
363 Utilities.addPeriodicTrigger(job, 'H H/12 * * *')
364 addEmailPublisher(job, 'dotnetonarm64@microsoft.com')
369 case 'r2r_jitstress1':
370 case 'r2r_jitstress2':
371 case 'r2r_jitstressregs1':
372 case 'r2r_jitstressregs2':
373 case 'r2r_jitstressregs3':
374 case 'r2r_jitstressregs4':
375 case 'r2r_jitstressregs8':
376 case 'r2r_jitstressregsx10':
377 case 'r2r_jitstressregsx80':
378 case 'r2r_jitminopts':
379 case 'r2r_jitforcerelocs':
380 case 'gcstress15_pri1r2r':
381 assert !(os in bidailyCrossList)
382 //GC Stress 15 pri1 r2r gets a push trigger for checked/release
383 if (configuration == 'Checked' || configuration == 'Release') {
384 assert (os == 'Windows_NT') || (os in Constants.crossList)
385 if (architecture == 'x64') {
386 //Flow jobs should be Windows, Ubuntu, OSX, or CentOS
387 if (isFlowJob || os == 'Windows_NT') {
388 // Add a weekly periodic trigger
389 Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
392 // For x86, only add per-commit jobs for Windows
393 else if (architecture == 'x86ryujit' || architecture == 'x86lb') {
394 if (os == 'Windows_NT') {
395 Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
401 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX')
402 assert configuration == 'Release'
403 assert architecture == 'x64'
404 Utilities.addPeriodicTrigger(job, '@daily')
405 addEmailPublisher(job, 'dotnetgctests@microsoft.com')
408 assert (os == 'Ubuntu' || os == 'Windows_NT' || os == 'OSX')
409 assert configuration == 'Release'
410 assert architecture == 'x64'
411 Utilities.addPeriodicTrigger(job, 'H H * * 3,6') // some time every Wednesday and Saturday
412 addEmailPublisher(job, 'dotnetgctests@microsoft.com')
415 assert !(os in bidailyCrossList)
416 // ILASM/ILDASM roundtrip one gets a daily build, and only for release
417 if (architecture == 'x64' && configuration == 'Release') {
418 // We don't expect to see a job generated except in these scenarios
419 assert (os == 'Windows_NT') || (os in Constants.crossList)
420 if (isFlowJob || os == 'Windows_NT') {
421 Utilities.addPeriodicTrigger(job, '@daily')
426 assert (os == 'Ubuntu' || os == 'Windows_NT')
427 assert configuration == 'Release'
428 assert architecture == 'x64'
429 Utilities.addPeriodicTrigger(job, '@weekly')
431 case 'jitstressregs1':
432 case 'jitstressregs2':
433 case 'jitstressregs3':
434 case 'jitstressregs4':
435 case 'jitstressregs8':
436 case 'jitstressregs0x10':
437 case 'jitstressregs0x80':
442 case 'jitstress2_jitstressregs1':
443 case 'jitstress2_jitstressregs2':
444 case 'jitstress2_jitstressregs3':
445 case 'jitstress2_jitstressregs4':
446 case 'jitstress2_jitstressregs8':
447 case 'jitstress2_jitstressregs0x10':
448 case 'jitstress2_jitstressregs0x80':
449 case 'corefx_baseline':
450 case 'corefx_minopts':
451 case 'corefx_jitstress1':
452 case 'corefx_jitstress2':
453 case 'corefx_jitstressregs1':
454 case 'corefx_jitstressregs2':
455 case 'corefx_jitstressregs3':
456 case 'corefx_jitstressregs4':
457 case 'corefx_jitstressregs8':
458 case 'corefx_jitstressregs0x10':
459 case 'corefx_jitstressregs0x80':
461 if (os != 'CentOS7.1' && !(os in bidailyCrossList)) {
462 assert (os == 'Windows_NT') || (os in Constants.crossList)
463 Utilities.addPeriodicTrigger(job, '@daily')
469 case 'gcstress0xc_zapdisable':
470 case 'gcstress0xc_zapdisable_jitstress2':
471 case 'gcstress0xc_zapdisable_heapverify1':
472 case 'gcstress0xc_jitstress1':
473 case 'gcstress0xc_jitstress2':
474 case 'gcstress0xc_minopts_heapverify1':
475 if (os != 'CentOS7.1' && !(os in bidailyCrossList)) {
476 assert (os == 'Windows_NT') || (os in Constants.crossList)
477 Utilities.addPeriodicTrigger(job, '@weekly')
481 println("Unknown scenario: ${scenario}");
487 // Pull request builds. Generally these fall into two categories: default triggers and on-demand triggers
488 // We generally only have a distinct set of default triggers but a bunch of on-demand ones.
489 def osGroup = getOSGroup(os)
490 switch (architecture) {
492 if (scenario == 'coverage') {
493 assert configuration == 'Release'
494 if (os == 'Ubuntu') {
495 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Coverage Build & Test", "(?i).*test\\W+coverage.*")
500 // OpenSUSE, Debian & RedHat get trigger phrases for pri 0 build, and pri 1 build & test
504 if (scenario == 'default') {
506 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", "(?i).*test\\W+${os}.*")
508 else if (scenario == 'pri1' && isFlowJob) {
509 assert (configuration == 'Release')
510 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Pri 1 Build & Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
516 assert scenario == 'default'
517 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build", '(?i).*test\\W+${os}\\W+.*')
521 // Triggers on the non-flow jobs aren't necessary here
522 // Corefx testing uses non-flow jobs.
523 if (!isFlowJob && !isCorefxTesting(scenario)) {
528 // Ubuntu uses checked for default PR tests
529 if (configuration == 'Checked') {
531 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test")
535 if (configuration == 'Release') {
536 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
540 if (configuration == 'Release') {
541 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
545 if (configuration == 'Release' || configuration == 'Checked') {
546 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
550 if (configuration == 'Release' || configuration == 'Checked') {
551 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
554 case 'gcstress15_pri1r2r':
555 if (configuration == 'Release' || configuration == 'Checked') {
556 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
559 case 'r2r_jitstress1':
560 if (configuration == 'Release' || configuration == 'Checked') {
561 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstress1 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
564 case 'r2r_jitstress2':
565 if (configuration == 'Release' || configuration == 'Checked') {
566 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstress2 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
569 case 'r2r_jitstressregs1':
570 if (configuration == 'Release' || configuration == 'Checked') {
571 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregs1 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
574 case 'r2r_jitstressregs2':
575 if (configuration == 'Release' || configuration == 'Checked') {
576 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregs2 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
579 case 'r2r_jitstressregs3':
580 if (configuration == 'Release' || configuration == 'Checked') {
581 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregs3 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
584 case 'r2r_jitstressregs4':
585 if (configuration == 'Release' || configuration == 'Checked') {
586 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregs4 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
589 case 'r2r_jitstressregs8':
590 if (configuration == 'Release' || configuration == 'Checked') {
591 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregs8 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
594 case 'r2r_jitstressregsx10':
595 if (configuration == 'Release' || configuration == 'Checked') {
596 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregsx10 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
599 case 'r2r_jitstressregsx80':
600 if (configuration == 'Release' || configuration == 'Checked') {
601 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregsx80 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
604 case 'r2r_jitminopts':
605 if (configuration == 'Release' || configuration == 'Checked') {
606 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} JITMinOpts R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
609 case 'r2r_jitforcerelocs':
610 if (configuration == 'Release' || configuration == 'Checked') {
611 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ForceRelocs R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
615 if (configuration == 'Release') {
616 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
620 if (configuration == 'Release') {
621 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
625 assert (os == 'Windows_NT') || (os in Constants.crossList)
626 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - MinOpts)",
627 "(?i).*test\\W+${os}\\W+${scenario}.*")
630 assert (os == 'Windows_NT') || (os in Constants.crossList)
631 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStress=1)",
632 "(?i).*test\\W+${os}\\W+${scenario}.*")
635 assert (os == 'Windows_NT') || (os in Constants.crossList)
636 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStress=2)",
637 "(?i).*test\\W+${os}\\W+${scenario}.*")
640 assert (os == 'Windows_NT') || (os in Constants.crossList)
641 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ForceRelocs)",
642 "(?i).*test\\W+${os}\\W+${scenario}.*")
643 case 'jitstressregs1':
644 assert (os == 'Windows_NT') || (os in Constants.crossList)
645 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStressRegs=1)",
646 "(?i).*test\\W+${os}\\W+${scenario}.*")
648 case 'jitstressregs2':
649 assert (os == 'Windows_NT') || (os in Constants.crossList)
650 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStressRegs=2)",
651 "(?i).*test\\W+${os}\\W+${scenario}.*")
653 case 'jitstressregs3':
654 assert (os == 'Windows_NT') || (os in Constants.crossList)
655 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStressRegs=3)",
656 "(?i).*test\\W+${os}\\W+${scenario}.*")
658 case 'jitstressregs4':
659 assert (os == 'Windows_NT') || (os in Constants.crossList)
660 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStressRegs=4)",
661 "(?i).*test\\W+${os}\\W+${scenario}.*")
663 case 'jitstressregs8':
664 assert (os == 'Windows_NT') || (os in Constants.crossList)
665 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStressRegs=8)",
666 "(?i).*test\\W+${os}\\W+${scenario}.*")
668 case 'jitstressregs0x10':
669 assert (os == 'Windows_NT') || (os in Constants.crossList)
670 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStressRegs=0x10)",
671 "(?i).*test\\W+${os}\\W+${scenario}.*")
673 case 'jitstressregs0x80':
674 assert (os == 'Windows_NT') || (os in Constants.crossList)
675 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStressRegs=0x80)",
676 "(?i).*test\\W+${os}\\W+${scenario}.*")
678 case 'jitstress2_jitstressregs1':
679 case 'jitstress2_jitstressregs2':
680 case 'jitstress2_jitstressregs3':
681 case 'jitstress2_jitstressregs4':
682 case 'jitstress2_jitstressregs8':
683 case 'jitstress2_jitstressregs0x10':
684 case 'jitstress2_jitstressregs0x80':
689 case 'gcstress0xc_zapdisable':
690 case 'gcstress0xc_zapdisable_jitstress2':
691 case 'gcstress0xc_zapdisable_heapverify1':
692 case 'gcstress0xc_jitstress1':
693 case 'gcstress0xc_jitstress2':
694 case 'gcstress0xc_minopts_heapverify1':
695 def displayStr = getStressModeDisplayName(scenario)
696 assert (os == 'Windows_NT') || (os in Constants.crossList)
697 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
698 "(?i).*test\\W+${os}\\W+${scenario}.*")
700 case 'corefx_baseline':
701 case 'corefx_minopts':
702 case 'corefx_jitstress1':
703 case 'corefx_jitstress2':
704 case 'corefx_jitstressregs1':
705 case 'corefx_jitstressregs2':
706 case 'corefx_jitstressregs3':
707 case 'corefx_jitstressregs4':
708 case 'corefx_jitstressregs8':
709 case 'corefx_jitstressregs0x10':
710 case 'corefx_jitstressregs0x80':
711 def displayName = 'CoreFx' + getStressModeDisplayName(scenario)
712 assert (os == 'Windows_NT') || (os in Constants.crossList)
713 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayName})",
714 "(?i).*test\\W+${os}\\W+${scenario}.*")
717 println("Unknown scenario: ${scenario}");
725 if (configuration == 'Release') {
726 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
730 if (configuration == 'Checked' || configuration == 'Release') {
731 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
735 if (configuration == 'Checked' || configuration == 'Release') {
736 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
739 case 'gcstress15_pri1r2r':
740 if (configuration == 'Release' || configuration == 'Checked') {
741 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
744 case 'r2r_jitstress1':
745 if (configuration == 'Release' || configuration == 'Checked') {
746 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstress1 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
749 case 'r2r_jitstress2':
750 if (configuration == 'Release' || configuration == 'Checked') {
751 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstress2 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
754 case 'r2r_jitstressregs1':
755 if (configuration == 'Release' || configuration == 'Checked') {
756 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregs1 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
759 case 'r2r_jitstressregs2':
760 if (configuration == 'Release' || configuration == 'Checked') {
761 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregs2 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
764 case 'r2r_jitstressregs3':
765 if (configuration == 'Release' || configuration == 'Checked') {
766 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregs3 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
769 case 'r2r_jitstressregs4':
770 if (configuration == 'Release' || configuration == 'Checked') {
771 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregs4 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
774 case 'r2r_jitstressregs8':
775 if (configuration == 'Release' || configuration == 'Checked') {
776 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregs8 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
779 case 'r2r_jitstressregsx10':
780 if (configuration == 'Release' || configuration == 'Checked') {
781 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregsx10 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
784 case 'r2r_jitstressregsx80':
785 if (configuration == 'Release' || configuration == 'Checked') {
786 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregsx80 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
789 case 'r2r_jitminopts':
790 if (configuration == 'Release' || configuration == 'Checked') {
791 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} JITMinOpts R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
794 case 'r2r_jitforcerelocs':
795 if (configuration == 'Release' || configuration == 'Checked') {
796 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ForceRelocs R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
806 if (configuration == 'Debug') {
807 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test")
812 if (configuration == 'Release') {
813 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Priority 1 Build and Test")
817 if (configuration == 'Release') {
818 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} IL RoundTrip Build and Test", "(?i).*test\\W+${os}\\W+${scenario}.*")
822 if (configuration == 'Checked' || configuration == 'Release') {
823 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
827 if (configuration == 'Checked' || configuration == 'Release') {
828 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
831 case 'gcstress15_pri1r2r':
832 if (configuration == 'Release' || configuration == 'Checked') {
833 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
836 case 'r2r_jitstress1':
837 if (configuration == 'Release' || configuration == 'Checked') {
838 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstress1 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
841 case 'r2r_jitstress2':
842 if (configuration == 'Release' || configuration == 'Checked') {
843 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstress2 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
846 case 'r2r_jitstressregs1':
847 if (configuration == 'Release' || configuration == 'Checked') {
848 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregs1 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
851 case 'r2r_jitstressregs2':
852 if (configuration == 'Release' || configuration == 'Checked') {
853 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregs2 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
856 case 'r2r_jitstressregs3':
857 if (configuration == 'Release' || configuration == 'Checked') {
858 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregs3 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
861 case 'r2r_jitstressregs4':
862 if (configuration == 'Release' || configuration == 'Checked') {
863 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregs4 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
866 case 'r2r_jitstressregs8':
867 if (configuration == 'Release' || configuration == 'Checked') {
868 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregs8 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
871 case 'r2r_jitstressregsx10':
872 if (configuration == 'Release' || configuration == 'Checked') {
873 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregsx10 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
876 case 'r2r_jitstressregsx80':
877 if (configuration == 'Release' || configuration == 'Checked') {
878 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} jitstressregsx80 R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
881 case 'r2r_jitminopts':
882 if (configuration == 'Release' || configuration == 'Checked') {
883 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} JITMinOpts R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
886 case 'r2r_jitforcerelocs':
887 if (configuration == 'Release' || configuration == 'Checked') {
888 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} ForceRelocs R2R Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
892 if (configuration == 'Release') {
893 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Long-Running GC Build & Test", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
897 if (configuration == 'Release') {
898 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} GC Simulator", "(?i).*test\\W+${os}\\W+${configuration}\\W+${scenario}.*")
902 assert (os == 'Windows_NT') || (os in Constants.crossList)
903 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - MinOpts)",
904 "(?i).*test\\W+${os}\\W+${scenario}.*")
907 assert (os == 'Windows_NT') || (os in Constants.crossList)
908 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ForceRelocs)",
909 "(?i).*test\\W+${os}\\W+${scenario}.*")
912 assert (os == 'Windows_NT') || (os in Constants.crossList)
913 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStress=1)",
914 "(?i).*test\\W+${os}\\W+${scenario}.*")
917 assert (os == 'Windows_NT') || (os in Constants.crossList)
918 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStress=2)",
919 "(?i).*test\\W+${os}\\W+${scenario}.*")
921 case 'jitstressregs1':
922 assert (os == 'Windows_NT') || (os in Constants.crossList)
923 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStressRegs=1)",
924 "(?i).*test\\W+${os}\\W+${scenario}.*")
926 case 'jitstressregs2':
927 assert (os == 'Windows_NT') || (os in Constants.crossList)
928 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStressRegs=2)",
929 "(?i).*test\\W+${os}\\W+${scenario}.*")
931 case 'jitstressregs3':
932 assert (os == 'Windows_NT') || (os in Constants.crossList)
933 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStressRegs=3)",
934 "(?i).*test\\W+${os}\\W+${scenario}.*")
936 case 'jitstressregs4':
937 assert (os == 'Windows_NT') || (os in Constants.crossList)
938 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStressRegs=4)",
939 "(?i).*test\\W+${os}\\W+${scenario}.*")
941 case 'jitstressregs8':
942 assert (os == 'Windows_NT') || (os in Constants.crossList)
943 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStressRegs=8)",
944 "(?i).*test\\W+${os}\\W+${scenario}.*")
946 case 'jitstressregs0x10':
947 assert (os == 'Windows_NT') || (os in Constants.crossList)
948 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStressRegs=0x10)",
949 "(?i).*test\\W+${os}\\W+${scenario}.*")
951 case 'jitstressregs0x80':
952 assert (os == 'Windows_NT') || (os in Constants.crossList)
953 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - JitStressRegs=0x80)",
954 "(?i).*test\\W+${os}\\W+${scenario}.*")
956 case 'jitstress2_jitstressregs1':
957 case 'jitstress2_jitstressregs2':
958 case 'jitstress2_jitstressregs3':
959 case 'jitstress2_jitstressregs4':
960 case 'jitstress2_jitstressregs8':
961 case 'jitstress2_jitstressregs0x10':
962 case 'jitstress2_jitstressregs0x80':
967 case 'gcstress0xc_zapdisable':
968 case 'gcstress0xc_zapdisable_jitstress2':
969 case 'gcstress0xc_zapdisable_heapverify1':
970 case 'gcstress0xc_jitstress1':
971 case 'gcstress0xc_jitstress2':
972 case 'gcstress0xc_minopts_heapverify1':
973 def displayStr = getStressModeDisplayName(scenario)
974 assert (os == 'Windows_NT') || (os in Constants.crossList)
975 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayStr})",
976 "(?i).*test\\W+${os}\\W+${scenario}.*")
978 case 'corefx_baseline':
979 case 'corefx_minopts':
980 case 'corefx_jitstress1':
981 case 'corefx_jitstress2':
982 case 'corefx_jitstressregs1':
983 case 'corefx_jitstressregs2':
984 case 'corefx_jitstressregs3':
985 case 'corefx_jitstressregs4':
986 case 'corefx_jitstressregs8':
987 case 'corefx_jitstressregs0x10':
988 case 'corefx_jitstressregs0x80':
989 def displayName = 'CoreFx ' + getStressModeDisplayName(scenario)
990 assert (os == 'Windows_NT') || (os in Constants.crossList)
991 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build and Test (Jit - ${displayName})",
992 "(?i).*test\\W+${os}\\W+${scenario}.*")
995 println("Unknown scenario: ${scenario}");
1001 assert scenario == 'default'
1002 if (configuration == 'Checked') {
1003 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} Build")
1007 println("Unknown os: ${os}");
1013 assert scenario == 'default'
1016 if (!isLinuxEmulatorBuild) {
1017 // Removing the regex will cause this to run on each PR.
1018 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build")
1021 Utilities.addGithubPRTriggerForBranch(job, branch, "Linux ARM Emulator Build", "(?i).*test\\W+Linux\\W+arm\\W+emulator.*")
1025 println("NYI os: ${os}");
1031 assert (scenario == 'default') || (scenario == 'pri1r2r')
1033 // Set up a private trigger
1034 def contextString = "${os} ${architecture} Cross ${configuration}"
1035 if (scenario != 'default')
1036 contextString += " ${scenario}"
1037 contextString += " Build"
1038 // Debug builds only.
1039 if (configuration != 'Debug') {
1040 contextString += " and Test"
1043 def arm64Users = ['erozenfeld', 'kyulee1', 'pgavlin', 'russellhadley', 'swaroop-sridhar', 'JosephTremoulet', 'jashook', 'RussKeldorph', 'gkhanna79', 'briansull', 'cmckinsey', 'jkotas', 'ramarag', 'markwilkie', 'rahku', 'tzwlai', 'weshaggard']
1048 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString,
1049 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}", null, arm64Users)
1052 Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString,
1053 "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}", null, arm64Users)
1058 println("NYI os: ${os}");
1065 assert (scenario == 'default' || scenario == 'r2r' || scenario == 'pri1r2r' || scenario == 'gcstress15_pri1r2r' || scenario == 'longgc' || scenario == 'gcsimulator' ||
1066 Constants.r2rJitStressScenarios.indexOf(scenario) != -1)
1067 // For windows, x86 runs by default
1070 if (architecture == 'x86lb') {
1071 jit = 'legacy_backend'
1074 if (scenario == 'default') {
1075 if (os == 'Windows_NT') {
1076 if (configuration == 'Checked') {
1077 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} Build and Test")
1082 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} Build", "(?i).*test\\W+${arch}\\W+${osGroup}.\\W+${jit}*")
1085 else if (scenario == 'r2r') {
1086 if (os == 'Windows_NT') {
1087 if (configuration == 'Release') {
1088 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} R2R pri0 Build & Test", "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}\\W+${scenario}.*")
1092 else if (scenario == 'pri1r2r') {
1093 if (os == 'Windows_NT') {
1094 if (configuration == 'Release') {
1095 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}\\W+${scenario}.*")
1099 else if (scenario == 'gcstress15_pri1r2r'){
1100 if (os == 'Windows_NT'){
1101 if (configuration == 'Release'){
1102 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} GCStress 15 R2R pri1 Build & Test", "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}\\W+${scenario}.*")
1106 else if (scenario == 'r2r_jitstress1'){
1107 if (configuration == 'Release' || configuration == 'Checked') {
1108 if (os == 'Windows_NT'){
1109 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} jitstress1 R2R Build & Test", "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}\\W+${scenario}.*")
1113 else if (scenario == 'r2r_jitstress2'){
1114 if (configuration == 'Release' || configuration == 'Checked') {
1115 if (os == 'Windows_NT'){
1116 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} jitstress2 R2R Build & Test", "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}\\W+${scenario}.*")
1120 else if (scenario == 'r2r_jitstressregs1'){
1121 if (configuration == 'Release' || configuration == 'Checked') {
1122 if (os == 'Windows_NT'){
1123 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} jitstressregs1 R2R Build & Test", "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}\\W+${scenario}.*")
1127 else if (scenario == 'r2r_jitstressregs2'){
1128 if (configuration == 'Release' || configuration == 'Checked') {
1129 if (os == 'Windows_NT'){
1130 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} jitstressregs2 R2R Build & Test", "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}\\W+${scenario}.*")
1134 else if (scenario == 'r2r_jitstressregs3'){
1135 if (configuration == 'Release' || configuration == 'Checked') {
1136 if (os == 'Windows_NT'){
1137 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} jitstressregs3 R2R Build & Test", "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}\\W+${scenario}.*")
1141 else if (scenario == 'r2r_jitstressregs4'){
1142 if (configuration == 'Release' || configuration == 'Checked') {
1143 if (os == 'Windows_NT'){
1144 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} jitstressregs4 R2R Build & Test", "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}\\W+${scenario}.*")
1148 else if (scenario == 'r2r_jitstressregs8'){
1149 if (configuration == 'Release' || configuration == 'Checked') {
1150 if (os == 'Windows_NT'){
1151 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} jitstressregs8 R2R Build & Test", "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}\\W+${scenario}.*")
1155 else if (scenario == 'r2r_jitstressregsx10'){
1156 if (configuration == 'Release' || configuration == 'Checked') {
1157 if (os == 'Windows_NT'){
1158 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} jitstressregsx10 R2R Build & Test", "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}\\W+${scenario}.*")
1162 else if (scenario == 'r2r_jitstressregsx80'){
1163 if (configuration == 'Release' || configuration == 'Checked') {
1164 if (os == 'Windows_NT'){
1165 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} jitstressregsx80 R2R Build & Test", "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}\\W+${scenario}.*")
1169 else if (scenario == 'r2r_jitminopts'){
1170 if (configuration == 'Release' || configuration == 'Checked') {
1171 if (os == 'Windows_NT'){
1172 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} jitminopts R2R Build & Test", "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}\\W+${scenario}.*")
1176 else if (scenario == 'r2r_jitforcerelocs'){
1177 if (configuration == 'Release' || configuration == 'Checked') {
1178 if (os == 'Windows_NT'){
1179 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} jitforcerelocs R2R Build & Test", "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}\\W+${scenario}.*")
1183 else if (scenario == 'longgc') {
1184 if (os == 'Windows_NT'){
1185 if (configuration == 'Release'){
1186 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} Long-Running GC Build & Test", "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}\\W+${scenario}.*")
1190 else if (scenario == 'gcsimulator') {
1191 if (os == 'Windows_NT') {
1192 if (configuration == 'Release') {
1193 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${arch} ${jit} ${configuration} GC Simulator", "(?i).*test\\W+${os}\\W+${arch}\\W+${jit}\\W+${configuration}\\W+${scenario}.*")
1199 println("Unknown architecture: ${architecture}");
1205 // Additional scenario which can alter behavior
1207 def combinedScenarios = Constants.basicScenarios + Constants.jitStressModeScenarios.keySet()
1208 combinedScenarios.each { scenario ->
1209 [true, false].each { isPR ->
1210 Constants.architectureList.each { architecture ->
1211 Constants.configurationList.each { configuration ->
1212 Constants.osList.each { os ->
1213 // If the OS is Windows_NT_BuildOnly, set the isBuildOnly flag to true
1214 // and reset the os to Windows_NT
1215 def isBuildOnly = false
1216 if (os == 'Windows_NT_BuildOnly') {
1221 // If the OS is LinuxARMEmulator and arch is arm, set the isLinuxEmulatorBuild
1222 // flag to true and reset the os to Ubuntu
1223 // The isLinuxEmulatorBuild flag will be used at a later time to execute the right
1224 // set of build commands
1225 // The tuples (LinuxARMEmulator, other architectures) are not handled and control returns
1226 def isLinuxEmulatorBuild = false
1227 if (os == 'LinuxARMEmulator' && architecture == 'arm') {
1228 isLinuxEmulatorBuild = true
1230 } else if (os == 'LinuxARMEmulator') {
1234 // Skip totally unimplemented (in CI) configurations.
1235 switch (architecture) {
1238 if (os != 'Windows_NT' || isBuildOnly) {
1243 // Only Ubuntu cross implemented
1244 if (os != 'Ubuntu') {
1251 if (os != 'Windows_NT') {
1256 // Everything implemented
1259 println("Unknown architecture: ${architecture}")
1263 // Skip scenarios (blanket skipping for jit stress modes, which are good most everywhere
1264 // with checked builds
1265 def enableCorefxTesting = false
1266 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
1267 if (configuration != 'Checked') {
1271 enableCorefxTesting = isCorefxTesting(scenario)
1273 // Since these are just execution time differences,
1274 // skip platforms that don't execute the tests here (Windows_NT only)
1275 def isEnabledOS = os == 'Windows_NT' || (os == 'Ubuntu' && enableCorefxTesting)
1276 if (!isEnabledOS || isBuildOnly) {
1280 // No stress modes except on x64 right now (mainly because of bad test state on x86)
1281 if (architecture != 'x64') {
1286 // If this is a r2r jitstress, jitstressregs, jitminopts or forcerelocs scenario
1287 // and configuration is not Checked, bail out.
1288 if (configuration != 'Checked' && Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
1295 // The pri1 build isn't necessary except for Windows_NT. Non-Windows NT uses
1296 // the default scenario build
1297 if (os != 'Windows_NT') {
1301 if (architecture != 'x64') {
1306 // The ilrt build isn't necessary except for Windows_NT. Non-Windows NT uses
1307 // the default scenario build
1308 if (os != 'Windows_NT') {
1312 if (architecture != 'x64') {
1317 // The r2r build isn't necessary except for Windows_NT. Non-Windows NT uses
1318 // the default scenario build
1319 if (os != 'Windows_NT') {
1322 if (architecture != 'x64') {
1327 // The pri1r2r build isn't necessary except for Windows_NT. Non-Windows NT uses
1328 // the default scenario build
1329 if (os != 'Windows_NT') {
1332 if (architecture != 'x64') {
1333 if (architecture != 'arm64' || configuration == 'Debug') {
1338 case 'gcstress15_pri1r2r':
1339 case 'r2r_jitstress1':
1340 case 'r2r_jitstress2':
1341 case 'r2r_jitstressregs1':
1342 case 'r2r_jitstressregs2':
1343 case 'r2r_jitstressregs3':
1344 case 'r2r_jitstressregs4':
1345 case 'r2r_jitstressregs8':
1346 case 'r2r_jitstressregsx10':
1347 case 'r2r_jitstressregsx80':
1348 case 'r2r_jitminopts':
1349 case 'r2r_jitforcerelocs':
1350 // The above builds are not necessary except for Windows_NT. Non-Windows NT uses
1351 // the default scenario build
1352 if (os != 'Windows_NT') {
1355 if (architecture != 'x64') {
1361 if (os != 'Windows_NT' && os != 'Ubuntu' && os != 'OSX') {
1364 if (architecture != 'x64') {
1367 if (configuration != 'Release') {
1371 // We need Windows & Ubuntu x64 Release bits for the code coverage build
1373 if (os != 'Windows_NT' && os != 'Ubuntu') {
1376 if (architecture != 'x64') {
1379 if (configuration != 'Release') {
1387 println("Unknown scenario: ${scenario}")
1394 def lowerConfiguration = configuration.toLowerCase()
1395 def jobName = getJobName(configuration, architecture, os, scenario, isBuildOnly)
1397 // Create the new job
1398 def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {}
1400 setMachineAffinity(newJob, os, architecture)
1402 // Add all the standard options
1403 Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
1404 addTriggers(newJob, branch, isPR, architecture, os, configuration, scenario, false, isBuildOnly, isLinuxEmulatorBuild)
1406 def buildCommands = [];
1407 def osGroup = getOSGroup(os)
1409 // Calculate the build steps, archival, and xunit results
1412 switch (architecture) {
1416 def arch = architecture
1417 if (architecture == 'x86ryujit' || architecture == 'x86lb') {
1421 if (Constants.jitStressModeScenarios.containsKey(scenario) ||
1422 scenario == 'default' ||
1423 scenario == 'r2r' ||
1424 Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
1425 buildOpts = enableCorefxTesting ? 'skiptests' : ''
1426 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${arch} ${buildOpts}"
1429 // For Pri 1 tests, we must shorten the output test binary path names.
1430 // if __TestIntermediateDir is already set, buildtest.cmd will
1431 // output test binaries to that directory. If it is not set, the
1432 // binaries are sent to a default directory whose name is about
1433 // 35 characters long.
1435 else if (scenario == 'pri1' || scenario == 'pri1r2r' || scenario == 'gcstress15_pri1r2r'|| scenario == 'coverage') {
1436 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${arch} Priority 1"
1438 else if (scenario == 'ilrt') {
1439 // First do the build with skiptests and then build the tests with ilasm roundtrip
1440 buildCommands += "build.cmd ${lowerConfiguration} ${arch} skiptests"
1441 buildCommands += "set __TestIntermediateDir=int&&tests\\buildtest.cmd ${lowerConfiguration} ${arch} ilasmroundtrip"
1443 else if (isLongGc(scenario)) {
1444 buildCommands += "build.cmd ${lowerConfiguration} ${arch} skiptests"
1445 buildCommands += "set __TestIntermediateDir=int&&tests\\buildtest.cmd ${lowerConfiguration} ${arch}"
1448 println("Unknown scenario: ${scenario}")
1452 // If we are running a stress mode, we should write out the set of key
1453 // value env pairs to a file at this point and then we'll pass that to runtest.cmd
1456 //If this is a crossgen build, pass 'crossgen' to runtest.cmd
1457 def crossgenStr = ''
1458 def runcrossgentestsStr = ''
1459 def runjitstressStr = ''
1460 def runjitstressregsStr = ''
1461 def runjitmioptsStr = ''
1462 def runjitforcerelocsStr = ''
1463 def gcstressStr = ''
1464 def runtestArguments = ''
1465 def gcTestArguments = ''
1467 if (scenario == 'r2r' ||
1468 scenario == 'pri1r2r' ||
1469 scenario == 'gcstress15_pri1r2r' ||
1470 Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
1471 crossgenStr = 'crossgen'
1472 runcrossgentestsStr = 'runcrossgentests'
1474 if (scenario == 'r2r_jitstress1'){
1475 runjitstressStr = 'jitstress 1'
1477 else if (scenario == 'r2r_jitstress2') {
1478 runjitstressStr = 'jitstress 2'
1480 else if (scenario == 'r2r_jitstressregs1'){
1481 runjitstressregsStr = 'jitstressregs 1'
1483 else if (scenario == 'r2r_jitstressregs2') {
1484 runjitstressregsStr = 'jitstressregs 2'
1486 else if (scenario == 'r2r_jitstressregs3') {
1487 runjitstressregsStr = 'jitstressregs 3'
1489 else if (scenario == 'r2r_jitstressregs4') {
1490 runjitstressregsStr = 'jitstressregs 4'
1492 else if (scenario == 'r2r_jitstressregs8') {
1493 runjitstressregsStr = 'jitstressregs 8'
1495 else if (scenario == 'r2r_jitstressregsx10') {
1496 runjitstressregsStr = 'jitstressregs x10'
1498 else if (scenario == 'r2r_jitstressregsx80') {
1499 runjitstressregsStr = 'jitstressregs x80'
1501 else if (scenario == 'r2r_jitminopts') {
1502 runjitmioptsStr = 'jitminopts'
1504 else if (scenario == 'r2r_jitforcerelocs') {
1505 runjitforcerelocsStr = 'jitforcerelocs'
1508 if (scenario == 'gcstress15_pri1r2r')
1510 gcstressStr = 'gcstresslevel 0xF'
1513 if (isLongGc(scenario)) {
1514 gcTestArguments = '${scenario} sequential'
1517 runtestArguments = "${lowerConfiguration} ${arch} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${gcTestArguments}"
1518 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
1519 if (enableCorefxTesting) {
1520 // Sync to corefx repo
1521 // Move coreclr files to a subdirectory, %workspace%/clr. Otherwise, corefx build
1522 // thinks that %workspace% is the project base directory.
1523 buildCommands += "powershell new-item clr -type directory -force"
1524 buildCommands += 'powershell foreach ($x in get-childitem -force) { if (\$x.name -ne \'clr\') { move-item $x clr }}'
1525 buildCommands += "git clone https://github.com/dotnet/corefx fx"
1527 buildCommands += getStressModeEnvSetCmd(os, scenario);
1529 // Run corefx build and testing
1530 buildCommands += "cd fx && call \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat\" x86 && Build.cmd /p:ConfigurationGroup=Release /p:BUILDTOOLS_OVERRIDE_RUNTIME=%WORKSPACE%\\clr\\bin\\Product\\Windows_NT.x64.Checked "
1533 def stepScriptLocation = "%WORKSPACE%\\bin\\tests\\SetStressModes.bat"
1534 buildCommands += genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], stepScriptLocation)
1536 // Run tests with the
1538 buildCommands += "tests\\runtest.cmd ${runtestArguments} TestEnv ${stepScriptLocation}"
1541 else if (architecture == 'x64') {
1542 buildCommands += "tests\\runtest.cmd ${runtestArguments}"
1544 else if (architecture == 'x86ryujit') {
1545 def testEnvLocation = "%WORKSPACE%\\tests\\x86\\ryujit_x86_testenv.cmd"
1547 buildCommands += "tests\\runtest.cmd ${runtestArguments} TestEnv ${testEnvLocation}"
1549 else if (architecture == 'x86lb') {
1550 buildCommands += "tests\\runtest.cmd ${runtestArguments} Exclude0 x86_legacy_backend_issues.targets"
1554 if (!enableCorefxTesting) {
1555 // Run the rest of the build
1556 // Build the mscorlib for the other OS's
1557 buildCommands += "build.cmd ${lowerConfiguration} ${arch} linuxmscorlib"
1558 buildCommands += "build.cmd ${lowerConfiguration} ${arch} freebsdmscorlib"
1559 buildCommands += "build.cmd ${lowerConfiguration} ${arch} osxmscorlib"
1561 // Zip up the tests directory so that we don't use so much space/time copying
1562 // 10s of thousands of files around.
1563 buildCommands += "powershell -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${arch}.${configuration}', '.\\bin\\tests\\tests.zip')\"";
1565 if (!Constants.jitStressModeScenarios.containsKey(scenario)) {
1566 // For windows, pull full test results and test drops for x86/x64.
1567 // No need to pull for stress mode scenarios (downstream builds use the default scenario)
1568 Utilities.addArchival(newJob, "bin/Product/**,bin/tests/tests.zip")
1572 if (architecture == 'x64' || !isPR) {
1573 Utilities.addXUnitDotNETResults(newJob, 'bin/**/TestRun*.xml')
1575 setTestJobTimeOut(newJob, scenario)
1579 // Archive only result xml files since corefx/bin/tests is very large around 10 GB.
1580 // For windows, pull full test results and test drops for x86/x64
1581 Utilities.addArchival(newJob, "fx/bin/tests/**/testResults.xml")
1584 setTestJobTimeOut(newJob, scenario)
1586 if (architecture == 'x64' || !isPR) {
1587 Utilities.addXUnitDotNETResults(newJob, 'fx/bin/tests/**/testResults.xml')
1593 assert (scenario == 'default') || (scenario == 'pri1r2r')
1595 // Up the timeout for arm64 jobs.
1596 Utilities.setJobTimeout(newJob, 240);
1598 // Debug runs take too long to run. So build job only.
1599 if (lowerConfiguration == "debug") {
1600 buildCommands += "set __TestIntermediateDir=int&&build.cmd ${lowerConfiguration} ${architecture} /toolset_dir C:\\ats2"
1603 buildCommands += "set __TestIntermediateDir=int&&build.cmd skiptests ${lowerConfiguration} ${architecture} /toolset_dir C:\\ats2"
1604 // Test build and run are launched together.
1605 buildCommands += "Z:\\arm64\\common\\scripts\\arm64PostLauncher.cmd %WORKSPACE% ${architecture} ${lowerConfiguration} ${scenario}"
1606 Utilities.addXUnitDotNETResults(newJob, 'bin/tests/testResults.xml')
1610 Utilities.addArchival(newJob, "bin/Product/**")
1613 println("Unknown architecture: ${architecture}");
1625 case 'OpenSUSE13.2':
1627 switch (architecture) {
1631 def arch = architecture
1632 if (architecture == 'x86ryujit' || architecture == 'x86lb') {
1636 if (!enableCorefxTesting) {
1637 // We run pal tests on all OS but generate mscorlib (and thus, nuget packages)
1638 // only on supported OS platforms.
1639 if ((os == 'FreeBSD') || (os == 'OpenSUSE13.2'))
1641 buildCommands += "./build.sh skipmscorlib verbose ${lowerConfiguration} ${arch}"
1643 else if (scenario == 'coverage')
1645 assert os == 'Ubuntu'
1646 assert lowerConfiguration == 'release'
1647 buildCommands += "./build.sh coverage verbose ${lowerConfiguration} ${arch}"
1649 // Remove folders from obj that we don't expect to be covered. May update this later.
1650 buildCommands += "rm -rf ./bin/obj/Linux.x64.Release/src/ToolBox"
1651 buildCommands += "rm -rf ./bin/obj/Linux.x64.Release/src/debug"
1652 buildCommands += "rm -rf ./bin/obj/Linux.x64.Release/src/ilasm"
1653 buildCommands += "rm -rf ./bin/obj/Linux.x64.Release/src/ildasm"
1654 buildCommands += "rm -rf ./bin/obj/Linux.x64.Release/src/dlls/dbgshim"
1655 buildCommands += "rm -rf ./bin/obj/Linux.x64.Release/src/dlls/mscordac"
1656 buildCommands += "rm -rf ./bin/obj/Linux.x64.Release/src/dlls/mscordbi"
1660 buildCommands += "./build.sh verbose ${lowerConfiguration} ${arch}"
1662 buildCommands += "src/pal/tests/palsuite/runpaltests.sh \${WORKSPACE}/bin/obj/${osGroup}.${arch}.${configuration} \${WORKSPACE}/bin/paltestout"
1664 // Delete PAL test obj files after we run them, if this is a coverage job
1665 if (scenario == 'coverage') {
1666 buildCommands += "rm -rf ./bin/obj/Linux.x64.Release/src/pal/tests"
1670 setTestJobTimeOut(newJob, scenario)
1671 // Basic archiving of the build
1672 if (scenario == 'coverage')
1674 Utilities.addArchival(newJob, "bin/Product/**,bin/obj/Linux.x64.Release/src/**")
1677 Utilities.addArchival(newJob, "bin/Product/**,bin/obj/*/tests/**/*.dylib,bin/obj/*/tests/**/*.so")
1680 Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
1683 // Corefx stress testing
1684 assert os == 'Ubuntu'
1685 assert architecture == 'x64'
1686 assert lowerConfiguration == 'checked'
1688 // Build coreclr and move it to clr directory
1689 buildCommands += "./build.sh verbose ${lowerConfiguration} ${architecture}"
1690 buildCommands += "rm -rf .clr; mkdir .clr; mv * .clr; mv .git .clr; mv .clr clr"
1693 buildCommands += "git clone https://github.com/dotnet/corefx fx"
1695 // Set environment variable
1696 def setEnvVar = getStressModeEnvSetCmd(os, scenario)
1698 // Build and text corefx
1699 buildCommands += "rm -rf \$WORKSPACE/fx_home; mkdir \$WORKSPACE/fx_home"
1700 buildCommands += setEnvVar
1701 buildCommands += "cd fx; export HOME=\$WORKSPACE/fx_home; ./build.sh /p:ConfigurationGroup=Release /p:BUILDTOOLS_OVERRIDE_RUNTIME=\$WORKSPACE/clr/bin/Product/Linux.x64.Checked /p:Outerloop=true /p:TestWithLocalLibraries=true"
1703 // Archive and process test result
1704 Utilities.addArchival(newJob, "fx/bin/tests/**/testResults.xml")
1705 setTestJobTimeOut(newJob, scenario)
1706 Utilities.addXUnitDotNETResults(newJob, 'fx/bin/tests/**/testResults.xml')
1710 // We don't run the cross build except on Ubuntu
1711 assert os == 'Ubuntu'
1713 buildCommands += """echo \"Using rootfs in /opt/aarch64-linux-gnu-root\"
1714 ROOTFS_DIR=/opt/aarch64-linux-gnu-root ./build.sh skipmscorlib arm64 cross verbose ${lowerConfiguration}"""
1716 // Basic archiving of the build, no pal tests
1717 Utilities.addArchival(newJob, "bin/Product/**")
1720 // All builds for ARM architecture are run on Ubuntu currently
1721 assert os == 'Ubuntu'
1722 if (!isLinuxEmulatorBuild) {
1723 buildCommands += """echo \"Using rootfs in /opt/arm-liux-genueabihf-root\"
1724 ROOTFS_DIR=/opt/arm-linux-genueabihf-root ./build.sh skipmscorlib arm cross verbose ${lowerConfiguration}"""
1726 // Basic archiving of the build, no pal tests
1727 Utilities.addArchival(newJob, "bin/Product/**")
1731 // Unmount previously mounted rootfs and mount the Linux ARM emulator rootfs at /opt/linux-arm-emulator-root/
1732 buildCommands += "if grep -qs '/opt/linux-arm-emulator-root' /proc/mounts; then sudo umount /opt/linux-arm-emulator-root; fi ; sudo mount /opt/linux-arm-emulator/platform/rootfs-t30.ext4 /opt/linux-arm-emulator-root/"
1733 // Remove old copy of coreclr and copy the latest version of coreclr
1734 // This need to be done as it is not possible to clone the repository inside the chroot jail
1735 buildCommands += "sudo rm -rf /opt/linux-arm-emulator-root/home/coreclr; sudo mkdir /opt/linux-arm-emulator-root/home/coreclr; sudo cp -R ./ /opt/linux-arm-emulator-root/home/coreclr"
1737 // Chroot into the Linux ARM emulator environment and execute the build
1738 buildCommands += """echo \"Chrooting into Linux ARM emulator environment\"
1739 sudo chroot /opt/linux-arm-emulator-root/ /bin/bash -x <<EOF
1740 source /dotnet/setenv/setenv_coreclr.sh
1742 ./build.sh arm clean verbose skipmscorlib
1745 // Basic archiving of the build, no pal tests
1746 Utilities.addArchival(newJob, "/opt/linux-arm-emulator-root/home/coreclr/bin/Product/**")
1750 println("Unknown architecture: ${architecture}");
1756 println("Unknown os: ${os}");
1763 if (os == 'Windows_NT') {
1764 buildCommands.each { buildCommand ->
1765 batchFile(buildCommand)
1769 buildCommands.each { buildCommand ->
1781 // Create the Linux/OSX/CentOS coreclr test leg for debug and release and each scenario
1782 combinedScenarios.each { scenario ->
1783 [true, false].each { isPR ->
1784 // Architectures. x64 only at this point
1785 ['x64'].each { architecture ->
1786 // Put the OS's supported for coreclr cross testing here
1787 Constants.crossList.each { os ->
1788 Constants.configurationList.each { configuration ->
1790 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
1791 if (configuration != 'Checked') {
1794 if (isCorefxTesting(scenario)) {
1797 //Skip stress modes for these scenarios
1798 if (os == 'RHEL7.2' || os == 'Debian8.4' || os == 'OpenSUSE13.2') {
1802 // If this is a r2r jitstress, jitstressregs, jitminopts or forcerelocs scenario
1803 // and configuration is not Checked, bail out.
1804 else if (configuration != 'Checked' && Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
1807 // For CentOS, we only want Checked/Release pri1 builds.
1808 else if (os == 'CentOS7.1') {
1809 if (scenario != 'pri1' &&
1810 scenario != 'r2r' &&
1811 scenario != 'pri1r2r' &&
1812 scenario != 'gcstress15_pri1r2r' &&
1813 Constants.r2rJitStressScenarios.indexOf(scenario) == -1) {
1816 if (configuration != 'Checked' && configuration != 'Release') {
1820 // For RedHat, Debian, and OpenSUSE, we only do Release pri1 builds.
1821 else if (os == 'RHEL7.2' || os == 'Debian8.4' || os == 'OpenSUSE13.2') {
1822 if (scenario != 'pri1') {
1825 if (configuration != 'Release') {
1838 //Skip configs that aren't Checked or Release (so just Debug, for now)
1839 if (configuration != 'Checked' && configuration != 'Release') {
1844 //Skip configs that aren't Checked or Release (so just Debug, for now)
1845 if (configuration != 'Checked' && configuration != 'Release') {
1849 case 'gcstress15_pri1r2r':
1850 case 'r2r_jitstress1':
1851 case 'r2r_jitstress2':
1852 case 'r2r_jitstressregs1':
1853 case 'r2r_jitstressregs2':
1854 case 'r2r_jitstressregs3':
1855 case 'r2r_jitstressregs4':
1856 case 'r2r_jitstressregs8':
1857 case 'r2r_jitstressregsx10':
1858 case 'r2r_jitstressregsx80':
1859 case 'r2r_jitminopts':
1860 case 'r2r_jitforcerelocs':
1861 //Skip configs that aren't Checked or Release (so just Debug, for now)
1862 if (configuration != 'Checked' && configuration != 'Release') {
1868 // Long GC tests take a long time on non-Release builds
1869 if (configuration != 'Release') {
1874 //We only want Ubuntu Release for coverage
1875 if (os != 'Ubuntu') {
1878 if (configuration != 'Release') {
1885 println("Unknown scenario: ${scenario}")
1891 def lowerConfiguration = configuration.toLowerCase()
1892 def osGroup = getOSGroup(os)
1893 def jobName = getJobName(configuration, architecture, os, scenario, false) + "_tst"
1894 // Unless this is a coverage test run, we want to copy over the default build of coreclr.
1895 def inputScenario = 'default'
1896 if (scenario == 'coverage') {
1897 inputScenario = 'coverage'
1899 def inputCoreCLRBuildName = projectFolder + '/' +
1900 Utilities.getFullJobName(project, getJobName(configuration, architecture, os, inputScenario, false), isPR)
1901 // If this is a stress scenario, there isn't any difference in the build job
1902 // so we didn't create a build only job for windows_nt specific to that stress mode. Just copy
1903 // from the default scenario
1904 def testBuildScenario = scenario
1905 if (testBuildScenario == 'coverage' || testBuildScenario == 'pri1r2r'|| testBuildScenario == 'gcstress15_pri1r2r') {
1906 testBuildScenario = 'pri1'
1908 else if ( testBuildScenario == 'r2r' || isLongGc(testBuildScenario)) {
1909 testBuildScenario = 'default'
1911 def inputWindowTestsBuildName = ''
1912 if (Constants.jitStressModeScenarios.containsKey(testBuildScenario)) {
1913 inputWindowTestsBuildName = projectFolder + '/' +
1914 Utilities.getFullJobName(project, getJobName(configuration, architecture, 'windows_nt', 'default', true), isPR)
1917 inputWindowTestsBuildName = projectFolder + '/' +
1918 Utilities.getFullJobName(project, getJobName(configuration, architecture, 'windows_nt', testBuildScenario, true), isPR)
1920 // Enable Server GC for Ubuntu PR builds
1921 def serverGCString = ''
1923 // Whether or not this test run should be run sequentially instead
1924 // of in parallel. Only used for long GC tests.
1925 def sequentialString = ''
1927 // Whether or not this test run should run a specific playlist.
1928 // Only used for long GC tests.
1930 // A note - runtest.sh does have "--long-gc" and "--gcsimulator" options
1931 // for running long GC and GCSimulator tests, respectively. We don't use them
1932 // here because using a playlist file produces much more readable output on the CI machines
1933 // and reduces running time.
1934 def playlistString = ''
1936 if (os == 'Ubuntu' && isPR){
1937 serverGCString = '--useServerGC'
1940 // pass --crossgen to runtest.sh for crossgen builds
1941 def crossgenStr = ''
1942 def runcrossgentestsStr = ''
1943 def runjitstressStr = ''
1944 def runjitstressregsStr = ''
1945 def runjitmioptsStr = ''
1946 def runjitforcerelocsStr = ''
1947 def gcstressStr = ''
1949 if (scenario == 'r2r' ||
1950 scenario == 'pri1r2r' ||
1951 scenario == 'gcstress15_pri1r2r' ||
1952 Constants.r2rJitStressScenarios.indexOf(scenario) != -1) {
1953 crossgenStr = '--crossgen'
1954 runcrossgentestsStr = '--runcrossgentests'
1956 if (scenario == 'r2r_jitstress1'){
1957 runjitstressStr = '--jitstress=1'
1959 else if (scenario == 'r2r_jitstress2') {
1960 runjitstressStr = '--jitstress=2'
1962 else if (scenario == 'r2r_jitstressregs1'){
1963 runjitstressregsStr = '--jitstressregs=1'
1965 else if (scenario == 'r2r_jitstressregs2') {
1966 runjitstressregsStr = '--jitstressregs=2'
1968 else if (scenario == 'r2r_jitstressregs3') {
1969 runjitstressregsStr = '--jitstressregs=3'
1971 else if (scenario == 'r2r_jitstressregs4') {
1972 runjitstressregsStr = '--jitstressregs=4'
1974 else if (scenario == 'r2r_jitstressregs8') {
1975 runjitstressregsStr = '--jitstressregs=8'
1977 else if (scenario == 'r2r_jitstressregsx10') {
1978 runjitstressregsStr = '--jitstressregs=x10'
1980 else if (scenario == 'r2r_jitstressregsx80') {
1981 runjitstressregsStr = '--jitstressregs=x80'
1983 else if (scenario == 'r2r_jitminopts') {
1984 runjitmioptsStr = '--jitminopts'
1986 else if (scenario == 'r2r_jitforcerelocs') {
1987 runjitforcerelocsStr = '--jitforcerelocs'
1990 if (scenario == 'gcstress15_pri1r2r')
1992 gcstressStr = '--gcstresslevel=0xF'
1995 if (isLongGc(scenario)) {
1996 // Long GC tests behave very poorly when they are not
1997 // the only test running (many of them allocate until OOM).
1998 sequentialString = '--sequential'
2000 // The Long GC playlist contains all of the tests that are
2001 // going to be run. The GCSimulator playlist contains all of
2002 // the GC simulator tests.
2003 if (scenario == 'longgc') {
2004 playlistString = '--long-gc --playlist=./tests/longRunningGcTests.txt'
2006 else if (scenario == 'gcsimulator') {
2007 playlistString = '--gcsimulator --playlist=./tests/gcSimulatorTests.txt'
2012 def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {
2013 // Add parameters for the inputs
2016 stringParam('CORECLR_WINDOWS_BUILD', '', 'Build number to copy CoreCLR windows test binaries from')
2017 stringParam('CORECLR_BUILD', '', "Build number to copy CoreCLR ${osGroup} binaries from")
2021 // Set up the copies
2023 // Coreclr build we are trying to test
2025 copyArtifacts(inputCoreCLRBuildName) {
2026 excludePatterns('**/testResults.xml', '**/*.ni.dll')
2028 buildNumber('${CORECLR_BUILD}')
2032 // Coreclr build containing the tests and mscorlib
2034 copyArtifacts(inputWindowTestsBuildName) {
2035 excludePatterns('**/testResults.xml', '**/*.ni.dll')
2037 buildNumber('${CORECLR_WINDOWS_BUILD}')
2041 if (scenario == 'coverage') {
2042 // Move coreclr to clr directory
2043 shell("rm -rf .clr; mkdir .clr; mv * .clr; mv .git .clr; mv .clr clr")
2045 // Unzip the tests first. Exit with 0
2046 shell("unzip -q -o ./clr/bin/tests/tests.zip -d ./clr/bin/tests/Windows_NT.${architecture}.${configuration} || exit 0")
2050 shell("git clone https://github.com/dotnet/corefx fx")
2053 // Build Linux corefx
2054 shell("./fx/build.sh x64 release Linux skiptests")
2055 // Check contents of bin directory - this can be removed after we confirm everything is as expected
2056 shell("ls ./fx/bin")
2059 shell("""./fx/run-test.sh \\
2060 --coreclr-bins \$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration} \\
2061 --mscorlib-bins \$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration} \\
2062 --corefx-tests \$(pwd)/fx/bin/tests/${osGroup}.AnyCPU.${configuration} \\
2063 --corefx-native-bins \$(pwd)/fx/bin/${osGroup}.${architecture}.${configuration} \\
2064 --configurationGroup Release""")
2067 // Run coreclr tests w/ workstation GC
2068 shell("""./clr/tests/runtest.sh \\
2069 --testRootDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2070 --testNativeBinDir=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2071 --coreClrBinDir=\"\$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2072 --mscorlibDir=\"\$(pwd)/clr/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2073 --coreFxBinDir=\"\$(pwd)/fx/bin/${osGroup}.AnyCPU.Release;\$(pwd)/fx/bin/Unix.AnyCPU.Release;\$(pwd)/fx/bin/AnyOS.AnyCPU.Release\" \\
2074 --coreFxNativeBinDir=\"\$(pwd)/fx/bin/${osGroup}.${architecture}.Release\" \\
2077 // Run coreclr GC tests w/ server GC enabled & produce coverage reports
2078 shell("""./clr/tests/runtest.sh \\
2079 --testRootDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}/GC\" \\
2080 --testNativeBinDir=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2081 --coreOverlayDir=\"\$(pwd)/clr/bin/tests/Windows_NT.${architecture}.${configuration}/Tests/coreoverlay\" \\
2082 --crossgen --useServerGC --coreclr-coverage \\
2083 --coreclr-objs=\"\$(pwd)/clr/bin/obj/${osGroup}.${architecture}.${configuration}\" \\
2084 --coreclr-src=\"\$(pwd)/clr/src\" \\
2085 --coverage-output-dir=\"\${WORKSPACE}/coverage\" """)
2090 def corefxFolder = Utilities.getFolderName('dotnet/corefx') + '/' + Utilities.getFolderName(branch)
2092 // Corefx components. We now have full stack builds on all distros we test here, so we can copy straight from CoreFX jobs.
2093 def osJobName = (os == 'Ubuntu') ? 'ubuntu14.04' : os.toLowerCase()
2094 copyArtifacts("${corefxFolder}/${osJobName}_release") {
2095 includePatterns('bin/build.tar.gz')
2097 latestSuccessful(true)
2101 // Unpack the corefx binaries
2102 shell("tar -xf ./bin/build.tar.gz")
2104 // Unzip the tests first. Exit with 0
2105 shell("unzip -q -o ./bin/tests/tests.zip -d ./bin/tests/Windows_NT.${architecture}.${configuration} || exit 0")
2107 // Execute the tests
2108 // If we are running a stress mode, we'll set those variables first
2110 if (Constants.jitStressModeScenarios.containsKey(scenario)) {
2111 def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
2112 def createScriptCmds = genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], scriptFileName)
2113 if (createScriptCmds != "") {
2114 shell("${createScriptCmds}")
2115 testEnvOpt = "--test-env=" + scriptFileName
2119 if (isGCStressRelatedTesting(scenario)) {
2120 shell('./init-tools.sh')
2123 shell("""./tests/runtest.sh \\
2124 --testRootDir=\"\${WORKSPACE}/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
2125 --testNativeBinDir=\"\${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
2126 --coreClrBinDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2127 --mscorlibDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
2128 --coreFxBinDir=\"\${WORKSPACE}/bin/${osGroup}.AnyCPU.Release;\${WORKSPACE}/bin/Unix.AnyCPU.Release;\${WORKSPACE}/bin/AnyOS.AnyCPU.Release\" \\
2129 --coreFxNativeBinDir=\"\${WORKSPACE}/bin/${osGroup}.${architecture}.Release\" \\
2130 ${testEnvOpt} ${serverGCString} ${gcstressStr} ${crossgenStr} ${runcrossgentestsStr} ${runjitstressStr} ${runjitstressregsStr} ${runjitmioptsStr} ${runjitforcerelocsStr} ${sequentialString} ${playlistString}""")
2135 if (scenario == 'coverage') {
2136 // Publish coverage reports
2137 Utilities.addHtmlPublisher(newJob, '${WORKSPACE}/coverage', 'Code Coverage Report', 'coreclr.html')
2138 addEmailPublisher(newJob, 'clrcoverage@microsoft.com')
2141 setMachineAffinity(newJob, os, architecture)
2142 Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
2143 // Set timeouts to 240.
2144 setTestJobTimeOut(newJob, scenario)
2145 Utilities.addXUnitDotNETResults(newJob, '**/coreclrtests.xml')
2147 // Create a build flow to join together the build and tests required to run this
2149 // Windows CoreCLR build and Linux CoreCLR build (in parallel) ->
2150 // Linux CoreCLR test
2151 def flowJobName = getJobName(configuration, architecture, os, scenario, false) + "_flow"
2152 def fullTestJobName = projectFolder + '/' + newJob.name
2153 // Add a reference to the input jobs for report purposes
2154 JobReport.Report.addReference(inputCoreCLRBuildName)
2155 JobReport.Report.addReference(inputWindowTestsBuildName)
2156 JobReport.Report.addReference(fullTestJobName)
2157 def newFlowJob = buildFlowJob(Utilities.getFullJobName(project, flowJobName, isPR)) {
2159 // Build the input jobs in parallel
2161 { coreclrBuildJob = build(params, '${inputCoreCLRBuildName}') },
2162 { windowsBuildJob = build(params, '${inputWindowTestsBuildName}') }
2165 // And then build the test build
2166 build(params + [CORECLR_BUILD: coreclrBuildJob.build.number,
2167 CORECLR_WINDOWS_BUILD: windowsBuildJob.build.number], '${fullTestJobName}')
2171 setMachineAffinity(newFlowJob, os, architecture)
2172 Utilities.standardJobSetup(newFlowJob, project, isPR, "*/${branch}")
2173 addTriggers(newFlowJob, branch, isPR, architecture, os, configuration, scenario, true, false, false)
2180 JobReport.Report.generateJobReport(out)