Skip to content

hmon: add C++ HMON unit tests#135

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

hmon: add C++ HMON unit tests#135
arkjedrz wants to merge 1 commit into
eclipse-score:mainfrom
qorix-group:arkjedrz_cpp-unit-tests

Conversation

@arkjedrz
Copy link
Copy Markdown
Contributor

@arkjedrz arkjedrz commented Mar 27, 2026

C++ wrapper unit tests.

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: 1ac5d047-61b6-4ee4-963e-34ffa676aabe
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
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 (32 packages loaded, 10 targets configured)

Analyzing: target //:license-check (85 packages loaded, 10 targets configured)

Analyzing: target //:license-check (137 packages loaded, 2457 targets configured)

Analyzing: target //:license-check (146 packages loaded, 6015 targets configured)

Analyzing: target //:license-check (152 packages loaded, 8045 targets configured)

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

INFO: Analyzed target //:license-check (162 packages loaded, 10232 targets configured).
[2 / 14] checking cached actions
[14 / 16] [Prepa] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar
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: 20.190s, Critical Path: 2.34s
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.

Comment thread src/health_monitoring_lib/cpp/tests/integrated_test.cpp Outdated
Comment thread src/health_monitoring_lib/cpp/health_monitor.cpp
Comment thread src/health_monitoring_lib/cpp/health_monitor.cpp
Comment thread src/health_monitoring_lib/cpp/include/score/hm/health_monitor.h
Comment thread src/health_monitoring_lib/cpp/tests/health_monitor_test.cpp Outdated
Comment thread src/health_monitoring_lib/cpp/tests/integrated_test.cpp Outdated
Comment thread src/health_monitoring_lib/cpp/tests/integrated_test.cpp Outdated
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from 0c1a1cf to 9974c3a Compare March 27, 2026 13:34
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from 9974c3a to 219214f Compare March 27, 2026 13:45
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from 219214f to 7697a8d Compare March 27, 2026 14:17
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from 7697a8d to 1863fef Compare March 27, 2026 15:03
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from 1863fef to a57ecac Compare March 30, 2026 09:09
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from a57ecac to 83fa079 Compare March 30, 2026 09:12
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from 83fa079 to 4dcecf6 Compare March 30, 2026 09:38
@arkjedrz arkjedrz temporarily deployed to workflow-approval March 30, 2026 09:38 — with GitHub Actions Inactive
@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
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from 4dcecf6 to a7012f5 Compare April 1, 2026 12:34
@arkjedrz arkjedrz had a problem deploying to workflow-approval April 1, 2026 12:34 — with GitHub Actions Failure
@arkjedrz arkjedrz had a problem deploying to workflow-approval April 1, 2026 12:34 — with GitHub Actions Failure
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from a7012f5 to 7a897d3 Compare April 8, 2026 07:26
@arkjedrz arkjedrz had a problem deploying to workflow-approval April 8, 2026 07:26 — with GitHub Actions Failure
@arkjedrz arkjedrz temporarily deployed to workflow-approval April 8, 2026 07:50 — with GitHub Actions Inactive
@arkjedrz arkjedrz temporarily deployed to workflow-approval April 8, 2026 07:59 — with GitHub Actions Inactive
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from 7a897d3 to f23ce20 Compare May 25, 2026 11:09
@arkjedrz arkjedrz temporarily deployed to workflow-approval May 25, 2026 11:09 — with GitHub Actions Inactive
@arkjedrz arkjedrz temporarily deployed to workflow-approval May 25, 2026 11:09 — with GitHub Actions Inactive
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from f23ce20 to 72c76fb Compare May 29, 2026 13:38
@arkjedrz arkjedrz requested a deployment to workflow-approval May 29, 2026 13:38 — with GitHub Actions Waiting
@arkjedrz arkjedrz requested a deployment to workflow-approval May 29, 2026 13:38 — with GitHub Actions Waiting
using namespace score::hm;
using namespace score::hm::deadline;

TEST(DeadlineMonitorBuilder, New_Succeeds)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please use the RecordProperty calls defined in Score Process to define TestType, DerivationTechnique, the Description and possible requirements links.

Comment thread score/health_monitor/src/cpp/tests/deadline_monitor_test.cpp

#include "gtest/gtest.h"
#include "score/hm/common.h"
// #include <gtest/gtest.h>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should use <> way and remove the ""

Comment thread src/health_monitoring_lib/BUILD Outdated
"cpp/tests/deadline_monitor_test.cpp",
"cpp/tests/health_monitor_test.cpp",
"cpp/tests/heartbeat_monitor_test.cpp",
"cpp/tests/integrated_test.cpp",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we have this one as a separate bazel target as it seems this is more of a integration test, so don't think we should mix test kinds into the same binary,

Comment thread score/health_monitor/src/cpp/tests/heartbeat_monitor_test.cpp
C++ wrapper unit tests.
@arkjedrz arkjedrz force-pushed the arkjedrz_cpp-unit-tests branch from 72c76fb to c87221e Compare June 2, 2026 09:41
@arkjedrz arkjedrz requested a deployment to workflow-approval June 2, 2026 09:41 — with GitHub Actions Waiting
@arkjedrz arkjedrz requested a deployment to workflow-approval June 2, 2026 09:41 — 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

4 participants