Skip to content

fix(template): explain missing GTest for module tests - #253

Merged
wyli merged 1 commit into
nvidia-holoscan:mainfrom
tbirdso:tbirdsong/4x/3035
Sep 23, 2026
Merged

wyli merged 1 commit into
nvidia-holoscan:mainfrom
tbirdso:tbirdsong/4x/3035

Conversation

@tbirdso

@tbirdso tbirdso commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Background

Internal user reported behavior where missing GTest failed a default C++ native build

Investigation and Update

This behavior is intentional with "_BUILD_TESTS:BOOL=ON" by default. Keep the tests on-by-default and better document the flag to disable.

Results

Local end-to-end test verified error reporting, default testing behavior.

Assisted-by: Codex:GPT-5

Summary by CodeRabbit

  • Documentation
    • Clarified when module tests are enabled by default and how to disable them.
    • Documented that C++ tests require GTest and that BUILD_TESTING=OFF does not disable module tests.
  • Bug Fixes
    • C++ project configuration now displays a clear error when tests are enabled but GTest is unavailable.
  • Tests
    • Added checks for C++ project configuration with testing disabled, GTest available, and GTest unavailable.

Background: Internal user reported behavior where missing GTest failed a
default C++ native build

This behavior is intentional with "<MODULE>_BUILD_TESTS:BOOL=ON" by
default. Keep the tests on-by-default and better document the flag to
disable.

Assisted-by: Codex:GPT-5
Signed-off-by: Tom Birdsong <tbirdsong@nvidia.com>
@tbirdso tbirdso self-assigned this Sep 23, 2026
@copy-pr-bot

copy-pr-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@tbirdso
tbirdso requested a review from wyli September 23, 2026 18:26
@tbirdso
tbirdso marked this pull request as ready for review September 23, 2026 18:26
@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 3af9f326-d851-4775-935e-f4c411a539e7

📥 Commits

Reviewing files that changed from the base of the PR and between 2389754 and 496537f.

📒 Files selected for processing (4)
  • src/holoscan_cli/templates/module/{{cookiecutter.module_repo_name}}/DEVELOPER.md
  • src/holoscan_cli/templates/module/{{cookiecutter.module_repo_name}}/README.md
  • src/holoscan_cli/templates/module/{{cookiecutter.module_repo_name}}/tests/cpp/{% if cookiecutter.language == 'cpp' %}CMakeLists.txt{% endif %}
  • tests/unit/test_module_template.py

Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


Walkthrough

The module template now documents its test option and C++ GTest requirements. CMake reports a targeted error when tests are enabled and GTest is unavailable. A parameterized test checks configuration with tests disabled, GTest available, and GTest unavailable.

Changes

Module test configuration

Layer / File(s) Summary
Test option and GTest configuration
src/holoscan_cli/templates/module/{{cookiecutter.module_repo_name}}/DEVELOPER.md, src/holoscan_cli/templates/module/{{cookiecutter.module_repo_name}}/README.md, src/holoscan_cli/templates/module/{{cookiecutter.module_repo_name}}/tests/cpp/{% if cookiecutter.language == 'cpp' %}CMakeLists.txt{% endif %}, tests/unit/test_module_template.py
The documentation describes the module test option’s defaults, how to disable tests, and the GTest requirement for C++ tests. CMake reports an error with guidance when GTest is missing. Tests cover configuration with tests disabled, GTest available, and GTest unavailable.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 49653

The change documents how to disable module tests and provides a targeted error when GTest is missing. It is ready for normal merge checks.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: documenting the missing GTest requirement for module tests in the template.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@wyli wyli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the GTest discovery change and generated documentation. The existing test defaults are preserved, and the missing-dependency error provides the correct module-scoped opt-out. All 17 targeted template/scaffolding tests passed locally, and the current CI checks are green.

@wyli
wyli merged commit e46b71a into nvidia-holoscan:main Sep 23, 2026
16 checks passed
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.

2 participants