test: add missing tests and fix hanging transport test

New test packages:
- config/loader_test.go: 5 tests (valid, minimal, missing file, pulsar-only, defaults)
- serial/serial_test.go: 6 tests (interface, read, EOF, close, empty)
- app/app_test.go: 5 tests (New, dispatch store/send, error handling, ctx cancellation)

Enhanced test packages:
- storage/store_test.go: +3 tests (concurrent insert, close/reopen, init clears)
- telegram/parser_test.go: +5 tests (concurrency, rawLog, empty, multiline, removeEmpty)
- transport/transport_test.go: +7 tests, +fixes

Fixes:
- app.go: store field type *storage.Store -> storage.Repository (supports mocking)
- transport_test: fix net.Pipe() sync deadlock in SetConnClosesPrevious
- transport_test: fix MultiSender_ErrorPropagation expectations

Results: 6 packages, 30+ tests, all pass with -race
This commit is contained in:
w1ndyb0y
2026-07-10 16:05:19 +08:00
parent 86d473c03d
commit 7f65004cd4
7 changed files with 852 additions and 2 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ type App struct {
rawLog *rotatelogs.RotateLogs
port *serial.Port
parser *telegram.Parser
store *storage.Store
store storage.Repository
sender transport.Sender
tcpSrv *transport.TCPServer