mirror of
https://github.com/photoprism/photoprism.git
synced 2026-07-17 16:49:04 +00:00
Testing: Document subtest blank-line convention
This commit is contained in:
parent
80ac70cc6a
commit
85c59b1468
2 changed files with 2 additions and 2 deletions
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
## Go Testing Patterns
|
||||
|
||||
- Tests live next to sources (`<file>_test.go`); group cases with `t.Run(...)` using **PascalCase** names (`Success`, `InvalidRequest`).
|
||||
- Tests live next to sources (`<file>_test.go`); group cases with `t.Run(...)` using **PascalCase** names (`Success`, `InvalidRequest`). Consecutive subtests inside the same `Test*` function are written without blank lines between them so the cases read as a compact table; reserve blank lines for separating distinct setup blocks.
|
||||
- Do not run multiple test commands in parallel — suites share fixtures, temp assets, and DB state.
|
||||
- Keep Go scratch work inside `internal/...` (Go refuses `internal/` imports from `/tmp`).
|
||||
- Prefer focused runs: `go test ./internal/<pkg> -run <Name> -count=1`. Avoid `./...` unless needed; heavy packages (`internal/entity`, `internal/photoprism`) take 30–120s on first run.
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ Formatting and test entry points:
|
|||
- Full suite: `make test`, `make lint`
|
||||
- Go-specific lint, format, and package-test rules live in [`internal/AGENTS.md`](internal/AGENTS.md).
|
||||
- Frontend lint, Vitest, acceptance, and Playwright rules live in [`frontend/AGENTS.md`](frontend/AGENTS.md).
|
||||
- Go tests live next to their sources; use PascalCase `t.Run(...)` names for related subtests.
|
||||
- Go tests live next to their sources; use PascalCase `t.Run(...)` names for related subtests. Keep consecutive subtests inside the same `Test*` function back-to-back without blank lines so the cases read as a compact table; reserve blank lines for separating distinct setup blocks.
|
||||
- Do not run multiple test commands in parallel; suites share fixtures, assets, and database state.
|
||||
- Prefer focused test runs such as `go test ./path/to/pkg -run Name -count=1` while iterating.
|
||||
- Use `mariadb -D photoprism` inside the dev shell when you need to inspect MariaDB state directly.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue