CI coverage: adding g2o, gtsam, ceres and libpointmatcher. (#1743)

* CI coverage: adding g2o, gtsam, ceres and libpointmatcher. Also fetch test data for integration tests.

* ld

* Increasing ci test timeout for coverage

* Fixed tests when vertigo is not there

* verbose tests

* updating flaky test

* faster coverage by extending unit tests and disable integration test (only for coverage report)

* improving coverage of unit tests in comparison to integrations tests

* fixing not covered new lines
This commit is contained in:
matlabbe
2026-08-08 23:47:48 -07:00
committed by GitHub
parent 2e193ee191
commit 338e142e58
18 changed files with 1212 additions and 75 deletions

View File

@@ -101,4 +101,4 @@ jobs:
env:
PYTHONNOUSERSITE: 1
run: |
ctest -C ${{env.BUILD_TYPE}} --output-on-failure
ctest -C ${{env.BUILD_TYPE}} -V

View File

@@ -124,7 +124,7 @@ jobs:
env:
PYTHONNOUSERSITE: 1
run: |
ctest -C ${{env.BUILD_TYPE}} --output-on-failure
ctest -C ${{env.BUILD_TYPE}} -V
# A ctest SEGFAULT is reported as just "SEGFAULT" with no backtrace, which
# makes a crash inside a long integration test invisible -- the log simply

View File

@@ -125,7 +125,7 @@ jobs:
PYTHONHOME: ${{env.VCPKG_EXPORT_PATH}}/installed/x64-windows-release/tools/python3
PYTHONNOUSERSITE: 1
run: |
ctest -C ${{env.BUILD_TYPE}} --output-on-failure --timeout 300
ctest -C ${{env.BUILD_TYPE}} -V --timeout 300
- name: Info
# Skipped for CUDA: the binary links ZED (sl_zed64.dll -> nvcuvid/nvEncodeAPI64),

View File

@@ -30,6 +30,19 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Restore test data
id: cache-testdata
uses: actions/cache@v4
with:
# Same key as the other workflows so all of them share one entry.
path: data/tests/*.db
key: testdata-${{ hashFiles('data/tests/manifest.txt') }}
- name: Fetch test data
if: steps.cache-testdata.outputs.cache-hit != 'true'
shell: bash
run: bash scripts/fetch_test_data.sh
- name: Install Linux dependencies
run: |
DEBIAN_FRONTEND=noninteractive
@@ -41,26 +54,45 @@ jobs:
git \
cmake \
software-properties-common \
libyaml-cpp-dev
libyaml-cpp-dev \
libg2o-dev \
libceres-dev \
curl \
gnupg \
lsb-release
# GTSAM and libpointmatcher are not in the Ubuntu archive, and
# borglab's gtsam PPAs have no noble packages (gtsam-release-4.2 has
# no noble suite; gtsam-develop's noble Packages index is empty). The
# ROS 2 repo ships both for noble, which is also what the ROS CI jobs
# test against, so take them from there.
sudo curl -fsSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key \
-o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" \
| sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt-get update
sudo apt-get install -y \
ros-jazzy-gtsam \
ros-jazzy-libpointmatcher
- name: Configure CMake
run: |
cmake -B ${{ github.workspace }}/build \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DENABLE_COVERAGE=ON \
-DCMAKE_PREFIX_PATH=/opt/ros/jazzy \
-DBUILD_TESTING=ON \
-DBUILD_APP=OFF \
-DBUILD_TOOLS=OFF \
-DBUILD_EXAMPLES=OFF \
-DWITH_QT=OFF \
-DWITH_PYTHON=OFF \
-DWITH_CERES=OFF \
-DWITH_G2O=OFF \
-DWITH_GTSAM=OFF \
-DWITH_CERES=ON \
-DWITH_G2O=ON \
-DWITH_GTSAM=ON \
-DWITH_MRPT=OFF \
-DWITH_VERTIGO=OFF \
-DWITH_CVSBA=OFF \
-DWITH_POINTMATCHER=OFF \
-DWITH_POINTMATCHER=ON \
-DWITH_CCCORELIB=OFF \
-DWITH_OPEN3D=OFF \
-DWITH_LOAM=OFF \
@@ -77,9 +109,26 @@ jobs:
- name: Test
working-directory: ${{ github.workspace }}/build
run: |
export LD_LIBRARY_PATH="${{ github.workspace }}/build/bin${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
# The ROS packages are not on the default loader path. Both
# directories are needed: GTSAM and libpointmatcher land in
# /opt/ros/jazzy/lib, but gtsam's own libmetis-gtsam.so goes to the
# multiarch subdirectory, and libgtsam.so carries no RUNPATH, so the
# loader can only find it through LD_LIBRARY_PATH.
ROS_LIB=/opt/ros/jazzy/lib
export LD_LIBRARY_PATH="${{ github.workspace }}/build/bin:${ROS_LIB}:${ROS_LIB}/$(gcc -dumpmachine)${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
find ${{ github.workspace }}/build -name '*.gcda' -delete
ctest --output-on-failure
# Unit tests only ("long" is the end-to-end replay suite).
#
# Two reasons. It costs ~90 min in this instrumented -O0 build, 94% of
# the job's test time, for ~3 points of coverage. And running it on
# some events but not others makes the numbers incomparable: Codecov
# measures a pull request against master, so a unit-only PR report
# against a full master report reads as a coverage regression on every
# PR. Same scope everywhere keeps the comparison meaningful.
#
# The replays still run (and gate) in the cmake-linux / macos /
# windows jobs; they are just not measured here.
ctest -V -LE long
- name: Generate LCOV report
run: |