Skip to content

Unit tests#81

Merged
rustyeddy merged 4 commits intomainfrom
unit-tests
Jan 11, 2026
Merged

Unit tests#81
rustyeddy merged 4 commits intomainfrom
unit-tests

Conversation

@rustyeddy
Copy link
Copy Markdown
Owner

Added unit tests.

@rustyeddy rustyeddy added this to the MVP milestone Jan 11, 2026
@rustyeddy rustyeddy self-assigned this Jan 11, 2026
Copilot AI review requested due to automatic review settings January 11, 2026 16:54
@rustyeddy rustyeddy added the Testing Add testing or increase test coverage label Jan 11, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds comprehensive unit tests across multiple packages in the OttO IoT framework, along with documentation improvements and some new implementation code.

Changes:

  • Added unit test files for core packages: utils, station, server, data, messenger, and rules
  • Added documentation comments to public APIs and methods
  • Introduced new utility code (stats, logging, timers, station management) with corresponding tests
  • Added example applications demonstrating framework usage

Reviewed changes

Copilot reviewed 19 out of 84 changed files in this pull request and generated no comments.

Show a summary per file
File Description
rules/toggle_on_rising.go Added documentation comments for public functions
rules/rules_test.go Added comprehensive tests for rule runner and follow functionality
rules/rules.go Added documentation comments for Rule interface and Runner
rules/follow.go Added documentation comments for Follow rule
messenger/wire_typed_test.go Added tests for wiring typed sources and sinks with MQTT
messenger/topics_test.go Added tests for topic path generation and state handling
messenger/topics.go Added documentation comments and cleaned up formatting
messenger/registry_test.go Added comprehensive registry tests including device lifecycle
messenger/registry.go Added documentation comments for public APIs
messenger/payloads_test.go Added tests for JSON payload marshaling
messenger/payloads.go Added documentation comments for payload structures
messenger/mqtt_client.go Added documentation comments for MQTT abstractions
messenger/mqtt/paho_test.go Added comprehensive Paho MQTT client tests
messenger/messenger_test.go Added tests for messenger subscription management
messenger/messenger.go Added documentation comments and improved function naming
messenger/codec/json_test.go Added tests for JSON codec round-trip operations
_utils/ New package with stats, timers, logging, station naming, and random utilities plus comprehensive tests
_station/ New package for station management with device management, metrics tracking, and HTTP endpoints plus tests
_server/ New server package with HTTP server, WebSocket support, and ping endpoint plus tests
_data/ New data package for time series data management plus tests
_otto.go Main OttO controller implementation with initialization and lifecycle management
_examples/ Example applications demonstrating logging and device control
_cmd/ottoctl/ Command-line tool testdata and entry point
Comments suppressed due to low confidence (1)

_examples/logging/main.go:10

  • The import path has been changed to "_utils" (with underscore prefix), but this appears to be inconsistent with the actual package structure. The underscore prefix typically indicates internal or private packages in Go, but this seems like it should be a public utils package based on usage patterns in other files.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to move this back into the live code.

@rustyeddy rustyeddy merged commit 12122d2 into main Jan 11, 2026
7 of 8 checks passed
@rustyeddy rustyeddy deleted the unit-tests branch January 11, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Testing Add testing or increase test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants