docs: update obsidian docs — test count, coverage, a11y, limitations
CI / Env docs check (push) Successful in 15s
CI / Docker compose check (push) Successful in 15s
CI / Nginx config check (push) Successful in 19s
CI / Frontend deps check (push) Successful in 27s
CI / Frontend major deps (push) Successful in 27s
CI / Go build (push) Successful in 36s
CI / Secrets scan (push) Successful in 37s
CI / Frontend build (push) Successful in 44s
CI / Knip (push) Successful in 31s
CI / Frontend a11y check (push) Successful in 1m44s
CI / Go vet (prod) (push) Successful in 1m49s
CI / Go vet (dev) (push) Successful in 1m54s
CI / go mod tidy (push) Successful in 34s
CI / Frontend QC (audit) (push) Successful in 1m2s
CI / Staticcheck (prod) (push) Successful in 3m2s
CI / Staticcheck (dev) (push) Successful in 3m13s
CI / Go vulnerabilities (push) Successful in 1m35s
CI / golangci-lint (push) Successful in 3m41s
CI / Frontend QC (typecheck) (push) Successful in 2m11s
CI / Security scan (prod) (push) Successful in 4m14s
CI / Security scan (dev) (push) Successful in 4m33s
CI / Frontend QC (lint) (push) Successful in 1m54s
CI / Svelte strict check (push) Successful in 1m39s
CI / Tests (prod) (push) Successful in 3m53s
CI / Tests (dev) (push) Successful in 4m6s
CI / Race (prod) (push) Successful in 7m32s
CI / Race (dev) (push) Successful in 7m41s

All obsidian docs updated to reflect current state: test count ~1,642, coverage 50.4%→65.0%, 56 new test files. Overview: added a11y note (Svelte 5 compiler built-in checks), removed duplicate limitations. Technical Manual: coverage pass summary. Testing Architecture: bumped to v5 with coverage stats.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-07-11 14:12:44 +01:00
co-authored by Sisyphus
parent 428e250b4f
commit 9e85bc766b
3 changed files with 7 additions and 6 deletions
+2 -1
View File
@@ -130,6 +130,7 @@ Campaign lifecycle: `draft → active → completed` (or any → `cancelled`, `a
- **No automated DB backups** — no `pg_dump` cron or point-in-time recovery - **No automated DB backups** — no `pg_dump` cron or point-in-time recovery
- **No API documentation** — no OpenAPI/Swagger spec - **No API documentation** — no OpenAPI/Swagger spec
- **L3 progressive rate limiting** — per-IP dual-window (30 req/5s burst + 120 req/60s sustained) on login/register. Account lockout after 5 failures (progressive 15min→2h). - **L3 progressive rate limiting** — per-IP dual-window (30 req/5s burst + 120 req/60s sustained) on login/register. Account lockout after 5 failures (progressive 15min→2h).
- **A11y checks via Svelte 5 compiler** — ESLint a11y plugin rules removed; compiler built-in checks used instead
## Prerequisites ## Prerequisites
@@ -215,7 +216,7 @@ npm run dev # Dev server with HMR
```bash ```bash
cd backend cd backend
go test -tags "test,dev" ./... # 1,251/1,255 tests passed, 4 skipped go test -tags "test,dev" ./... # ~1,642 tests passed
go test -tags "test,dev" -v -run TestName ./... # Single test go test -tags "test,dev" -v -run TestName ./... # Single test
``` ```
+1 -1
View File
@@ -1244,7 +1244,7 @@ Files with this pattern: `bookings.go` (4 handlers), `custom_services.go`, `user
### Test Coverage ### Test Coverage
**1,251/1,255 tests run** across all packages (4 skipped, 0 failures). Recent additions: centralised job scheduler tests (3 — RegisterAll count, schedules, handler signatures), scheduled-cleanup handler tests (21 — NotifyUnpaidOneWeek/Month, TransitionDiscountCampaigns, CleanupExpiredVerificationCodes/RefreshTokens), GDPR export cache cleanup (4), stale login entry cleanup (4), rate limiter cleanup tests (6), rate limiter production behavior tests (6). Self-blocking prevention tests (excludeUserID coverage for GetAvailableHours, EditBookingHandler, AdminRescheduleBookingHandler, ReserveSlotHandler anon IP cleanup, AdminReserveSlotHandler anon IP cleanup), closing_time tests (3), content-type middleware tests (2), booking handler tests (FOR UPDATE overlap checks, admin reserve with closing_time, gift card buy with VAT), and the new admin reservation cancel coverage (12 tests covering walkin + callin + isolation + no-op + idempotency + response format parity, plus 2 inverse-isolation tests on the user-side `cancel_reservation_test.go` to prove the two cancel endpoints are properly partitioned by their WHERE clauses). Booking integration tests continue to expand: duplicate completion guard, daily stamp cap (handler + SQL subquery), invalid status transitions, sequential edit, timezone independence, and past-booking no-show guard. The `clock` package itself has tests for Now() and clock interface correctness. **~1,642 tests run** across all packages (0 failures). Coverage improved from 50.4% to 65.0% via 56 new test files covering booking handlers, user handlers, payments (giftcards, till, refunds), DAV, auth, middleware, validators, zxcvbn, and scheduling. Key additions: coverage improvement tests (bookings_coverage_test.go, user_coverage_test.go, payments coverage expansion — all meaningful error-path tests, not padding), split-lunch detection tests, savepoint/transaction-context tests for time-sensitive operations, VAT lifecycle and parallel-deadlock regression tests, and cleanup of 10 dead test functions flagged by staticcheck U1000.
| Package | Coverage Area | | Package | Coverage Area |
|---------|--------------| |---------|--------------|
@@ -1,6 +1,6 @@
# Testing Architecture & DB Management # Testing Architecture & DB Management
**Last Updated:** July 2026 (v4 — centralised job scheduler tests, 1,255 tests) **Last Updated:** July 2026 (v5 — coverage 50.4%→65.0%, ~1,642 tests)
--- ---
@@ -501,7 +501,7 @@ This appears in `TestAccount_DeleteGuest` and `TestLoyalty_Get`. The `dav.Servic
|--------|-------| |--------|-------|
| Quick check (`-count=1`) | **~13s** | | Quick check (`-count=1`) | **~13s** |
| Packages | 19 tested, 0 failures | | Packages | 19 tested, 0 failures |
| Tests | 1,251/1,255 passed, 4 skipped, 0 failing | | Tests | ~1,642 passed, 0 failing |
New test additions in this batch: New test additions in this batch:
| Test | Coverage | | Test | Coverage |
@@ -520,7 +520,7 @@ New test additions in this batch:
| `TestCancelReservation_DoesNotTouchAnonReservations` | Inverse-isolation test — user cancel ignores `RESERVATION:anon:%` (defensive — the WHERE clause only matches `RESERVATION:user:%`) | | `TestCancelReservation_DoesNotTouchAnonReservations` | Inverse-isolation test — user cancel ignores `RESERVATION:anon:%` (defensive — the WHERE clause only matches `RESERVATION:user:%`) |
| `TestCancelReservation_DoesNotTouchAdminReservations` | Inverse-isolation test — user cancel ignores `RESERVATION:admin:%`. Pairs with the admin-side test that verifies admin cancel ignores `RESERVATION:user:%`. Proves the two endpoints are properly partitioned. | | `TestCancelReservation_DoesNotTouchAdminReservations` | Inverse-isolation test — user cancel ignores `RESERVATION:admin:%`. Pairs with the admin-side test that verifies admin cancel ignores `RESERVATION:user:%`. Proves the two endpoints are properly partitioned. |
**Total tests:** 1,251/1,255 run (4 skipped) across all packages. 0 failures. Growth driven by new `clock` package tests, `closing_time` tests (3), `contenttype` middleware tests (2), expanded booking/payment handler test coverage, admin reservation cancel coverage (12 tests: walkin + callin success, isolation, no-op, unauth, empty ctx, walkin+callin coexistence, anon untouched, response format parity, overlapping reservations deleted, user reservations untouched, idempotent double-cancel), centralised job scheduler tests (3: RegisterAll count, schedules, handler signatures), scheduled-cleanup handler tests (21: NotifyUnpaidOneWeek/Month, TransitionDiscountCampaigns, CleanupExpiredVerificationCodes/RefreshTokens), GDPR export cache cleanup (4), stale login entry cleanup (4), rate limiter cleanup prod tests (6), and rate limiter production behavior tests (6). Two inverse-isolation tests added to the existing user-side `cancel_reservation_test.go` to verify the user and admin cancel endpoints are properly partitioned by `RESERVATION:user:%` / `RESERVATION:admin:%` WHERE clauses. **Total tests:** ~1,642 passed across all packages. 0 failures. Growth driven by: coverage improvement pass (new test files for bookings, user, payments, giftcards, till, refunds, DAV, auth, middleware, validators, zxcvbn — 56 new files, coverage 50.4%→65.0%), VAT lifecycle and parallel-deadlock regression tests, savepoint/transaction-context pattern for time-sensitive tests, split-lunch detection tests, and removal of 10 dead test functions flagged by staticcheck U1000.
### What Drives Test Time ### What Drives Test Time
@@ -637,7 +637,7 @@ This shouldn't appear anymore — the auth package's TestMain was updated to use
### Q: What's the total test count? ### Q: What's the total test count?
1,251/1,255 tests run across all packages (4 skipped). 0 failures. ~1,642 tests run across all packages. 0 failures.
**Notable new tests:** Centralised job scheduler tests (3 — RegisterAll count, schedules, handler signatures), scheduled-cleanup handler tests (21 — NotifyUnpaidOneWeek/Month, TransitionDiscountCampaigns, CleanupExpiredVerificationCodes/RefreshTokens), GDPR export cache cleanup (4), stale login entry cleanup (4), rate limiter cleanup tests (6), rate limiter production behavior tests (6). Duplicate completion guard (idempotent second `"completed"` call), daily stamp cap (two completions same day → 1 stamp), invalid status transitions (no-show→completed rejected with 400), sequential edit (two edits in sequence), timezone independence (UTC in, UTC out — no shift), past-booking no-show guard (past confirmed booking cancelled → `client_cancelled`, not `no_show`). New closing_time tests (3), content-type middleware tests (2), clock package tests, expanded admin reserve overlap tests, expanded gift card buy flow tests with VAT, and full admin reservation cancel coverage (12 tests covering walkin + callin + isolation + no-op + idempotency + response format parity). **Notable new tests:** Centralised job scheduler tests (3 — RegisterAll count, schedules, handler signatures), scheduled-cleanup handler tests (21 — NotifyUnpaidOneWeek/Month, TransitionDiscountCampaigns, CleanupExpiredVerificationCodes/RefreshTokens), GDPR export cache cleanup (4), stale login entry cleanup (4), rate limiter cleanup tests (6), rate limiter production behavior tests (6). Duplicate completion guard (idempotent second `"completed"` call), daily stamp cap (two completions same day → 1 stamp), invalid status transitions (no-show→completed rejected with 400), sequential edit (two edits in sequence), timezone independence (UTC in, UTC out — no shift), past-booking no-show guard (past confirmed booking cancelled → `client_cancelled`, not `no_show`). New closing_time tests (3), content-type middleware tests (2), clock package tests, expanded admin reserve overlap tests, expanded gift card buy flow tests with VAT, and full admin reservation cancel coverage (12 tests covering walkin + callin + isolation + no-op + idempotency + response format parity).