Skip to content

Test coverage gaps in merge pipeline and discovery #261

@bburda

Description

@bburda

Summary

The merge pipeline has strong test coverage (1117-line test file) but several gaps were identified during self-review.


Proposed solution (optional)

1. Area-specific field group merge tests

All merge tests use Component or App entities. Area field merge (IDENTITY, HIERARCHY, METADATA) is untested.

File: src/ros2_medkit_gateway/test/test_merge_pipeline.cpp

2. PluginLayer entity ID validation tests

PluginLayer::discover() calls validate_entities() which drops entities with invalid IDs. No tests exist for empty, oversized (>256 chars), or special-character IDs.

File: src/ros2_medkit_gateway/src/discovery/layers/plugin_layer.cpp:26-45

3. handle_health discovery block unit tests

Unit tests only cover nullptr GatewayNode path. The discovery info JSON construction (mode, strategy, pipeline report, linking stats) is never unit-tested.

File: src/ros2_medkit_gateway/test/test_health_handlers.cpp

4. Gap-fill positive assertion

test_discovery_gap_fill.test.py sets allow_heuristic_apps: true but only checks that areas/components are absent. If gap-fill stopped producing apps, tests would still pass.

File: src/ros2_medkit_integration_tests/test/features/test_discovery_gap_fill.test.py

5. merge_bool ENRICHMENT vs ENRICHMENT edge case

No test where two ENRICHMENT layers both provide is_online with conflicting values. The OR semantics should be explicitly tested.

File: src/ros2_medkit_gateway/test/test_merge_pipeline.cpp


Additional context (optional)

Found during self-review of PR #258. These can all be addressed in a single PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions