<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/9447">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Jenkins2: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">CI: Add weekly REF_DEBUG testsuite run<br><br>Change-Id: I5b581d0a0d1d1bb9b38961d40b112fb448355037<br>---<br>M tests/CI/buildAsterisk.sh<br>A tests/CI/ref_debug.jenkinsfile<br>A tests/CI/ref_debugTestGroups.json<br>3 files changed, 163 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/tests/CI/buildAsterisk.sh b/tests/CI/buildAsterisk.sh</span><br><span>index 85f347c..9840d85 100755</span><br><span>--- a/tests/CI/buildAsterisk.sh</span><br><span>+++ b/tests/CI/buildAsterisk.sh</span><br><span>@@ -1,6 +1,7 @@</span><br><span> #!/usr/bin/env bash</span><br><span> </span><br><span> CIDIR=$(dirname $(readlink -fn $0))</span><br><span style="color: hsl(120, 100%, 40%);">+REF_DEBUG=0</span><br><span> source $CIDIR/ci.functions</span><br><span> </span><br><span> gen_cats() {</span><br><span>@@ -70,6 +71,9 @@</span><br><span> </span><br><span> runner menuselect/menuselect `gen_mods enable DONT_OPTIMIZE BETTER_BACKTRACES MALLOC_DEBUG DO_CRASH TEST_FRAMEWORK` menuselect.makeopts</span><br><span> runner menuselect/menuselect `gen_mods disable COMPILE_DOUBLE BUILD_NATIVE` menuselect.makeopts</span><br><span style="color: hsl(120, 100%, 40%);">+if [ $REF_DEBUG -eq 1 ] ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ runner menuselect/menuselect --enable REF_DEBUG menuselect.makeopts</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span> </span><br><span> cat_enables="MENUSELECT_BRIDGES MENUSELECT_CEL MENUSELECT_CDR"</span><br><span> cat_enables+=" MENUSELECT_CHANNELS MENUSELECT_CODECS MENUSELECT_FORMATS MENUSELECT_FUNCS"</span><br><span>diff --git a/tests/CI/ref_debug.jenkinsfile b/tests/CI/ref_debug.jenkinsfile</span><br><span>new file mode 100644</span><br><span>index 0000000..45a1c6a</span><br><span>--- /dev/null</span><br><span>+++ b/tests/CI/ref_debug.jenkinsfile</span><br><span>@@ -0,0 +1,127 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * This pipeline is the "template" for the Asterisk REF_DEBUG Tests multi-branch</span><br><span style="color: hsl(120, 100%, 40%);">+ * parent job. Jenkins will automatically scan the branches in the "asterisk"</span><br><span style="color: hsl(120, 100%, 40%);">+ * or "Security-asterisk" projects in Gerrit and automatically create a branch-</span><br><span style="color: hsl(120, 100%, 40%);">+ * specific job for each branch it finds this file in.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This file starts as a declarative pipeline because with a declarative</span><br><span style="color: hsl(120, 100%, 40%);">+ * pipeline, you can define the trigger in the pipeline file. This keeps</span><br><span style="color: hsl(120, 100%, 40%);">+ * everything in one place. We transition to scripted pipeline later on because</span><br><span style="color: hsl(120, 100%, 40%);">+ * we need to dynamically determine which docker image we're going to use and</span><br><span style="color: hsl(120, 100%, 40%);">+ * you can't do that in a delcarative pipeline.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+pipeline {</span><br><span style="color: hsl(120, 100%, 40%);">+ triggers {</span><br><span style="color: hsl(120, 100%, 40%);">+ cron 'H H(0-4) * * 0'</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ agent {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* All of the stages need to be performed on a docker host */</span><br><span style="color: hsl(120, 100%, 40%);">+ label "swdev-docker"</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ stages {</span><br><span style="color: hsl(120, 100%, 40%);">+ stage ("->") {</span><br><span style="color: hsl(120, 100%, 40%);">+ steps {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Here's where we switch to scripted pipeline */</span><br><span style="color: hsl(120, 100%, 40%);">+ script {</span><br><span style="color: hsl(120, 100%, 40%);">+ stage ("Checkout") {</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "sudo chown -R jenkins:users ." </span><br><span style="color: hsl(120, 100%, 40%);">+ sh "printenv | sort"</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "sudo tests/CI/setupJenkinsEnvironment.sh"</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ def images = env.DOCKER_IMAGES.split(' ')</span><br><span style="color: hsl(120, 100%, 40%);">+ def r = currentBuild.startTimeInMillis % images.length</span><br><span style="color: hsl(120, 100%, 40%);">+ def ri = images[(int)r]</span><br><span style="color: hsl(120, 100%, 40%);">+ def randomImage = env.DOCKER_REGISTRY + "/" + ri</span><br><span style="color: hsl(120, 100%, 40%);">+ def dockerOptions = "--ulimit core=0 --ulimit nofile=10240 " +</span><br><span style="color: hsl(120, 100%, 40%);">+ " -v /srv/jenkins:/srv/jenkins:rw -v /srv/cache:/srv/cache:rw " +</span><br><span style="color: hsl(120, 100%, 40%);">+ " --entrypoint=''"</span><br><span style="color: hsl(120, 100%, 40%);">+ def bt = env.BUILD_TAG.replaceAll(/[^a-zA-Z0-9_.-]/, '-')</span><br><span style="color: hsl(120, 100%, 40%);">+ def outputdir = "tests/CI/output/Testsuite"</span><br><span style="color: hsl(120, 100%, 40%);">+ def img = docker.image(randomImage)</span><br><span style="color: hsl(120, 100%, 40%);">+ img.pull()</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ stage ("Build") {</span><br><span style="color: hsl(120, 100%, 40%);">+ img.inside(dockerOptions + " --name ${bt}-build") {</span><br><span style="color: hsl(120, 100%, 40%);">+ echo 'Building..'</span><br><span style="color: hsl(120, 100%, 40%);">+ env.CCACHE_DIR = "/srv/cache/ccache"</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "./tests/CI/buildAsterisk.sh --ref-debug --output-dir=${outputdir} --cache-dir=/srv/cache"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ archiveArtifacts allowEmptyArchive: true, defaultExcludes: false, fingerprint: false,</span><br><span style="color: hsl(120, 100%, 40%);">+ artifacts: "${outputdir}/*"</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ def testGroups = readJSON file: "tests/CI/ref_debugTestGroups.json"</span><br><span style="color: hsl(120, 100%, 40%);">+ def parallelTasks = [ : ]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ for (def testGroup in testGroups) {</span><br><span style="color: hsl(120, 100%, 40%);">+ /*</span><br><span style="color: hsl(120, 100%, 40%);">+ * Because each task is a Groovy closure, we need to</span><br><span style="color: hsl(120, 100%, 40%);">+ * keep local references to some variables.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+ def groupName = testGroup.name</span><br><span style="color: hsl(120, 100%, 40%);">+ def groupDir = testGroup.dir</span><br><span style="color: hsl(120, 100%, 40%);">+ def groupTestcmd = testGroup.testcmd</span><br><span style="color: hsl(120, 100%, 40%);">+ def testsuiteUrl = env.GIT_URL.replaceAll(/\/[^\/]+$/, "/\$1testsuite")</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ parallelTasks[groupName] = {</span><br><span style="color: hsl(120, 100%, 40%);">+ stage (groupName) {</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ img.inside("${dockerOptions} --name ${bt}-${groupName}") {</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ lock("${JOB_NAME}.${NODE_NAME}.installer") {</span><br><span style="color: hsl(120, 100%, 40%);">+ sh 'sudo ./tests/CI/installAsterisk.sh --user-group=jenkins:users'</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "sudo rm -rf ${groupDir} || : "</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ checkout scm: [$class: 'GitSCM',</span><br><span style="color: hsl(120, 100%, 40%);">+ branches: [[name: "${BRANCH_NAME}"]],</span><br><span style="color: hsl(120, 100%, 40%);">+ extensions: [</span><br><span style="color: hsl(120, 100%, 40%);">+ [$class: 'RelativeTargetDirectory', relativeTargetDir: groupDir],</span><br><span style="color: hsl(120, 100%, 40%);">+ [$class: 'CloneOption',</span><br><span style="color: hsl(120, 100%, 40%);">+ noTags: true,</span><br><span style="color: hsl(120, 100%, 40%);">+ depth: 10,</span><br><span style="color: hsl(120, 100%, 40%);">+ honorRefspec: true,</span><br><span style="color: hsl(120, 100%, 40%);">+ shallow: true</span><br><span style="color: hsl(120, 100%, 40%);">+ ],</span><br><span style="color: hsl(120, 100%, 40%);">+ ],</span><br><span style="color: hsl(120, 100%, 40%);">+ userRemoteConfigs: [[url: testsuiteUrl]]</span><br><span style="color: hsl(120, 100%, 40%);">+ ]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "sudo tests/CI/runTestsuite.sh --testsuite-dir='${groupDir}' --test-command='${groupTestcmd}'"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ archiveArtifacts allowEmptyArchive: true, defaultExcludes: false, fingerprint: true,</span><br><span style="color: hsl(120, 100%, 40%);">+ artifacts: "${groupDir}/asterisk-test-suite-report.xml, ${groupDir}/logs/**, ${groupDir}/core*.txt"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ junit testResults: "${groupDir}/asterisk-test-suite-report.xml",</span><br><span style="color: hsl(120, 100%, 40%);">+ healthScaleFactor: 1.0,</span><br><span style="color: hsl(120, 100%, 40%);">+ keepLongStdio: true</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ parallel parallelTasks</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ post {</span><br><span style="color: hsl(120, 100%, 40%);">+ cleanup {</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "sudo make distclean 2&>/dev/null || : "</span><br><span style="color: hsl(120, 100%, 40%);">+ sh "sudo rm -rf tests/CI/output 2&>/dev/null || : "</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ success {</span><br><span style="color: hsl(120, 100%, 40%);">+ echo "Reporting ${currentBuild.currentResult} Passed"</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ failure {</span><br><span style="color: hsl(120, 100%, 40%);">+ echo "Reporting ${currentBuild.currentResult}: Failed: Fatal Error"</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ unstable {</span><br><span style="color: hsl(120, 100%, 40%);">+ echo "Reporting ${currentBuild.currentResult}: Failed: Tests Failed"</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span>diff --git a/tests/CI/ref_debugTestGroups.json b/tests/CI/ref_debugTestGroups.json</span><br><span>new file mode 100644</span><br><span>index 0000000..b8c8e9b</span><br><span>--- /dev/null</span><br><span>+++ b/tests/CI/ref_debugTestGroups.json</span><br><span>@@ -0,0 +1,32 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ "name": "ari ",</span><br><span style="color: hsl(120, 100%, 40%);">+ "dir": "tests/CI/output/ari",</span><br><span style="color: hsl(120, 100%, 40%);">+ "testcmd": "-t tests/rest_api/"</span><br><span style="color: hsl(120, 100%, 40%);">+ },</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ "name": "pjs ",</span><br><span style="color: hsl(120, 100%, 40%);">+ "dir": "tests/CI/output/pjsip",</span><br><span style="color: hsl(120, 100%, 40%);">+ "testcmd": "-t tests/channels/pjsip"</span><br><span style="color: hsl(120, 100%, 40%);">+ },</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ "name": "sip ",</span><br><span style="color: hsl(120, 100%, 40%);">+ "dir": "tests/CI/output/sip",</span><br><span style="color: hsl(120, 100%, 40%);">+ "testcmd": "-t tests/channels/SIP"</span><br><span style="color: hsl(120, 100%, 40%);">+ },</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ "name": "iax ",</span><br><span style="color: hsl(120, 100%, 40%);">+ "dir": "tests/CI/output/iax2_local",</span><br><span style="color: hsl(120, 100%, 40%);">+ "testcmd": " -t tests/channels/iax2 -t tests/channels/local"</span><br><span style="color: hsl(120, 100%, 40%);">+ },</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ "name": "apps",</span><br><span style="color: hsl(120, 100%, 40%);">+ "dir": "tests/CI/output/agi-apps",</span><br><span style="color: hsl(120, 100%, 40%);">+ "testcmd": " -t tests/agi -t tests/apps -t blind-transfer-parkingtimeout"</span><br><span style="color: hsl(120, 100%, 40%);">+ },</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ "name": "othr",</span><br><span style="color: hsl(120, 100%, 40%);">+ "dir": "tests/CI/output/other",</span><br><span style="color: hsl(120, 100%, 40%);">+ "testcmd": " -T tests/(apps|agi|blind-transfer-parkingtimeout|rest_api|channels|realtime|example|skeleton_test|remote-test)"</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+]</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9447">change 9447</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/9447"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I5b581d0a0d1d1bb9b38961d40b112fb448355037 </div>
<div style="display:none"> Gerrit-Change-Number: 9447 </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-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>