hmon: add C++ HMON unit tests#135
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
There was a problem hiding this comment.
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_buildFFI to take nullable*const u64/const uint64_t*cycle interval parameters (null = use Rust defaults). - Added/expanded C++ gtest coverage for
HealthMonitorBuilder/HealthMonitorAPIs 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.
0c1a1cf to
9974c3a
Compare
9974c3a to
219214f
Compare
219214f to
7697a8d
Compare
7697a8d to
1863fef
Compare
1863fef to
a57ecac
Compare
a57ecac to
83fa079
Compare
83fa079 to
4dcecf6
Compare
4dcecf6 to
a7012f5
Compare
a7012f5 to
7a897d3
Compare
7a897d3 to
f23ce20
Compare
f23ce20 to
72c76fb
Compare
| using namespace score::hm; | ||
| using namespace score::hm::deadline; | ||
|
|
||
| TEST(DeadlineMonitorBuilder, New_Succeeds) |
There was a problem hiding this comment.
Please use the RecordProperty calls defined in Score Process to define TestType, DerivationTechnique, the Description and possible requirements links.
|
|
||
| #include "gtest/gtest.h" | ||
| #include "score/hm/common.h" | ||
| // #include <gtest/gtest.h> |
There was a problem hiding this comment.
should use <> way and remove the ""
| "cpp/tests/deadline_monitor_test.cpp", | ||
| "cpp/tests/health_monitor_test.cpp", | ||
| "cpp/tests/heartbeat_monitor_test.cpp", | ||
| "cpp/tests/integrated_test.cpp", |
There was a problem hiding this comment.
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,
72c76fb to
c87221e
Compare
C++ wrapper unit tests.
c87221e to
235e6f9
Compare
C++ wrapper unit tests.
Resolves #121