<p>Friendly Automation <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/12712">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">CI: Add "throttle" label and "skip_gate" capability<br><br>To make throttling by label fully active, the "throttle" option<br>has to be specified with a specific label.<br><br>You can now specify "skip_gate" in the Gerrit comments when you<br>do a +2 code review to tell Jenkins not to actually run the<br>gate. You'd do this if you plan to manually merge the change.<br><br>Also updated the "printenv" debug output to better sort multi-line<br>comments.<br><br>Change-Id: Icd3158c66acf4d72c8bcd5948e8b3fca398aac4a<br>---<br>M CI/gates.jenkinsfile<br>M CI/unittests.jenkinsfile<br>2 files changed, 34 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/CI/gates.jenkinsfile b/CI/gates.jenkinsfile</span><br><span>index 26e30de..80dc390 100644</span><br><span>--- a/CI/gates.jenkinsfile</span><br><span>+++ b/CI/gates.jenkinsfile</span><br><span>@@ -10,7 +10,22 @@</span><br><span> * we need to dynamically determine which docker image we're going to use and</span><br><span> * you can't do that in a delcarative pipeline.</span><br><span> */</span><br><span style="color: hsl(120, 100%, 40%);">+def timeoutTime = 60</span><br><span style="color: hsl(120, 100%, 40%);">+def timeoutUnits = 'MINUTES'</span><br><span style="color: hsl(120, 100%, 40%);">+if (env.TIMEOUT_GATES) {</span><br><span style="color: hsl(120, 100%, 40%);">+ def _timeout = env.TIMEOUT_GATES.split()</span><br><span style="color: hsl(120, 100%, 40%);">+ timeoutTime = _timeout[0].toInteger()</span><br><span style="color: hsl(120, 100%, 40%);">+ timeoutUnits = _timeout[1]</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> pipeline {</span><br><span style="color: hsl(120, 100%, 40%);">+ options {</span><br><span style="color: hsl(120, 100%, 40%);">+ ansiColor('gnome-terminal')</span><br><span style="color: hsl(120, 100%, 40%);">+ throttle(['testsuite-gate'])</span><br><span style="color: hsl(120, 100%, 40%);">+ timestamps()</span><br><span style="color: hsl(120, 100%, 40%);">+ timeout(time: timeoutTime, unit: timeoutUnits)</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> triggers {</span><br><span> /*</span><br><span> * This trigger will match either the "asterisk" or "Security-asterisk"</span><br><span>@@ -56,7 +71,8 @@</span><br><span> */</span><br><span> when {</span><br><span> not { environment name: 'GERRIT_CHANGE_NUMBER', value: '' }</span><br><span style="color: hsl(0, 100%, 40%);">- not { environment name: 'GERRIT_EVENT_ACCOUNT_NAME', value: 'Jenkins2' }</span><br><span style="color: hsl(120, 100%, 40%);">+ /* If "skip_gate" is in the comments, don't run the job */</span><br><span style="color: hsl(120, 100%, 40%);">+ not { expression { env.GERRIT_EVENT_COMMENT_TEXT ==~ /.*skip_gate.*/ } }</span><br><span> }</span><br><span> steps {</span><br><span> script {</span><br><span>@@ -66,7 +82,7 @@</span><br><span> stage ("Checkout") {</span><br><span> sh "sudo chown -R jenkins:users ."</span><br><span> env.GERRIT_PROJECT_URL = env.GIT_URL.replaceAll(/[^\/]+$/, env.GERRIT_PROJECT)</span><br><span style="color: hsl(0, 100%, 40%);">- sh "printenv | sort"</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "printenv -0 | sort -z | tr '\0' '\n'"</span><br><span> </span><br><span> /*</span><br><span> * Jenkins has already automatically checked out the base branch</span><br><span>diff --git a/CI/unittests.jenkinsfile b/CI/unittests.jenkinsfile</span><br><span>index 943c1d0..81ce1ab 100644</span><br><span>--- a/CI/unittests.jenkinsfile</span><br><span>+++ b/CI/unittests.jenkinsfile</span><br><span>@@ -10,7 +10,22 @@</span><br><span> * we need to dynamically determine which docker image we're going to use and</span><br><span> * you can't do that in a delcarative pipeline.</span><br><span> */</span><br><span style="color: hsl(120, 100%, 40%);">+def timeoutTime = 30</span><br><span style="color: hsl(120, 100%, 40%);">+def timeoutUnits = 'MINUTES'</span><br><span style="color: hsl(120, 100%, 40%);">+if (env.TIMEOUT_UNITTESTS) {</span><br><span style="color: hsl(120, 100%, 40%);">+ def _timeout = env.TIMEOUT_UNITTESTS.split()</span><br><span style="color: hsl(120, 100%, 40%);">+ timeoutTime = _timeout[0].toInteger()</span><br><span style="color: hsl(120, 100%, 40%);">+ timeoutUnits = _timeout[1]</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> pipeline {</span><br><span style="color: hsl(120, 100%, 40%);">+ options {</span><br><span style="color: hsl(120, 100%, 40%);">+ ansiColor('gnome-terminal')</span><br><span style="color: hsl(120, 100%, 40%);">+ throttle(['testsuite-check'])</span><br><span style="color: hsl(120, 100%, 40%);">+ timestamps()</span><br><span style="color: hsl(120, 100%, 40%);">+ timeout(time: timeoutTime, unit: timeoutUnits)</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> triggers {</span><br><span> /*</span><br><span> * This trigger will match either the "asterisk" or "Security-asterisk"</span><br><span>@@ -69,7 +84,7 @@</span><br><span> stage ("Checkout") {</span><br><span> sh "sudo chown -R jenkins:users ."</span><br><span> env.GERRIT_PROJECT_URL = env.GIT_URL.replaceAll(/[^\/]+$/, env.GERRIT_PROJECT)</span><br><span style="color: hsl(0, 100%, 40%);">- sh "printenv | sort"</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "printenv -0 | sort -z | tr '\0' '\n'"</span><br><span> </span><br><span> /*</span><br><span> * Jenkins has already automatically checked out the base branch</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/12712">change 12712</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/testsuite/+/12712"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 17 </div>
<div style="display:none"> Gerrit-Change-Id: Icd3158c66acf4d72c8bcd5948e8b3fca398aac4a </div>
<div style="display:none"> Gerrit-Change-Number: 12712 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>