Skip to content

v1.5.0

Choose a tag to compare

@github-actions github-actions released this 15 Jun 22:28
f67fc3b

Testing

This release is primarily a testing overhaul, bringing project coverage from minimal to ~46% with a solid foundation across all major layers.

Infrastructure

  • Introduced sqlc.Querier interface in db.Store, enabling mock-based testing of the database layer without a real PostgreSQL connection
  • Added gomock-generated mock for sqlc.Querier at db/sqlc/mock
  • Converted stubReader in handlers tests to a configurable struct with function fields, eliminating the need for a separate funcReader type
  • CI coverage filtering now correctly excludes generated code (db/sqlc, docs, iatadb/gen) for accurate badge reporting

Coverage by package

  • db — store mapping logic, pagination, nil pointer handling, conditional field mapping, type conversions across channels, observers, nodes, packets, traces, routes, scopes, stats, and IATAs
  • internal/api/handlers — validation paths and happy paths across all handlers including messages, packets, observers, nodes, stats, routes, scopes, and traces
  • internal/cachegetOrSet cache hit/miss/error/corrupt-entry behaviour, TTL resolution fallback chain, node and observer invalidation
  • internal/config — YAML loading, config seeding, default resolution extracted into testable Resolve function
  • internal/hub — full runtime behaviour including broadcast, subscription lifecycle, lagged notification, OR-scope semantics
  • internal/ingest — pure function coverage for payload parsing, transport code derivation, capability detection, observer type normalisation
  • internal/keystore — key derivation, fingerprinting, store lookup, EntryExists (moved from main)
  • internal/scopestore — load, replace, copy-on-read semantics
  • internal/background — scheduler task execution and context cancellation
  • internal/ws — IP limiter acquire/release/cleanup logic

Refactoring

  • config.Resolve() extracted from main.go to derive runtime defaults with fallback chain — now tested and used at startup
  • keystore.EntryExists() moved from main.go into the keystore package where it belongs

Full Changelog: v1.4.1...v1.5.0