Hi!
I’m some problems with the pipelines output. My pipeline has four steps, a their is to test de php code with grumhp. I do the image pull of the ubuntu on the docker with composer installed and make the test in the other step. The tests showed failures on the code but the step end with success. This pipeline is integrate with Gitlab and I need to block the merge button.
The code step bellow:
stages {
stage('Pre Build') {
steps {
gitlabCommitStatus(name: 'Pre Build') {
sh '''
echo 'Setup Docker'
if [ ! "$(docker ps -q -f name=company-jenkins)" ]; then
if [ "$(docker ps -aq -f status=exited -f name=company-jenkins)" ]; then
docker rm company-jenkins
fi
docker run -d --name company-jenkins -v $WORKSPACE:/var/www/html company/magento2-php:8.1.4-ubuntu
fi
'''
}
}
}
stage('Run Tests') {
steps {
gitlabCommitStatus(name: 'Run Tests') {
sh '''
chmod 777 -R .pipelines/ && .pipelines/scripts/script-ci.sh
'''
}
}
}
stage('Sonar') {
steps {
gitlabCommitStatus(name: 'Sonar') {
script {
def scannerHome = tool 'SonarScanner3.2.0.1227';
withSonarQubeEnv('SonarDefault') {
sh "${scannerHome}/bin/sonar-scanner"
sh "cat .scannerwork/report-task.txt"
}
}
}
}
The error:
phpunit
PHPUnit 9.5.25 #StandWithUkraine
… 63 / 377 ( 16%)
… 126 / 377 ( 33%)
… 189 / 377 ( 50%)
… 252 / 377 ( 66%)
…E.EE… 315 / 377 ( 83%)
… 377 / 377 (100%)
Time: 00:03.658, Memory: 66.00 MB
There were 3 errors:
Step output
[Pipeline] }
[Pipeline] // gitlabCommitStatus
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // gitlabBuilds
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS