test: extend smoke tests for v0.4.0 features and missing API coverage#53
test: extend smoke tests for v0.4.0 features and missing API coverage#53
Conversation
Add smoke test assertions for new gateway v0.4.0 features across all 3 demos (sensor, moveit, turtlebot3): - Linux introspection (procfs plugin data per entity) - Scripts API (list scripts, execute, poll completion) - Triggers CRUD (create, list, verify, delete) for moveit/turtlebot - Beacon discovery (sensor demo, conditional on BEACON_MODE) Fill gaps in pre-v0.4.0 API coverage: - Functions entity discovery (all demos) - Discovery relationships (areas -> components) - Operations endpoint (via medkit-fault-manager) - Data access and configurations (moveit, turtlebot) - Bulk data endpoint (all demos) - Faults listing (moveit, turtlebot) Add reusable helpers to smoke_lib.sh: - assert_procfs_introspection - assert_scripts_list / assert_script_execution - assert_triggers_crud Tested against sensor_diagnostics demo: 40/40 pass. Closes #45
There was a problem hiding this comment.
Pull request overview
Extends the repository’s demo smoke tests to cover Gateway v0.4.0 features and fill previously missing REST API coverage across the sensor_diagnostics, moveit_pick_place, and turtlebot3_integration demos.
Changes:
- Adds new smoke assertions for
/functionsdiscovery, area→component relationship endpoints, procfs introspection, scripts lifecycle, and trigger CRUD. - Expands coverage for operations, configurations, data access, bulk-data, and faults listing endpoints (demo-dependent).
- Introduces reusable test helpers in
tests/smoke_lib.shto standardize procfs/scripts/triggers checks.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/smoke_test.sh | Adds functions/relationships/procfs/scripts/operations/bulk-data checks and optional beacon discovery verification. |
| tests/smoke_test_moveit.sh | Adds new v0.4.0 assertions (functions, relationships, procfs, scripts, triggers) plus missing endpoint coverage (operations/configurations/bulk-data/faults). |
| tests/smoke_test_turtlebot3.sh | Adds new v0.4.0 assertions (functions, relationships, procfs, scripts, triggers) plus missing endpoint coverage (operations/configurations/bulk-data/faults). |
| tests/smoke_lib.sh | Adds shared helpers: assert_procfs_introspection, assert_scripts_list, assert_script_execution, assert_triggers_crud. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| section "Triggers" | ||
|
|
||
| assert_triggers_crud "apps" "diagnostic-bridge-app" "/api/v1/apps/diagnostic-bridge-app/faults" |
There was a problem hiding this comment.
The trigger CRUD test is targeting diagnostic-bridge-app and /api/v1/apps/diagnostic-bridge-app/faults, but the MoveIt demo docs describe triggers being created on the fault-producing app (manipulation-monitor) with resource /api/v1/apps/manipulation-monitor/faults. If diagnostic-bridge-app doesn’t expose a /faults collection, this will fail trigger creation (and make CI flaky). Consider switching the entity + resource to the app that actually reports faults in this demo (per demos/moveit_pick_place/README.md triggers section).
| assert_triggers_crud "apps" "diagnostic-bridge-app" "/api/v1/apps/diagnostic-bridge-app/faults" | |
| assert_triggers_crud "apps" "manipulation-monitor" "/api/v1/apps/manipulation-monitor/faults" |
|
|
||
| section "Triggers" | ||
|
|
||
| assert_triggers_crud "apps" "diagnostic-bridge" "/api/v1/apps/diagnostic-bridge/faults" |
There was a problem hiding this comment.
This trigger CRUD test is currently using diagnostic-bridge as the trigger owner and /api/v1/apps/diagnostic-bridge/faults as the watched resource. The TurtleBot3 demo docs describe triggers on anomaly-detector watching /api/v1/apps/anomaly-detector/faults. If diagnostic-bridge isn’t the fault-producing app (or doesn’t expose /faults), trigger creation may fail in CI. Suggest aligning the trigger target/resource with the demo’s documented fault source app.
| assert_triggers_crud "apps" "diagnostic-bridge" "/api/v1/apps/diagnostic-bridge/faults" | |
| assert_triggers_crud "apps" "anomaly-detector" "/api/v1/apps/anomaly-detector/faults" |
In Gazebo-heavy demos, the fault_manager ROS 2 services take longer to be discovered by runtime graph introspection. Use poll_until with a 30s timeout instead of an instant assert_non_empty_items check.
Same race condition as turtlebot3 - fault_manager ROS 2 services may not be discovered by the first runtime refresh cycle. Use poll_until with 30s timeout consistently across all demos.
- Replace 62 lines of inline trigger CRUD in smoke_test.sh with assert_triggers_crud helper call (deduplication) - Use jq -n for JSON body construction in assert_triggers_crud instead of bash string interpolation (safety, project convention) - Update stale file header comments in moveit and turtlebot3 tests to list actual coverage (12+ feature areas, not just entity discovery) - Update root README test descriptions to reflect expanded coverage - Add EXIT trap for print_summary in all test scripts so gateway startup timeouts still produce structured output in CI - Guard print_summary against double-printing (trap + explicit call)
… leaks test_entity_discovery now verifies exact entity count matches expected, not just that expected entities exist. This catches the merge pipeline bug where runtime-created synthetic entities (underscored IDs) are not suppressed after being linked to manifest entities (hyphenated IDs). Also adds missing entity IDs to sensor and turtlebot3 tests so all manifest-defined entities are checked. Will fail CI until ros2_medkit#307 is fixed.
Description
Extend smoke tests to verify all new gateway v0.4.0 features and fill gaps in pre-v0.4.0 API coverage across all 3 demos.
New v0.4.0 feature tests (all demos):
Missing pre-v0.4.0 API coverage added:
New reusable helpers in smoke_lib.sh:
assert_procfs_introspection- check /apps/{id}/x-medkit-procfsassert_scripts_list/assert_script_execution- scripts API lifecycleassert_triggers_crud- full trigger create/list/delete/verify cycleSensor demo tested locally: 40/40 pass. Moveit/turtlebot use the same validated helpers.
Related Issue
closes #45
Checklist