This directory contains unit tests, integration tests, and end-to-end tests for the presence system. Tests are organized by package/component.
| Package | Type | Description |
|---|---|---|
tests/appcontext |
Unit | AppState (beacon lookup, beacons, settings, beacon events) |
tests/utils |
Unit | ParseADFast, RemoveFlagBytes, CalculateDistance, LoopADStructures |
tests/kafkaclient |
Unit | KafkaManager (Init, Populate, GetReader/Writer) - requires E2E_TEST=1 |
tests/model |
Unit | BeaconEvent (Hash, ToJSON), ParserRegistry, Config |
tests/controller |
Unit | HTTP handlers (gateways, trackers, zones, settings) |
tests/service |
Unit | SendParserConfig, LocationToBeaconService |
tests/config |
Unit | Config constants, Load with env vars |
tests/logger |
Unit | CreateLogger, cleanup |
tests/location |
Unit | Location scoring formula, CalculateDistance |
tests/bridge |
Unit + Integration | MQTT handler, event loop, Kafka integration |
tests/decoder |
Unit + Integration | decodeBeacon, parser registry, event loop |
tests/e2e |
E2E | Placeholder (skipped unless E2E_TEST=1) |
go test ./tests/... -count=1
go test ./tests/... -v
go test ./tests/appcontext/ -v
go test ./tests/controller/ -v
E2E_TEST=1 go test ./tests/... -count=1
go test ./tests/... -short