Skip to content

feat: add unit tests for application services (Rust + Python)#372

Open
kgmwang1 wants to merge 6 commits intomainfrom
feat/153-rust-unit-tests
Open

feat: add unit tests for application services (Rust + Python)#372
kgmwang1 wants to merge 6 commits intomainfrom
feat/153-rust-unit-tests

Conversation

@kgmwang1
Copy link
Copy Markdown
Contributor

@kgmwang1 kgmwang1 commented Apr 8, 2026

Summary

Adds 143 unit tests across 7 application services, covering pure functions and core logic with no external dependencies required.

Closes #153

Changes

Rust services (62 tests)

Service Tests Coverage targets
501-rust-telemetry 24 OTel extractors/injectors, config parsing, topic building
502-rust-http-connector 13 Error alert generation, JSON schema validation
504-mqtt-otel-trace-exporter 25 Correlation ID parsing (traceparent, tracestate, baggage)

Python services (81 tests)

Service Tests Coverage targets
505-akri-rest-http-connector 25 Pydantic model validators, type coercion, range/count validation
506-ros2-connector 15 MQTT topic formatting, payload envelope construction, callback creation
509-sse-connector 19 All 5 SSE event generator methods
510-onvif-connector 22 SOAP fault/XML builders, PTZ commands, device info, imaging settings

Not in scope

  • 508-media-connector: No application code (config files only)

Testing

  • Rust: cargo test passes for all 3 services
  • Python: pytest passes for all 4 services (81/81)

kgmwang1 added 3 commits April 8, 2026 15:10
…tel-trace-exporter

Add 38 unit tests covering pure functions:
- 502: error alert generation, error handler responses, JSON validation (13 tests)
- 504: correlation ID parsing and extraction (25 tests)

Refs: #153
Add 24 unit tests across receiver and sender services:
- Receiver: Payload deserialization (7 tests), CustomUserDataExtractor (7 tests)
- Sender: Payload serialization (5 tests), VecInjector (5 tests)

Refs: #153
- 509-sse-connector: 19 tests for AnalyticsEventSimulator event generators
- 510-onvif-connector: 22 tests for SOAP/XML builders, PTZ commands, imaging
- 505-akri-rest-http-connector: 25 tests for Pydantic model validators
- 506-ros2-connector: 15 tests for BaseMessageHandler MQTT topic/payload helpers
@kgmwang1 kgmwang1 requested a review from a team as a code owner April 8, 2026 20:22
@WilliamBerryiii
Copy link
Copy Markdown
Member

@kgmwang1 - this is awesome!

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.

test(rust): add unit tests for 8 untested Rust services

3 participants