Enhance testing documentation to emphasize the use of embedded/ephemeral Postgres fixtures for tests requiring a database. Update AGENTS.md, README.md, and SKILL.md to reflect this policy and ensure no external DB dependency for standard test runs.
CI / test (push) Successful in 4s
CI / test (push) Successful in 4s
This commit is contained in:
@@ -47,4 +47,5 @@ bun run build
|
|||||||
- Add tests when behavior changes.
|
- Add tests when behavior changes.
|
||||||
- Verify Go tests after backend changes.
|
- Verify Go tests after backend changes.
|
||||||
- Verify Bun tests after TS client changes.
|
- Verify Bun tests after TS client changes.
|
||||||
|
- For DB-required tests, prefer embedded/ephemeral Postgres fixtures over relying on an externally managed database.
|
||||||
- If CI fails due runner/network infrastructure, keep logs explicit in workflow output.
|
- If CI fails due runner/network infrastructure, keep logs explicit in workflow output.
|
||||||
|
|||||||
@@ -97,3 +97,9 @@ Workflow: `.gitea/workflows/ci.yml`
|
|||||||
|
|
||||||
- `go test ./...`
|
- `go test ./...`
|
||||||
- `bun test` in `libs/geo-api-client`
|
- `bun test` in `libs/geo-api-client`
|
||||||
|
|
||||||
|
## Testing policy
|
||||||
|
|
||||||
|
- Keep fast unit tests as the default (`go test ./...`).
|
||||||
|
- If a test requires a real Postgres instance, use embedded/ephemeral Postgres in the test process or test fixture lifecycle.
|
||||||
|
- Do not require manually running an external Postgres container for routine test runs.
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ Use this skill when implementing or debugging backend, frontend integration, Typ
|
|||||||
- Update `internal/app/service.go` first.
|
- Update `internal/app/service.go` first.
|
||||||
- Then wire request/response changes in `internal/http/handlers.go`.
|
- Then wire request/response changes in `internal/http/handlers.go`.
|
||||||
- Add/update tests in `internal/http/api_test.go`.
|
- Add/update tests in `internal/http/api_test.go`.
|
||||||
|
- If persistence behavior is under test, use embedded/ephemeral Postgres fixtures (no external DB dependency for standard test runs).
|
||||||
|
|
||||||
2. Frontend integration changes
|
2. Frontend integration changes
|
||||||
- Update TS client first in `libs/geo-api-client/src/`.
|
- Update TS client first in `libs/geo-api-client/src/`.
|
||||||
|
|||||||
Reference in New Issue
Block a user