May crash with some examples, such as actor-create..
#!/usr/bin/env tesh
-$ python3 ${srcdir:=.}/actor-create.py
+$ python3 ${PYTHON_TOOL_OPTIONS:=} ${srcdir:=.}/actor-create.py
> [Tremblay:sender1:(2) 0.000000] [python/INFO] Hello s4u, I have something to send
> [Jupiter:sender2:(3) 0.000000] [python/INFO] Hello s4u, I have something to send
> [Fafard:sender:(4) 0.000000] [python/INFO] Hello s4u, I have something to send
p Testing the process daemonization feature
-$ python3 ${bindir:=.}/actor-daemon.py ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ python3 ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/actor-daemon.py ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
> [ 0.000000] (worker@Boivin) Let's do some work (for 10 sec on Boivin).
> [ 0.000000] (daemon@Tremblay) Hello from the infinite loop
> [ 3.000000] (daemon@Tremblay) Hello from the infinite loop
-$ python3 ${bindir:=.}/actor-join.py ${platfdir}/small_platform.xml
+$ python3 ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/actor-join.py ${platfdir}/small_platform.xml
> [Tremblay:master:(1) 0.000000] [python/INFO] Start sleeper
> [Tremblay:sleeper from master:(2) 0.000000] [python/INFO] Sleeper started
> [Tremblay:master:(1) 0.000000] [python/INFO] Join the sleeper (timeout 2)
#!/usr/bin/env tesh
-$ python3 ${bindir:=.}/actor-kill.py ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ python3 ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/actor-kill.py ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
> [ 0.000000] (killer@Tremblay) Hello!
> [ 0.000000] (victim A@Fafard) Hello!
> [ 0.000000] (victim A@Fafard) Suspending myself
#!/usr/bin/env tesh
-$ python3 ${bindir:=.}/actor-lifetime.py ${platfdir}/cluster_backbone.xml actor-lifetime_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ python3 ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/actor-lifetime.py ${platfdir}/cluster_backbone.xml actor-lifetime_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (1:sleeper@node-0.simgrid.org) Hello! I go to sleep.
> [ 0.000000] (2:sleeper@node-1.simgrid.org) Hello! I go to sleep.
> [ 2.000000] (3:sleeper@node-0.simgrid.org) Hello! I go to sleep.
p Testing the actor migration feature
-$ python3 ${bindir:=.}/actor-migrate.py ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ python3 ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/actor-migrate.py ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
> [ 0.000000] (worker@Fafard) Let's move to Boivin to execute 1177.14 Mflops (5sec on Boivin and 5sec on Jacquelin)
> [ 5.000000] (monitor@Boivin) After 5 seconds, move the process to Jacquelin
> [ 10.000000] (worker@Jacquelin) I wake up on Jacquelin. Let's suspend a bit
p Testing the suspend/resume feature of SimGrid
! output sort 19
-$ python3 ${bindir:=.}/actor-suspend.py ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ python3 ${PYTHON_TOOL_OPTIONS:=} ${bindir:=.}/actor-suspend.py ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
> [ 0.000000] (dream_master@Boivin) Let's create a lazy guy.
> [ 0.000000] (Lazy@Boivin) Nobody's watching me ? Let's go to sleep.
> [ 0.000000] (dream_master@Boivin) Let's wait a little bit...
#!/usr/bin/env tesh
-$ python3 ${srcdir:=.}/actor-yield.py ${platfdir}/small_platform_fatpipe.xml ${srcdir:=.}/../../s4u/actor-yield/s4u-actor-yield_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ python3 ${PYTHON_TOOL_OPTIONS:=} ${srcdir:=.}/actor-yield.py ${platfdir}/small_platform_fatpipe.xml ${srcdir:=.}/../../s4u/actor-yield/s4u-actor-yield_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (1:yielder@Tremblay) I yielded 10 times. Goodbye now!
> [ 0.000000] (2:yielder@Ruby) I yielded 15 times. Goodbye now!
#!/usr/bin/env tesh
p Start remote processes
-$ python3 ${srcdir}/exec-basic.py ${platfdir}/small_platform.xml
+$ python3 ${PYTHON_TOOL_OPTIONS:=} ${srcdir}/exec-basic.py ${platfdir}/small_platform.xml
> [Tremblay:privileged:(2) 0.001500] [python/INFO] Done.
> [Tremblay:executor:(1) 0.002000] [python/INFO] Done.
cd $BUILDFOLDER
rm -rf java_cov*
+rm -rf jacoco_cov*
+rm -rf python_cov*
rm -rf xml_coverage.xml
ctest -D ExperimentalStart || true
JACOCO_PATH="/usr/local/share/jacoco"
export JAVA_TOOL_OPTIONS="-javaagent:${JACOCO_PATH}/lib/jacocoagent.jar"
+export PYTHON_TOOL_OPTIONS="/usr/bin/python3-coverage run --branch"
+
ctest --no-compress-output -D ExperimentalTest -j$NUMPROC || true
ctest -D ExperimentalCoverage || true
#convert jacoco reports in xml ones
ant -f $WORKSPACE/tools/jenkins/jacoco.xml -Dexamplesrcdir=$WORKSPACE -Dbuilddir=$BUILDFOLDER/${sourcepath} -Djarfile=$BUILDFOLDER/simgrid.jar -Djacocodir=${JACOCO_PATH}/lib
#convert jacoco xml reports in cobertura xml reports
- cover2cover.py $BUILDFOLDER/${sourcepath}/report.xml .. ../src/bindings/java src/bindings/java > $WORKSPACE/java_coverage_${i}.xml
+ cover2cover.py $BUILDFOLDER/${sourcepath}/report.xml .. ../src/bindings/java src/bindings/java > $BUILDFOLDER/java_coverage_${i}.xml
+ #save jacoco xml report as sonar only allows it
+ mv $BUILDFOLDER/${sourcepath}/report.xml $BUILDFOLDER/jacoco_coverage_${i}.xml
+ i=$((i + 1))
+ done
+
+ cd $WORKSPACE
+
+ files=$( find . -size +1c -name ".coverage" )
+ i=0
+ for file in $files
+ do
+ sourcepath=$( dirname $file )
+ #convert python coverage reports in xml ones
+ cd $sourcepath
+ /usr/bin/python3-coverage xml -i -o $BUILDFOLDER/python_coverage_${i}.xml
+ cd $WORKSPACE
i=$((i + 1))
done
- cd $WORKSPACE
#convert all gcov reports to xml cobertura reports
- gcovr -r . --xml-pretty -e teshsuite -u -o $WORKSPACE/xml_coverage.xml
+ gcovr -r . --xml-pretty -e teshsuite -u -o $BUILDFOLDER/xml_coverage.xml
xsltproc $WORKSPACE/tools/jenkins/ctest2junit.xsl build/Testing/$( head -n 1 < build/Testing/TAG )/Test.xml > CTestResults_memcheck.xml
#generate sloccount report
#upload files to codacy. CODACY_PROJECT_TOKEN must be setup !
if ! [ -z $CODACY_PROJECT_TOKEN ]
then
- for report in $WORKSPACE/java_cov*
+ for report in $BUILDFOLDER/java_cov*
do
if [ ! -e "$report" ]; then continue; fi
java -jar /home/ci/codacy-coverage-reporter-*-assembly.jar report -l Java -r $report --partial
done
java -jar /home/ci/codacy-coverage-reporter-*-assembly.jar final
- java -jar /home/ci/codacy-coverage-reporter-*-assembly.jar report -l C -f -r $WORKSPACE/xml_coverage.xml
- java -jar /home/ci/codacy-coverage-reporter-*-assembly.jar report -l CPP -f -r $WORKSPACE/xml_coverage.xml
+ for report in $BUILDFOLDER/python_cov*
+ do
+ if [ ! -e "$report" ]; then continue; fi
+ java -jar /home/ci/codacy-coverage-reporter-*-assembly.jar report -l Python -r $report --partial
+ done
+ java -jar /home/ci/codacy-coverage-reporter-*-assembly.jar final
+ java -jar /home/ci/codacy-coverage-reporter-*-assembly.jar report -l C -f -r $BUILDFOLDER/xml_coverage.xml
+ java -jar /home/ci/codacy-coverage-reporter-*-assembly.jar report -l CPP -f -r $BUILDFOLDER/xml_coverage.xml
fi
fi