Commit e87924f1 authored by Evan Read's avatar Evan Read

Merge branch 'philzen-fix-line-by-line-test-coverage-setup-for-maven-example' into 'master'

Fix maven & gradle examples in the docs, enabling line-by-line display of test coverage in merge requests out-of-the-box (for java & kotlin)

See merge request gitlab-org/gitlab!62416
parents 700e1ab5 05452abf
...@@ -149,7 +149,7 @@ test-jdk11: ...@@ -149,7 +149,7 @@ test-jdk11:
stage: test stage: test
image: maven:3.6.3-jdk-11 image: maven:3.6.3-jdk-11
script: script:
- 'mvn $MAVEN_CLI_OPTS clean org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report' - mvn $MAVEN_CLI_OPTS clean org.jacoco:jacoco-maven-plugin:prepare-agent test jacoco:report
artifacts: artifacts:
paths: paths:
- target/site/jacoco/jacoco.xml - target/site/jacoco/jacoco.xml
...@@ -161,10 +161,8 @@ coverage-jdk11: ...@@ -161,10 +161,8 @@ coverage-jdk11:
stage: visualize stage: visualize
image: registry.gitlab.com/haynes/jacoco2cobertura:1.0.7 image: registry.gitlab.com/haynes/jacoco2cobertura:1.0.7
script: script:
# convert report from jacoco to cobertura, use relative project path # convert report from jacoco to cobertura, using relative project path
- 'python /opt/cover2cover.py target/site/jacoco/jacoco.xml src/main/java > target/site/cobertura.xml' - python /opt/cover2cover.py target/site/jacoco/jacoco.xml $CI_PROJECT_DIR/src/main/java/ > target/site/cobertura.xml
# read the <source></source> tag and prepend the path to every filename attribute
- 'python /opt/source2filename.py target/site/cobertura.xml'
needs: ["test-jdk11"] needs: ["test-jdk11"]
dependencies: dependencies:
- test-jdk11 - test-jdk11
...@@ -201,10 +199,8 @@ coverage-jdk11: ...@@ -201,10 +199,8 @@ coverage-jdk11:
stage: visualize stage: visualize
image: registry.gitlab.com/haynes/jacoco2cobertura:1.0.7 image: registry.gitlab.com/haynes/jacoco2cobertura:1.0.7
script: script:
# convert report from jacoco to cobertura, use relative project path # convert report from jacoco to cobertura, using relative project path
- 'python /opt/cover2cover.py build/jacoco/jacoco.xml src/main/java > build/cobertura.xml' - python /opt/cover2cover.py build/jacoco/jacoco.xml $CI_PROJECT_DIR/src/main/java/ > build/cobertura.xml
# read the <source></source> tag and prepend the path to every filename attribute
- 'python /opt/source2filename.py build/cobertura.xml'
needs: ["test-jdk11"] needs: ["test-jdk11"]
dependencies: dependencies:
- test-jdk11 - test-jdk11
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment