From f6975cda70dadfc23aa35ffdcfc4aa0a2e38d82c Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Wed, 4 Mar 2020 21:32:15 +0100 Subject: [PATCH] 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] https://github.com/jenkinsci/clover-plugin/pull/21 [1] https://github.com/jenkinsci/clover-plugin/pull/21#issuecomment-583120076 [2] https://jenkins.io/blog/2018/08/17/code-coverage-api-plugin-1/ [3] https://github.com/sebastianbergmann/php-code-coverage/pull/734 Change-Id: Ic4915047616a7023515939dd305a23f12f2300cc --- Makefile | 1 - tests/Jenkinsfile | 7 +------ tests/Jenkinsfile-nightly | 1 - tests/actions.groovy | 2 +- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index defe0a8733d..63b65dd153c 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/tests/Jenkinsfile b/tests/Jenkinsfile index d84faa03599..d23661a7526 100644 --- a/tests/Jenkinsfile +++ b/tests/Jenkinsfile @@ -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' } } @@ -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' } } } diff --git a/tests/Jenkinsfile-nightly b/tests/Jenkinsfile-nightly index cf27ca1fd6b..3972da197f1 100644 --- a/tests/Jenkinsfile-nightly +++ b/tests/Jenkinsfile-nightly @@ -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']) } } } diff --git a/tests/actions.groovy b/tests/actions.groovy index 22fce47b561..0ba69fef9bd 100644 --- a/tests/actions.groovy +++ b/tests/actions.groovy @@ -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/" """ }