Skip to content

hmon: add C++ HMON unit tests#135

Open
arkjedrz wants to merge 1 commit intoeclipse-score:mainfrom
qorix-group:arkjedrz_cpp-unit-tests
Open

hmon: add C++ HMON unit tests#135
arkjedrz wants to merge 1 commit 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: d415badd-1a4d-43fd-9c25-4b857ea6277f
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 (42 packages loaded, 9 targets configured)

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

Analyzing: target //:license-check (140 packages loaded, 2272 targets configured)

Analyzing: target //:license-check (157 packages loaded, 5250 targets configured)

Analyzing: target //:license-check (162 packages loaded, 5299 targets configured)

Analyzing: target //:license-check (162 packages loaded, 5299 targets configured)

Analyzing: target //:license-check (168 packages loaded, 9905 targets configured)

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

INFO: Analyzed target //:license-check (170 packages loaded, 10039 targets configured).
[9 / 16] Creating runfiles tree bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/score_tooling+/dash/tool/formatters/dash_format_converter.runfiles [for tool]; 0s local ... (2 actions running)
[12 / 16] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox ... (2 actions running)
[14 / 16] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
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.383s, Critical Path: 2.72s
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
@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
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from 1863fef to a57ecac Compare March 30, 2026 09:09
@arkjedrz arkjedrz requested a deployment to workflow-approval March 30, 2026 09:09 — with GitHub Actions Waiting
@arkjedrz arkjedrz requested a deployment to workflow-approval March 30, 2026 09:09 — with GitHub Actions Waiting
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from a57ecac to 83fa079 Compare March 30, 2026 09:12
@arkjedrz arkjedrz requested a deployment to workflow-approval March 30, 2026 09:12 — with GitHub Actions Waiting
@arkjedrz arkjedrz requested a deployment to workflow-approval March 30, 2026 09:12 — with GitHub Actions Waiting
- Rename previous test to `integrated_test`.
- Reimplement Rust unit tests into C++.
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from 83fa079 to 4dcecf6 Compare March 30, 2026 09:38
@arkjedrz arkjedrz deployed to workflow-approval March 30, 2026 09:38 — with GitHub Actions Active
@arkjedrz arkjedrz temporarily deployed to workflow-approval March 30, 2026 09:38 — with GitHub Actions Inactive
@arkjedrz arkjedrz marked this pull request as ready for review March 30, 2026 10:19
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