diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 02ce72e486648a1658c09049fa44cbb67f473a41..517012fa3878802a907f932ee7a68b1e419f2eea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,14 +39,14 @@ test: - $TEST_REPORTS coverage: - image: python:3.7.1-stretch + image: python:3.7.1-alpine stage: report dependencies: - test script: # - ./gradlew --continue --console=plain -x test jacocoTestReport - pip install --user untangle - - python2 print-coverage.py + - python print-coverage.py coverage: "/Covered (\\d{1,3}\\.\\d{2}%) of instructions for all projects\\./" cache: key: "$CI_COMMIT_REF_NAME" diff --git a/print-coverage.py b/print-coverage.py index 00239ab85b7dfd926924cef6c79a0758a22ab3ed..6b8e790a712c58af7eaf067975245dc1cc2a70b9 100644 --- a/print-coverage.py +++ b/print-coverage.py @@ -3,4 +3,4 @@ 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)) +print('Covered %.2f%% of instructions for all projects.' % (missed * 100.0 / (missed + covered)))