Skip to content

Commit

Permalink
request #14637: Remove usage of the Jenkins clover plugin the test pi…
Browse files Browse the repository at this point in the history
…pelines

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
  • Loading branch information
LeSuisse committed Mar 5, 2020
1 parent ba4531a commit f6975cd
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ phpunit-ci-run:
-c tests/phpunit/phpunit.xml \
--log-junit /tmp/results/phpunit_tests_results.xml \
--coverage-html=/tmp/results/coverage/ \
--coverage-clover=/tmp/results/coverage/clover.xml \
--random-order \
--do-not-cache-result

Expand Down
7 changes: 1 addition & 6 deletions tests/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ pipeline {
stages {
stage('UT PHPUnit PHP 7.3') {
steps { script { actions.runPHPUnitTests('73') } }
post {
always {
step([$class: 'CloverPublisher', cloverReportDir: 'results/ut-phpunit/php-73/coverage/', cloverReportFileName: 'clover.xml'])
}
}
}
}
post { always { junit 'results/ut-phpunit/*/phpunit_tests_results.xml' } }
Expand All @@ -71,7 +66,7 @@ pipeline {
post {
always {
junit 'results/jest/test-*-results.xml'
step([$class: 'CloverPublisher', cloverReportDir: 'results/jest/coverage/', cloverReportFileName: 'clover.xml'])
publishCoverage adapters: [istanbulCoberturaAdapter('results/jest/coverage/cobertura-coverage.xml')], tag: 'Javascript'
}
}
}
Expand Down
1 change: 0 additions & 1 deletion tests/Jenkinsfile-nightly
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ pipeline {
post {
always {
junit 'results/ut-phpunit/*/phpunit_tests_results.xml'
step([$class: 'CloverPublisher', cloverReportDir: 'results/ut-phpunit/php-74/coverage/', cloverReportFileName: 'clover.xml'])
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/actions.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def runJestTests(String name, String path) {
export JEST_JUNIT_OUTPUT_DIR="\$WORKSPACE/results/jest/"
export JEST_JUNIT_OUTPUT_NAME="test-${name}-results.xml"
export JEST_SUITE_NAME="Jest ${name} test suite"
npm --prefix "sources/" test -- '${path}' --ci --maxWorkers=2 --reporters=default --reporters=jest-junit --coverage --coverageDirectory="\$WORKSPACE/results/jest/coverage/"
npm --prefix "sources/" test -- '${path}' --ci --maxWorkers=2 --reporters=default --reporters=jest-junit --coverage --coverageReporters=text-summary --coverageReporters=cobertura --coverageDirectory="\$WORKSPACE/results/jest/coverage/"
"""
}

Expand Down

0 comments on commit f6975cd

Please sign in to comment.