From f108c56ebd434f041025bbc0fd8367be7d8246b4 Mon Sep 17 00:00:00 2001 From: rschoene <rene.schoene@tu-dresden.de> Date: Fri, 7 Dec 2018 13:58:33 +0100 Subject: [PATCH] Using python3. --- .gitlab-ci.yml | 4 ++-- print-coverage.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 02ce72e4..517012fa 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 00239ab8..6b8e790a 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))) -- GitLab