<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/12708">View Change</a></p><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>Change-Id: Icd3158c66acf4d72c8bcd5948e8b3fca398aac4a<br>---<br>M CI/gates.jenkinsfile<br>M CI/unittests.jenkinsfile<br>2 files changed, 32 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/08/12708/1</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..7d593a4 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>diff --git a/CI/unittests.jenkinsfile b/CI/unittests.jenkinsfile</span><br><span>index 943c1d0..595abeb 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></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/12708">change 12708</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/+/12708"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: Icd3158c66acf4d72c8bcd5948e8b3fca398aac4a </div>
<div style="display:none"> Gerrit-Change-Number: 12708 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>