This is an automated email from the ASF dual-hosted git repository.

paleolimbot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-nanoarrow.git


The following commit(s) were added to refs/heads/main by this push:
     new ffe657ba fix(ci): Use gcovr instead of lcov (#694)
ffe657ba is described below

commit ffe657bab8520ab1963a64896ccbddb4953de7e2
Author: William Ayd <[email protected]>
AuthorDate: Mon Dec 30 16:54:35 2024 -0500

    fix(ci): Use gcovr instead of lcov (#694)
---
 .github/workflows/build-and-test.yaml |  2 +-
 ci/docker/ubuntu.dockerfile           |  2 +-
 ci/scripts/build-with-meson.sh        |  3 +--
 ci/scripts/coverage.sh                | 26 ++++++++++++++------------
 docker-compose.yml                    |  6 +++++-
 5 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/.github/workflows/build-and-test.yaml 
b/.github/workflows/build-and-test.yaml
index 8814e910..46806aca 100644
--- a/.github/workflows/build-and-test.yaml
+++ b/.github/workflows/build-and-test.yaml
@@ -138,7 +138,7 @@ jobs:
 
       - name: Install system dependencies
         run: |
-          sudo apt-get update && sudo apt-get install -y lcov ninja-build 
valgrind
+          sudo apt-get update && sudo apt-get install -y gcovr ninja-build 
valgrind
 
       - name: Install meson
         run: |
diff --git a/ci/docker/ubuntu.dockerfile b/ci/docker/ubuntu.dockerfile
index 5ec55610..1463dcf9 100644
--- a/ci/docker/ubuntu.dockerfile
+++ b/ci/docker/ubuntu.dockerfile
@@ -20,7 +20,7 @@ ARG NANOARROW_ARCH
 FROM --platform=linux/${NANOARROW_ARCH} ubuntu:latest
 
 RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
-    locales git cmake r-base gnupg curl valgrind gfortran python3-venv 
python3-dev doxygen pandoc lcov \
+    locales git cmake r-base gnupg curl valgrind gfortran python3-venv 
python3-dev doxygen pandoc gcovr \
     libxml2-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev 
libharfbuzz-dev \
     libjpeg-dev libpng-dev libtiff-dev
 
diff --git a/ci/scripts/build-with-meson.sh b/ci/scripts/build-with-meson.sh
index 535d26fd..8c60d82e 100755
--- a/ci/scripts/build-with-meson.sh
+++ b/ci/scripts/build-with-meson.sh
@@ -117,8 +117,7 @@ function main() {
 
     show_header "Generate coverage reports"
     ninja coverage
-    lcov --list meson-logs/coverage.info --ignore-errors mismatch
-
+    cat meson-logs/coverage.txt
     popd
 
     # Clean up subprojects and build folder
diff --git a/ci/scripts/coverage.sh b/ci/scripts/coverage.sh
index c8d11760..33599abc 100755
--- a/ci/scripts/coverage.sh
+++ b/ci/scripts/coverage.sh
@@ -83,28 +83,30 @@ function main() {
 
     pushd "${SANDBOX_DIR}"
 
-    # Generate coverage.info file for both cmake projects using lcov
+    # Generate coverage.info file for both cmake projects using gcovr
     show_header "Calculate CMake project coverage"
-    lcov --capture --directory . \
-        --exclude "*_test.cc" \
-        --exclude "/usr/*" \
-        --exclude "*/gtest/*" \
-        --exclude "*/flatcc/*" \
-        --exclude "*_generated.h" \
-        --exclude "*nanoarrow/_deps/*" \
-        --output-file coverage.info
+    gcovr -r . -f "${TARGET_NANOARROW_DIR}/src" \
+          -e ".*generated\.h" \
+          -e ".*_test.cc" \
+          --lcov coverage.info
 
     # Generate the html coverage while we're here
-    genhtml coverage.info --output-directory html --prefix 
"${TARGET_NANOARROW_DIR}"
+    mkdir html
+    gcovr -r . -f "${TARGET_NANOARROW_DIR}/src" \
+          -e ".*generated\.h" \
+          -e ".*_test.cc" \
+       --html html/coverage.html
 
     # Stripping the leading /nanoarrow/ out of the path is probably possible 
with
-    # an argument of lcov but none of the obvious ones seem to work so...
+    # an argument of gcovr but none of the obvious ones seem to work so...
     sed -i.bak coverage.info -e 's|SF:/nanoarrow/|SF:|'
     rm coverage.info.bak
 
     # Print a summary
     show_header "CMake project coverage summary"
-    lcov --list coverage.info
+    gcovr -s -r . -f "${TARGET_NANOARROW_DIR}/src" \
+          -e ".*generated\.h" \
+          -e ".*_test.cc"
 
     # Clean up the build directories
     rm -rf nanoarrow
diff --git a/docker-compose.yml b/docker-compose.yml
index be7c5ada..dbba470b 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -30,7 +30,11 @@ services:
     command: "/bin/bash /nanoarrow/dev/release/verify-release-candidate.sh 
$NANOARROW_VERIFY_ARGS"
 
   coverage:
-    image: ${REPO}:ubuntu
+    build:
+      context: .
+      dockerfile: ci/docker/ubuntu.dockerfile
+      args:
+        NANOARROW_ARCH: ${NANOARROW_ARCH}
     volumes:
       # Don't mix the "dev tools" and "source" checkouts
       - ./ci/scripts/coverage.sh:/coverage.sh

Reply via email to