[Asterisk-code-review] CI: Pass work directory to runTestsuite (asterisk[13])

Jenkins2 asteriskteam at digium.com
Sat Nov 17 13:32:39 CST 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/10672 )

Change subject: CI:  Pass work directory to runTestsuite
......................................................................

CI:  Pass work directory to runTestsuite

The testsuite can now use a user-specified work directory for
all it's temp files.  This allows the docker containers to use
a tmpfs backed directory for the temp files instead of it's
own write-layer image.

* runTestsuite.sh now accepts a --work-dir command line argument
  that gets exported as AST_WORK_DIR before running the testsuite.

* gates.jenkinsfile now specifies --work-dir to be
  <testsuite_dir>/astroot.

Since the Asterisk CI docker hosts now mount /srv/jenkins/workspace
on a tmpfs, asterisk should be compiled and the testsuite run all in
memory.

Change-Id: If5ee905a15821296c355bb84cda38950ad8edc45
---
M tests/CI/gates.jenkinsfile
M tests/CI/runTestsuite.sh
2 files changed, 7 insertions(+), 2 deletions(-)

Approvals:
  Jenkins2: Looks good to me, approved; Approved for Submit



diff --git a/tests/CI/gates.jenkinsfile b/tests/CI/gates.jenkinsfile
index 9835647..7be5768 100644
--- a/tests/CI/gates.jenkinsfile
+++ b/tests/CI/gates.jenkinsfile
@@ -197,7 +197,7 @@
 										]
 									}
 
-									sh "sudo tests/CI/runTestsuite.sh --testsuite-dir='${groupDir}' --testsuite-command='${groupTestcmd}'"
+									sh "sudo tests/CI/runTestsuite.sh --work-dir='${groupDir}/astroot' --testsuite-dir='${groupDir}' --testsuite-command='${groupTestcmd}'"
 
 									archiveArtifacts allowEmptyArchive: true, defaultExcludes: false, fingerprint: true,
 										artifacts: "${groupDir}/asterisk-test-suite-report.xml, ${groupDir}/logs/**, ${groupDir}/core*.txt"
diff --git a/tests/CI/runTestsuite.sh b/tests/CI/runTestsuite.sh
index 9ee7718..466991a 100755
--- a/tests/CI/runTestsuite.sh
+++ b/tests/CI/runTestsuite.sh
@@ -5,6 +5,11 @@
 source $CIDIR/ci.functions
 ASTETCDIR=$DESTDIR/etc/asterisk
 
+if [ x"$WORK_DIR" != x ] ; then
+	export AST_WORK_DIR="$(readlink -f $WORK_DIR)"
+	mkdir -p "$AST_WORK_DIR"
+fi
+
 pushd $TESTSUITE_DIR
 
 ./cleanup-test-remnants.sh
@@ -14,7 +19,7 @@
 fi
 
 export PYTHONPATH=./lib/python/
-echo "Running tests ${TESTSUITE_COMMAND}"
+echo "Running tests ${TESTSUITE_COMMAND} ${AST_WORK_DIR:+with work directory ${AST_WORK_DIR}}"
 ./runtests.py --cleanup --timeout=${TEST_TIMEOUT} ${TESTSUITE_COMMAND} | contrib/scripts/pretty_print --no-color --no-timer --term-width=120 --show-errors || :
 
 if [ $REALTIME -eq 1 ] ; then

-- 
To view, visit https://gerrit.asterisk.org/10672
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: If5ee905a15821296c355bb84cda38950ad8edc45
Gerrit-Change-Number: 10672
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181117/3a164015/attachment-0001.html>


More information about the asterisk-code-review mailing list