From c3946eef7c7539e1613c2f31aa844a82b2cc0486 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 22 Apr 2021 16:01:04 +0200 Subject: [PATCH] ci: generate cobertura report directly grcov 0.8.0 now has cobertura support so we no longer need to to export to lcov format and then convert. Extract the summary from the generated html so the metric matches the one from the html report (for some reason the cobertura ones are differents). The new gitlab summary parsing regexp is now: (\d+.\d+) %<\/abbr> --- .gitlab-ci.yml | 11 +++++------ ci/images_template.yml | 2 +- ci/install-rust.sh | 1 - 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 95383a375..9f7386a67 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -83,7 +83,7 @@ stages: - .fdo.container-build@debian stage: container-base variables: - FDO_DISTRIBUTION_PACKAGES: "build-essential curl python3-setuptools liborc-0.4-dev libglib2.0-dev libxml2-dev libgtk-3-dev libegl1-mesa libgles2-mesa libgl1-mesa-dri libgl1-mesa-glx libwayland-egl1-mesa xz-utils libssl-dev git wget ca-certificates ninja-build python3-pip flex bison libglib2.0-dev lcov" + FDO_DISTRIBUTION_PACKAGES: "build-essential curl python3-setuptools liborc-0.4-dev libglib2.0-dev libxml2-dev libgtk-3-dev libegl1-mesa libgles2-mesa libgl1-mesa-dri libgl1-mesa-glx libwayland-egl1-mesa xz-utils libssl-dev git wget ca-certificates ninja-build python3-pip flex bison libglib2.0-dev" FDO_DISTRIBUTION_EXEC: 'bash ci/install-gst.sh && pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates' .build-final-image: @@ -432,11 +432,10 @@ coverage: # generate html report - grcov . --binary-path ./target/debug/ -s . -t html --branch --ignore-not-existing --ignore "*target*" --ignore "*/sys/*" --ignore "examples/*" --ignore "tutorials/*" -o ./coverage/ # generate cobertura report for gitlab integration - - grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "*target*" --ignore "*/sys/*" --ignore "examples/*" --ignore "tutorials/*" -o lcov - - python3 /usr/local/lib/python3.7/dist-packages/lcov_cobertura.py lcov - # output coverage summary for gitlab parsing - - lcov -r lcov "/*" 2&> out - - grep lines out + - grcov . --binary-path ./target/debug/ -s . -t cobertura --branch --ignore-not-existing --ignore "*target*" --ignore "*/sys/*" --ignore "examples/*" --ignore "tutorials/*" -o coverage.xml + # output coverage summary for gitlab parsing. + # TODO: use grcov once https://github.com/mozilla/grcov/issues/556 is fixed + - grep % coverage/index.html | head -1 ; true artifacts: paths: - 'coverage' diff --git a/ci/images_template.yml b/ci/images_template.yml index fe96468d4..1d7a5d9ff 100644 --- a/ci/images_template.yml +++ b/ci/images_template.yml @@ -1,4 +1,4 @@ variables: - GST_RS_IMG_TAG: '2021-04-23.0' + GST_RS_IMG_TAG: '2021-04-23.1' GST_RS_STABLE: '1.51.0' GST_RS_MSRV: '1.51.0' diff --git a/ci/install-rust.sh b/ci/install-rust.sh index 29b1ac370..2d067d6f3 100755 --- a/ci/install-rust.sh +++ b/ci/install-rust.sh @@ -31,5 +31,4 @@ fi if [ "$RUST_VERSION" = "nightly" ]; then cargo install grcov rustup component add llvm-tools-preview - pip3 install lcov_cobertura fi