]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
CI: Pass work directory to runTestsuite
authorGeorge Joseph <gjoseph@digium.com>
Sat, 17 Nov 2018 19:07:32 +0000 (12:07 -0700)
committerGeorge Joseph <gjoseph@digium.com>
Sat, 17 Nov 2018 19:07:32 +0000 (12:07 -0700)
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

tests/CI/gates.jenkinsfile
tests/CI/runTestsuite.sh

index 983564760f322029fafef4d32f19eb0c71c80657..7be576861ba1638943cca7f1be094654baa9b06a 100644 (file)
@@ -197,7 +197,7 @@ pipeline {
                                                                                ]
                                                                        }
 
-                                                                       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"
index 9ee7718338a8cc6009086477aca57443d349338c..466991a44c53f9caef6615db8c06e770472828f0 100755 (executable)
@@ -5,6 +5,11 @@ TEST_TIMEOUT=600
 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 @@ if [ $REALTIME -eq 1 ] ; then
 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