From 360df2054cdc5a8bc194f7701b2bfa5a9c39dd0d Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 10 Dec 2020 09:35:01 +0100 Subject: first test with code-coverage in CI pipe --- .gitlab-ci.yml | 23 ++++++++++++++- build_reporting/pom.xml | 78 +++++++++++++++++++++++++++++++++++++++++++++++++ pom.xml | 61 +++++++++++++++++++++++++++++++------- 3 files changed, 150 insertions(+), 12 deletions(-) create mode 100644 build_reporting/pom.xml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ef026155..9ec05060 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,6 +18,7 @@ include: stages: - assemble + - visualize - test - package - release @@ -36,7 +37,27 @@ assemble: when: always reports: junit: "**/target/surefire-reports/TEST-*.xml" - + paths: + - build_reporting/target/site/jacoco-aggregate-ut/jacoco.xml + +coverage: + stage: visualize + image: haynes/jacoco2cobertura:1.0.4 + script: + - mkdir -p target/site + # convert report from jacoco to cobertura + - 'python /opt/cover2cover.py build_reporting/target/site/jacoco-aggregate-ut/jacoco.xml eaaf_core_api/src/main/java eaaf_core_utils/src/main/java eaaf_core/src/main/java eaaf_modules/eaaf_module_auth_sl20/src/main/java eaaf_modules/eaaf_module_moa-sig/src/main/java eaaf_modules/eaaf_module_pvp2_core/src/main/java eaaf_modules/eaaf_module_pvp2_idp/src/main/java eaaf_modules/eaaf_module_pvp2_sp/src/main/java > target/site/cobertura.xml' + # read the tag and prepend the path to every filename attribute + #- 'python /opt/source2filename.py target/site/cobertura.xml' + needs: + - job: assemble + dependencies: + - assemble + artifacts: + reports: + cobertura: target/site/cobertura.xml + + publishToGitlab: stage: package except: diff --git a/build_reporting/pom.xml b/build_reporting/pom.xml new file mode 100644 index 00000000..5300ff74 --- /dev/null +++ b/build_reporting/pom.xml @@ -0,0 +1,78 @@ + + + 4.0.0 + + at.gv.egiz + eaaf + 1.1.11-SNAPSHOT + + build_reporting + pom + Reporting Module + + + + at.gv.egiz.eaaf + eaaf_core_api + + + at.gv.egiz.eaaf + eaaf_core_utils + + + at.gv.egiz.eaaf + eaaf-core + + + at.gv.egiz.eaaf + eaaf_module_auth_sl20 + + + at.gv.egiz.eaaf + eaaf_module_moa-sig + + + at.gv.egiz.eaaf + eaaf_module_pvp2_core + + + at.gv.egiz.eaaf + eaaf_module_pvp2_idp + + + at.gv.egiz.eaaf + eaaf_module_pvp2_sp + + + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + + aggregate-reports-ut + test + + report-aggregate + + + Maven Multimodule Coverage Demo: Coverage of Unit Tests + ${project.reporting.outputDirectory}/jacoco-aggregate-ut + + + **/target/jacoco-it.exec + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 40920657..585310ce 100644 --- a/pom.xml +++ b/pom.xml @@ -207,6 +207,7 @@ eaaf_core_utils eaaf_core eaaf_modules + build_reporting @@ -220,7 +221,38 @@ at.gv.egiz.eaaf eaaf_core_utils ${egiz.eaaf.version} + + + at.gv.egiz.eaaf + eaaf-core + ${egiz.eaaf.version} + + + at.gv.egiz.eaaf + eaaf_module_auth_sl20 + ${egiz.eaaf.version} + + + at.gv.egiz.eaaf + eaaf_module_moa-sig + ${egiz.eaaf.version} + + + at.gv.egiz.eaaf + eaaf_module_pvp2_core + ${egiz.eaaf.version} + + + at.gv.egiz.eaaf + eaaf_module_pvp2_idp + ${egiz.eaaf.version} + + + at.gv.egiz.eaaf + eaaf_module_pvp2_sp + ${egiz.eaaf.version} + at.gv.egiz.components eventlog-api @@ -597,6 +629,8 @@ ${surefire.version} 1 + + ${surefireArgLine} @@ -649,6 +683,9 @@ prepare-agent + + surefireArgLine + post-unit-report @@ -659,7 +696,7 @@ target/jacoco-report - + post-unit-check test @@ -686,7 +723,7 @@ - + @@ -747,18 +784,20 @@ - + org.jacoco - jacoco-maven-plugin - - - - report - - - + jacoco-maven-plugin + + Maven Multimodule Coverage Demo: Coverage of Unit Tests + ${project.reporting.outputDirectory}/jacoco-aggregate-ut + + + **/target/jacoco-it.exec + + + org.apache.maven.plugins maven-pmd-plugin -- cgit v1.2.3