Integrate unit and system tests via ament_add_gtest (#18) #148
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 488 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.370
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #148"
general
weight: 0.35
fujitatomoya
Closes #18
Summary
Tests used to be standalone client executables (built with
CLIENT_TEST_DEMO=ON) driven bytest/test.pyand a launch file, so they could not run withcolcon test. This PR integrates unit and system tests into thepersist_parameter_serverpackage withament_add_gtest, enables theament_lint_commonlinters, and runs everything throughcolcon testin CI.Changes
server/src/parameter_server.cppis now built as a static library (persist_parameter_server_core) shared by theserverexecutable and the test. The installed artifacts (server, launch and param files) are unchanged.test/test_parameter_server.cpp, 13 cases) registered withament_add_ros_isolated_gtest(a thin wrapper overament_add_gtestthat runs with an isolatedROS_DOMAIN_ID, so a running parameter server on the machine does not interfere). Each test runs theParameterServernode in-process on its own executor thread and drives it with a parameter client node, exactly as an external node would. Stopping/restarting the node flushes and reloads the persistent yaml file, which replaces the former "kill the server process" step intest.py.- Covers all former scenarios: default options (read/modify, persistence across restart, type change rejected),
allow_dynamic_typing,save_on_update, and dynamic change ofmust_save_on_update/storing_period/allow_dynamic_typing, including the storing timer behaviour.- New coverage: content of the stored yaml file (non-persistent parameters never written, doubles written as
10.0), missing yaml file, node-name keyed yaml file, invalid yaml files rejected at startup, negativestoring_periodrejected.test/test.py,test/launch/test.launch.py, the fourclient_*demo executables, theCLIENT_TEST_DEMOoption and thepsutilbased process killing.test/persist_parameter_client.{hpp,cpp}is kept as a slimmed-down test helper.ament_lint_auto/ament_lint_commonare enabled. All uncrustify, cpplint, lint_cmake, flake8, pep257, copyright and xmllint findings inserver/,test/and the launch file are fixed. Most of the diff inparameter_server.cppis the mechanical uncrustify reformat (brace placement and line wrapping); the only semantic edits there arePRId64format specifiers instead of%ld/%lld.parameter_server.his renamed toparameter_server.hppandmain.cppdropsusing namespace.scripts/build-verification.sh(called by all distro workflows) now builds withoutCLIENT_TEST_DEMOand runscolcon test --packages-select persist_parameter_server --return-code-on-test-failurefollowed bycolcon test-result --all --verbose.ament_cmake_gtestandament_cmake_rostest dependencies replace the unusedament_cmake_pytest/launch; schema reference fixed topackage_format3.xsd(xmllint was failing on it).colcon testworkflow.Test results (ROS rolling, source build)
The gtest suite was run 4 times in a row without failures. The
serverexecutable was also smoke-tested manually (ros2 param set, SIGINT, persisted values present in the yaml file).Notes for review
server/src/parameter_server.cpp; this PR will auto-backport to kilted/jazzy/humble via mergify. The code is guarded for rclcpp < 17 as before, but a humble CI run is worth watching.Sony Corporationcopyright header as the files they were derived from; adjust if a different holder is intended.🤖 Generated with Claude Code