Skip to content

Improve test coverage for store package (DAL, 18 importers) #23

@BrewingCoder

Description

@BrewingCoder

Area

Backend — Database / Models

Category

Test coverage

Description

The store package is the data access layer wrapping PostgreSQL, Redis, ClickHouse, Kafka, and S3. It has 13 test files (1,199 lines) but key consistency paths are untested.

Priority test targets:

  1. Error group dual-write consistency (PostgreSQL → ClickHouse → Kafka)
  2. Cache invalidation after writes (manual Redis key deletion)
  3. Service upsert concurrency (ON CONFLICT behavior)
  4. Pagination edge cases (empty sets, single item, boundary cursors)
  5. GitHub rate limiting state transitions

Known risks:

  • No optimistic locking — concurrent updates are last-write-wins
  • Manual cache invalidation — missing invalidation = stale reads
  • Inconsistent preloading patterns (GORM Preload vs manual map building)

See src/backend/store/MODULE.md for full analysis.

Affected Files / Packages

src/backend/store/stacktraces.go (299 lines)
src/backend/store/error_groups.go (199 lines)
src/backend/store/services.go (198 lines)
+ 14 more files, 13 test files

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions