test: database and item CRUD test coverage #75

Closed
opened 2026-02-13 19:02:46 +00:00 by forbes · 0 comments
Owner

Ref: docs/ROADMAP.md § Appendix B / 1.4 Unit Test Suite

Expand test coverage for the database layer. Existing tests in internal/db/items_test.go cover basics (10 tests) but are missing coverage for:

  • Database connection and transaction handling (error paths, rollback)
  • Item CRUD edge cases (duplicate part numbers, archived items, property validation)
  • Revision creation and retrieval (sequential numbering, rollback, comparison, status/label updates)
  • Project-item associations (tagging, untagging, project-filtered queries)

Existing test files:

  • internal/db/items_test.go (10 tests, 272 lines)
  • internal/db/relationships_test.go (10 tests, 278 lines)
  • internal/db/projects_test.go (5 tests, 119 lines)
  • internal/db/helpers_test.go (1 test, 15 lines)

Goal: Increase db package test coverage to cover all exported functions.

**Ref:** `docs/ROADMAP.md` § Appendix B / 1.4 Unit Test Suite Expand test coverage for the database layer. Existing tests in `internal/db/items_test.go` cover basics (10 tests) but are missing coverage for: - [ ] Database connection and transaction handling (error paths, rollback) - [ ] Item CRUD edge cases (duplicate part numbers, archived items, property validation) - [ ] Revision creation and retrieval (sequential numbering, rollback, comparison, status/label updates) - [ ] Project-item associations (tagging, untagging, project-filtered queries) **Existing test files:** - `internal/db/items_test.go` (10 tests, 272 lines) - `internal/db/relationships_test.go` (10 tests, 278 lines) - `internal/db/projects_test.go` (5 tests, 119 lines) - `internal/db/helpers_test.go` (1 test, 15 lines) **Goal:** Increase db package test coverage to cover all exported functions.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/silo#75