docs(p0-5): 集成测试命令补上 -p 1

三个包的 MySQL fixture 都对同一个 schema 做 DROP 加 AutoMigrate。
包级并行会互相踩踏:`Error 1050 Table already exists` 与 `Error 1146 doesn't exist`。
因此 §9.2 的命令必须带 `-p 1`,原样执行会失败。

`AGENTS.md` 的 Integration tests 段同步写明这条约束。

验证:`go test -tags integration -p 1 -count=1 ./internal/video/ ./internal/feed/ ./internal/worker/` 全绿。
This commit is contained in:
2026-11-01 15:40:02 +08:00
parent a0bd798d8a
commit eda8237c36
2 changed files with 5 additions and 1 deletions

View File

@@ -234,6 +234,8 @@ go test -tags integration -count=1 -timeout 300s -v ./internal/middleware/rabbit
Configure endpoints through env vars (`RABBITMQ_TEST_URL`, …), never hardcoded hosts. When a prerequisite is missing — a restart command, a delete-queue command — `t.Skip` with the reason; a silent pass is not a substitute for a skip.
The MySQL fixtures each `DropTable` + `AutoMigrate` the shared schema, so run more than one such package at a time with `-p 1`. Without it the packages run in parallel and drop each other's tables (`Error 1050 Table already exists`, `Error 1146 doesn't exist`).
### Determinism and speed
- No real network in unit tests; no `time.Sleep` as synchronization. Prefer channels, context deadlines, or an injected clock. Tests must pass under `-race` and in any order.