mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
ci 2 new options: coverture + run only one test 💚
try to have coverture option
This commit is contained in:
@@ -6,6 +6,8 @@ cd test
|
||||
export DEBUG_UNIT_TEST=0
|
||||
RUN_NONREG_TESTS=0
|
||||
|
||||
#USAGE ${debugMode} ${runNonRegOQLTests} "${coverture}" "${testFile}"
|
||||
|
||||
if [ $# -ge 1 -a "x$1" == "xtrue" ]
|
||||
then
|
||||
export DEBUG_UNIT_TEST=1
|
||||
@@ -13,10 +15,27 @@ else
|
||||
export DEBUG_UNIT_TEST=0
|
||||
fi
|
||||
|
||||
set -x
|
||||
OPTION=""
|
||||
if [ $# -ge 3 -a "x$3" == "xtrue" ]
|
||||
then
|
||||
##coverture
|
||||
OPTION="-dxdebug.coverage_enable=1 --coverage-clover ../var/test/coverage.xml"
|
||||
fi
|
||||
|
||||
TESTFILE="$4"
|
||||
if [ "x$TESTFILE" != "x" ]
|
||||
then
|
||||
# shellcheck disable=SC2001
|
||||
TESTFILE=$(echo "$TESTFILE" | sed 's|test/||1')
|
||||
php vendor/bin/phpunit --log-junit ../var/test/phpunit-log.junit.xml $OPTION $TESTFILE --teamcity
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $# -ge 2 -a "x$2" == "xtrue" ]
|
||||
then
|
||||
php vendor/bin/phpunit --log-junit ../var/test/phpunit-log.junit.xml --teamcity
|
||||
php vendor/bin/phpunit --log-junit ../var/test/phpunit-log.junit.xml $OPTION --teamcity
|
||||
else
|
||||
#echo php vendor/bin/phpunit --log-junit ../var/test/phpunit-log.junit.xml --teamcity
|
||||
php vendor/bin/phpunit --log-junit ../var/test/phpunit-log.junit.xml --exclude-group OQL --teamcity
|
||||
php vendor/bin/phpunit --log-junit ../var/test/phpunit-log.junit.xml $OPTION --exclude-group OQL --teamcity
|
||||
fi
|
||||
|
||||
5
Jenkinsfile
vendored
5
Jenkinsfile
vendored
@@ -2,6 +2,8 @@ pipeline {
|
||||
agent any
|
||||
parameters {
|
||||
booleanParam(name: 'debugMode', defaultValue: 'false', description: 'Debug mode?')
|
||||
string(name: 'testFile', defaultValue: '', description: 'Provide test file to execute. Example: test/core/LogAPITest.php')
|
||||
booleanParam(name: 'coverture', defaultValue: 'false', description: 'Test coverture?')
|
||||
booleanParam(name: 'runNonRegOQLTests', defaultValue: 'false', description: 'Do You want to run legacy OQL regression tests?')
|
||||
}
|
||||
stages {
|
||||
@@ -40,7 +42,7 @@ pipeline {
|
||||
parallel {
|
||||
stage('phpunit') {
|
||||
steps {
|
||||
sh './.jenkins/bin/tests/phpunit.sh ${debugMode} ${runNonRegOQLTests}'
|
||||
sh './.jenkins/bin/tests/phpunit.sh ${debugMode} ${runNonRegOQLTests} "${coverture}" "${testFile}"'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,6 +52,7 @@ pipeline {
|
||||
|
||||
post {
|
||||
always {
|
||||
archiveArtifacts allowEmptyArchive:true, excludes: '.gitkeep', artifacts: 'var/test/*.xml'
|
||||
junit 'var/test/phpunit-log.junit.xml'
|
||||
}
|
||||
failure {
|
||||
|
||||
Reference in New Issue
Block a user