Skip to content

Commit f6975cd

Browse files
committed
request #14637: Remove usage of the Jenkins clover plugin the test pipelines
The plugin is a source of issue [0] which is unlikely to get some attention soon [1]. It also sometimes crash when analyzing the reports which completely fail the pipeline even if all the tests have been passed successfully. The Javascript now uses the modern approach to do code coverage in Jenkins [2]. For the PHP code coverage the situation is less pretty. PHPUnit cannot output a report in a format understood by the Jenkins plugin which means we loose the high level overview. The HTML report is still browsable from the archive and it looks like there is currently some traction to add a format that would be supported by the Jenkins plugin [3] (we can also consider writting a small tool to do the format conversion). [0] jenkinsci/clover-plugin#21 [1] jenkinsci/clover-plugin#21 (comment) [2] https://jenkins.io/blog/2018/08/17/code-coverage-api-plugin-1/ [3] sebastianbergmann/php-code-coverage#734 Change-Id: Ic4915047616a7023515939dd305a23f12f2300cc
1 parent ba4531a commit f6975cd

File tree

4 files changed

+2
-9
lines changed

4 files changed

+2
-9
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ phpunit-ci-run:
142142
-c tests/phpunit/phpunit.xml \
143143
--log-junit /tmp/results/phpunit_tests_results.xml \
144144
--coverage-html=/tmp/results/coverage/ \
145-
--coverage-clover=/tmp/results/coverage/clover.xml \
146145
--random-order \
147146
--do-not-cache-result
148147

tests/Jenkinsfile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ pipeline {
5050
stages {
5151
stage('UT PHPUnit PHP 7.3') {
5252
steps { script { actions.runPHPUnitTests('73') } }
53-
post {
54-
always {
55-
step([$class: 'CloverPublisher', cloverReportDir: 'results/ut-phpunit/php-73/coverage/', cloverReportFileName: 'clover.xml'])
56-
}
57-
}
5853
}
5954
}
6055
post { always { junit 'results/ut-phpunit/*/phpunit_tests_results.xml' } }
@@ -71,7 +66,7 @@ pipeline {
7166
post {
7267
always {
7368
junit 'results/jest/test-*-results.xml'
74-
step([$class: 'CloverPublisher', cloverReportDir: 'results/jest/coverage/', cloverReportFileName: 'clover.xml'])
69+
publishCoverage adapters: [istanbulCoberturaAdapter('results/jest/coverage/cobertura-coverage.xml')], tag: 'Javascript'
7570
}
7671
}
7772
}

tests/Jenkinsfile-nightly

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ pipeline {
3636
post {
3737
always {
3838
junit 'results/ut-phpunit/*/phpunit_tests_results.xml'
39-
step([$class: 'CloverPublisher', cloverReportDir: 'results/ut-phpunit/php-74/coverage/', cloverReportFileName: 'clover.xml'])
4039
}
4140
}
4241
}

tests/actions.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def runJestTests(String name, String path) {
3030
export JEST_JUNIT_OUTPUT_DIR="\$WORKSPACE/results/jest/"
3131
export JEST_JUNIT_OUTPUT_NAME="test-${name}-results.xml"
3232
export JEST_SUITE_NAME="Jest ${name} test suite"
33-
npm --prefix "sources/" test -- '${path}' --ci --maxWorkers=2 --reporters=default --reporters=jest-junit --coverage --coverageDirectory="\$WORKSPACE/results/jest/coverage/"
33+
npm --prefix "sources/" test -- '${path}' --ci --maxWorkers=2 --reporters=default --reporters=jest-junit --coverage --coverageReporters=text-summary --coverageReporters=cobertura --coverageDirectory="\$WORKSPACE/results/jest/coverage/"
3434
"""
3535
}
3636

0 commit comments

Comments
 (0)