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

Testing ci.

parent e4c56efc
No related branches found
No related tags found
No related merge requests found
Pipeline #2337 failed
before_script:
- pip install --user untangle
stages:
- build
- test
- report
build:
stage: build
script:
- ./gradlew --console=plain assemble
retry: 2
when: on_success
test:
stage: test
script:
- ./gradlew --continue --console=plain test jacocoTestReport
retry: 2
when: on_success
artifacts:
when: always
# paths:
# - $TEST_REPORTS
# - $JACOCO_DATA1
# - $JACOCO_DATA2
coverage:
image: python:3.7.1-stretch
stage: report
dependencies:
- test
script:
# - ./gradlew --continue --console=plain -x test
- python2 print-coverage.py
coverage: "/Covered (\\d{1,3}\\.\\d{2}%) of instructions for all projects\\./"
allow_failure: true
when: on_success
artifacts:
when: always
# paths:
# - $COVERAGE_REPORTS
......@@ -4,6 +4,7 @@ repositories {
apply plugin: 'jastadd'
apply plugin: 'application'
apply plugin: 'jacoco'
dependencies {
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.8.1'
......@@ -31,6 +32,13 @@ run {
}
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
task preprocess(type: JavaExec) {
group = 'Build'
main = "-jar"
......
import untangle
obj = untangle.parse('eraser-base/build/reports/jacoco/test/jacocoTestReport.xml')
instructions = [o for o in obj.report.counter if o['type'] == 'INSTRUCTION'][0]
missed, covered = int(instructions['missed']), int(instructions['covered'])
# print missed / (missed + covered)
print 'Covered %.2f%% of instructions for all projects.' % (missed * 100.0 / (missed + covered))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment