Skip to content

test: add Ouster code coverage flags and unit tests for hw_interface#5

Merged
Samahu merged 3 commits into
add-ouster-lidar-support-via-submodulefrom
copilot/fix-coverage-drop-in-lidar-support
Apr 21, 2026
Merged

test: add Ouster code coverage flags and unit tests for hw_interface#5
Samahu merged 3 commits into
add-ouster-lidar-support-via-submodulefrom
copilot/fix-coverage-drop-in-lidar-support

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 20, 2026

Summary

Addresses the 0% patch coverage on Ouster packages reported by the Codecov Report on PR #2. The patch coverage target is 90%, but all 398 new lines from the Ouster integration had 0% coverage.

Changes

1. Codecov flag configuration (.codecov.yml)

Added individual coverage flags for Ouster packages, matching the pattern used by Hesai, Robosense, and Continental:

  • nebula_oustersrc/nebula_ouster/nebula_ouster
  • nebula_ouster_commonsrc/nebula_ouster/nebula_ouster_common
  • nebula_ouster_decoderssrc/nebula_ouster/nebula_ouster_decoders
  • nebula_ouster_hw_interfacessrc/nebula_ouster/nebula_ouster_hw_interfaces

2. Unit tests (nebula_ouster_hw_interfaces/test/test_ouster_hw_interface.cpp)

Added GTest-based unit tests for OusterHwInterface following the same pattern as test_robosense_hw_interface.cpp:

  • TestStartWithoutCallback — verifies error when starting before registering a callback
  • TestRegisterEmptyCallback — verifies error for null callback
  • TestLifecycle — register → start → stop happy path
  • TestDoubleStartIsIdempotent — second start is a no-op when already running
  • TestStopWithoutStart — stop on an idle interface succeeds
  • TestRegisterCallbackWhileRunning — verifies error when replacing callback while active
  • TestScanPacketCallback — sends mock UDP packets and verifies callback fires
  • TestErrorCodeToString — exercises all error code string conversions

3. CMake test integration (nebula_ouster_hw_interfaces/CMakeLists.txt)

Added BUILD_TESTING block with ament_add_gtest matching the structure of other vendor packages (Robosense, Hesai, Continental).

Copilot AI and others added 2 commits April 20, 2026 15:01
- Add nebula_ouster, nebula_ouster_common, nebula_ouster_decoders, and
  nebula_ouster_hw_interfaces flags to .codecov.yml following the pattern
  used by Hesai, Robosense, and Continental vendors.
- Add GTest-based unit tests for OusterHwInterface covering:
  start without callback, empty callback registration, lifecycle,
  idempotent double start, stop without start, callback replacement
  while running, scan packet callback, and error code string conversion.
- Update CMakeLists.txt with BUILD_TESTING block matching other vendors.

Agent-Logs-Url: https://github.com/Samahu/nebula/sessions/e06d9bd5-4b3a-484a-bd8a-a5a3b002b63c

Co-authored-by: Samahu <606033+Samahu@users.noreply.github.com>
Copilot AI requested a review from Samahu April 20, 2026 15:06
@Samahu Samahu changed the title Add Ouster code coverage flags and unit tests for hw_interface chor: add Ouster code coverage flags and unit tests for hw_interface Apr 21, 2026
@Samahu Samahu changed the title chor: add Ouster code coverage flags and unit tests for hw_interface test: add Ouster code coverage flags and unit tests for hw_interface Apr 21, 2026
@Samahu Samahu requested a review from Copilot April 21, 2026 02:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Codecov flag coverage tracking and introduces unit tests to raise patch coverage for the Ouster integration, aligning it with the existing vendor package patterns in this repo.

Changes:

  • Add Codecov individual_flags entries for the Ouster packages to track coverage per subpackage.
  • Add GTest unit tests for nebula::drivers::OusterHwInterface, including lifecycle/error-path and packet-callback behavior.
  • Wire the new Ouster hw_interface test into nebula_ouster_hw_interfaces via a BUILD_TESTING CMake block.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/nebula_ouster/nebula_ouster_hw_interfaces/test/test_ouster_hw_interface.cpp Adds GTest coverage for OusterHwInterface, including UDP callback triggering via a mock sender.
src/nebula_ouster/nebula_ouster_hw_interfaces/CMakeLists.txt Adds ament_add_gtest target and dependencies for the new hw_interface tests.
.codecov.yml Adds Codecov flags for Ouster packages to address 0% patch coverage reporting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/nebula_ouster/nebula_ouster_hw_interfaces/test/test_ouster_hw_interface.cpp Outdated
Comment thread src/nebula_ouster/nebula_ouster_hw_interfaces/test/test_ouster_hw_interface.cpp Outdated
… on separate calls

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Samahu Samahu marked this pull request as ready for review April 21, 2026 02:15
@Samahu Samahu merged commit 751e137 into add-ouster-lidar-support-via-submodule Apr 21, 2026
12 of 13 checks passed
@Samahu Samahu deleted the copilot/fix-coverage-drop-in-lidar-support branch April 21, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants