Skip to content

hmon: add C++ HMON unit tests#135

Draft
arkjedrz wants to merge 2 commits intoeclipse-score:mainfrom
qorix-group:arkjedrz_cpp-unit-tests
Draft

hmon: add C++ HMON unit tests#135
arkjedrz wants to merge 2 commits intoeclipse-score:mainfrom
qorix-group:arkjedrz_cpp-unit-tests

Conversation

@arkjedrz
Copy link
Copy Markdown
Contributor

@arkjedrz arkjedrz commented Mar 27, 2026

  • Rename previous test to integrated_test.
  • Reimplement Rust unit tests into C++.

Resolves #121

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 27, 2026

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.4.2) and connecting to it...
INFO: Invocation ID: e29fdda1-5286-43ab-9094-2719ec562a8c
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'score_rust_policies', the root module requires module version score_rust_policies@0.0.3, but got score_rust_policies@0.0.5 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (53 packages loaded, 9 targets configured)

Analyzing: target //:license-check (112 packages loaded, 68 targets configured)

Analyzing: target //:license-check (153 packages loaded, 2852 targets configured)

Analyzing: target //:license-check (154 packages loaded, 5842 targets configured)

Analyzing: target //:license-check (165 packages loaded, 7901 targets configured)

Analyzing: target //:license-check (165 packages loaded, 7901 targets configured)

Analyzing: target //:license-check (166 packages loaded, 8025 targets configured)

Analyzing: target //:license-check (169 packages loaded, 9913 targets configured)

INFO: Analyzed target //:license-check (170 packages loaded, 10039 targets configured).
[13 / 16] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox
[15 / 16] Building license.check.license_check.jar (); 0s disk-cache, multiplex-worker
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 23.003s, Critical Path: 2.49s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions
Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

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

This PR extends the health monitoring library’s C++ test coverage by porting/expanding previously Rust-side unit tests into C++ and updates the Rust↔C++ FFI for HealthMonitorBuilder::build to accept optional cycle intervals.

Changes:

  • Updated health_monitor_builder_build FFI to take nullable *const u64 / const uint64_t* cycle interval parameters (null = use Rust defaults).
  • Added/expanded C++ gtest coverage for HealthMonitorBuilder/HealthMonitor APIs and introduced a new “integrated” usage test file.
  • Updated Rust-side FFI unit tests to use the new optional-parameter calling convention.

Reviewed changes

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

Show a summary per file
File Description
src/health_monitoring_lib/rust/ffi.rs Changes the exported FFI signature for health_monitor_builder_build to nullable *const u64 and updates/extends unit tests accordingly.
src/health_monitoring_lib/rust/deadline/ffi.rs Updates tests to call health_monitor_builder_build with null cycle interval pointers.
src/health_monitoring_lib/rust/heartbeat/ffi.rs Updates tests to call health_monitor_builder_build with null cycle interval pointers.
src/health_monitoring_lib/rust/logic/ffi.rs Updates tests to call health_monitor_builder_build with null cycle interval pointers.
src/health_monitoring_lib/cpp/include/score/hm/health_monitor.h Stores cycle intervals as optionals to support passing nullable parameters over FFI.
src/health_monitoring_lib/cpp/health_monitor.cpp Passes optional cycle intervals across FFI as nullable pointers.
src/health_monitoring_lib/cpp/tests/health_monitor_test.cpp Replaces the previous “single integrated test” with a broader set of focused unit tests.
src/health_monitoring_lib/cpp/tests/integrated_test.cpp Adds a higher-level integration-style test demonstrating multi-monitor setup and basic interactions.

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

@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from 0c1a1cf to 9974c3a Compare March 27, 2026 13:34
@arkjedrz arkjedrz requested a deployment to workflow-approval March 27, 2026 13:34 — with GitHub Actions Waiting
@arkjedrz arkjedrz requested a deployment to workflow-approval March 27, 2026 13:34 — with GitHub Actions Waiting
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from 9974c3a to 219214f Compare March 27, 2026 13:45
@arkjedrz arkjedrz requested a deployment to workflow-approval March 27, 2026 13:45 — with GitHub Actions Waiting
@arkjedrz arkjedrz requested a deployment to workflow-approval March 27, 2026 13:45 — with GitHub Actions Waiting
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from 219214f to 7697a8d Compare March 27, 2026 14:17
@arkjedrz arkjedrz requested a deployment to workflow-approval March 27, 2026 14:17 — with GitHub Actions Waiting
@arkjedrz arkjedrz requested a deployment to workflow-approval March 27, 2026 14:17 — with GitHub Actions Waiting
Expose parameters to background thread.
- Rename previous test to `integrated_test`.
- Reimplement Rust unit tests into C++.
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from 7697a8d to 1863fef Compare March 27, 2026 15:03
@arkjedrz arkjedrz requested a deployment to workflow-approval March 27, 2026 15:03 — with GitHub Actions Waiting
@arkjedrz arkjedrz requested a deployment to workflow-approval March 27, 2026 15:03 — with GitHub Actions Waiting
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.

Improvement: improved testing for health monitoring lib C++ interface

2 participants