Skip to content
Snippets Groups Projects
Commit 210e6c29 authored by René Schöne's avatar René Schöne
Browse files

Add jacoco report to artifacts.

parent f108c56e
No related branches found
No related tags found
1 merge request!1Fixing CI
Pipeline #2355 passed with warnings
...@@ -6,6 +6,7 @@ stages: ...@@ -6,6 +6,7 @@ stages:
variables: variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false" GRADLE_OPTS: "-Dorg.gradle.daemon=false"
TEST_REPORTS: "/builds/rschoene/eraser/eraser-base/build/reports/tests/test/" TEST_REPORTS: "/builds/rschoene/eraser/eraser-base/build/reports/tests/test/"
JACOCO_REPORT: "/builds/rschoene/eraser/eraser-base/build/reports/jacoco/test/jacocoTestReport.xml"
before_script: before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle - export GRADLE_USER_HOME=`pwd`/.gradle
...@@ -37,6 +38,7 @@ test: ...@@ -37,6 +38,7 @@ test:
when: always when: always
paths: paths:
- $TEST_REPORTS - $TEST_REPORTS
- $JACOCO_REPORT
coverage: coverage:
image: python:3.7.1-alpine image: python:3.7.1-alpine
...@@ -55,3 +57,7 @@ coverage: ...@@ -55,3 +57,7 @@ coverage:
- build - build
- .gradle - .gradle
allow_failure: true allow_failure: true
artifacts:
when: always
paths:
- $JACOCO_REPORT
import os
import untangle import untangle
print('Current path: * + os.path.abspath(os.curdir))
obj = untangle.parse('eraser-base/build/reports/jacoco/test/jacocoTestReport.xml') obj = untangle.parse('eraser-base/build/reports/jacoco/test/jacocoTestReport.xml')
instructions = [o for o in obj.report.counter if o['type'] == 'INSTRUCTION'][0] instructions = [o for o in obj.report.counter if o['type'] == 'INSTRUCTION'][0]
missed, covered = int(instructions['missed']), int(instructions['covered']) missed, covered = int(instructions['missed']), int(instructions['covered'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment