-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Area
Backend — API / GraphQL
Category
Test coverage
Description
The util package is imported by 45 files and provides critical infrastructure (runtime modes, tracing, panic recovery, test DB setup) but has zero tests for its own code.
The irony: it provides RunTestWithDBWipe() and CreateAndMigrateTestDB() used by 12+ test files, but none of its own functions are tested.
Priority test targets:
GetRuntime()— valid/invalid CLI flag combinations- Runtime/Handler validation —
IsValid(),IsPublicGraph(),IsWorker(), etc. GenerateRandomString()— length, character setJsonStringToStringArray()— valid JSON, invalid JSON, emptyRestRequest()— success, HTTP errors, JSON decode errorsMultiSpantracing — Finish with/without error, SetAttribute, disabled context
See src/backend/util/MODULE.md for full analysis.
Affected Files / Packages
src/backend/util/runtime.go (84 lines — runtime mode system, no tests)
src/backend/util/tracer.go (119 lines — OTel span abstraction, no tests)
src/backend/util/tests.go (75 lines — test infra, no tests for itself)
src/backend/util/tracer-graphql.go (63 lines — GraphQL middleware, no tests)
src/backend/util/request.go (45 lines — HTTP client, no tests)
src/backend/util/recovery.go (27 lines — panic handlers, no tests)
src/backend/util/strings.go (23 lines — helpers, no tests)
src/backend/util/random.go (15 lines — random string, no tests)
Reactions are currently unavailable