issue#2 收官:按包测试库 + 生产同构审批夹具;短测全量必需门禁 #18

Merged
weichen merged 2 commits from feature/issue2-pg-tests-perpackage-db-2026-09-29 into dev 2026-09-29 10:11:43 +00:00
Collaborator
  • 按包派生测试库(helper 收口 9 处直读 env;advisory lock 防创建竞态)
  • 表所有权合规的快照夹具:docrevision seed 账本表 + docgov 引擎冻结指针/清缓存(arch 机器契约两次拦截错位设计后定型)
  • 固定名夹具唯一化;CAS/ctxmgr 迁移自举;吞掉的错误全部检查
  • 全量并行短测 75 包 0 失败(隔离库实测);CI skip 清单移除
- 按包派生测试库(helper 收口 9 处直读 env;advisory lock 防创建竞态) - 表所有权合规的快照夹具:docrevision seed 账本表 + docgov 引擎冻结指针/清缓存(arch 机器契约两次拦截错位设计后定型) - 固定名夹具唯一化;CAS/ctxmgr 迁移自举;吞掉的错误全部检查 - 全量并行短测 75 包 0 失败(隔离库实测);CI skip 清单移除
agent-bot added 1 commit 2026-09-29 09:54:45 +00:00
fix(tests): per-package test databases + legitimate approval fixtures (issue #2 close)
CI / go-vet (pull_request) Failing after 10s
CI / backup-restore-drill (pull_request) Failing after 25s
CI / web (pull_request) Successful in 33s
ee1e53b510
Root causes of the remaining 5 CI PG failures (and the hidden flaky set):
1. All PG-integration packages shared ONE database under parallel package
   execution - migrations/seeds/truncates raced (nondeterministic failure
   sets, locally and in CI).
   Fix: RequireTestDatabaseURL/SkipIfNoTestDatabaseURL now derive a
   per-package database (<base>_<pkgHash>, advisory-lock-guarded
   CREATE); 9 raw-env straggler tests funnelled through the helpers;
   db-package tests call it unqualified (no import cycle).
2. Approval-chain fixtures were not production-shaped: freezeReviewSnapshot
   only honors head_snapshot_id, fake content hashes never froze a
   snapshot, so ApproverApprove rejected with 'approved requires frozen
   review_snapshot_id'. Errors were swallowed (_, _ =) hiding this.
   Fix (ownership-respecting, arch-enforced):
   - docrevision.SeedContentSnapshotForTest seeds the ledger tables it owns
   - docgov GovernanceEngine.FreezeHeadSnapshotForTest freezes head/review
     pointers on document_records (docgov-owned) and clears engine cache
   - all four integration fixtures use the pair; swallowed errors checked
3. Fixed-name fixtures collide once a package shares one DB (projects
   uq_projects_name_global): uniquified in projectinstance + server tests.
4. CAS/ctxmgr tests never bootstrapped migrations (relied on other packages
   having migrated the shared DB): explicit RunMigrationsOnceForTest.

Verified: full parallel short suite = 75 packages, 0 failures against an
isolated throwaway PG. CI skip list removed - short tests fully required.
agent-bot added 1 commit 2026-09-29 10:03:31 +00:00
fix(web): restore dist/.gitkeep dropped by local build + git add -A
CI / go-vet (pull_request) Successful in 45s
CI / backup-restore-drill (pull_request) Successful in 40s
CI / web (pull_request) Successful in 34s
cbef2157d8
vite build empties web/dist (including the tracked .gitkeep that keeps
go:embed all:dist satisfiable on fresh checkouts); restore it.
weichen approved these changes 2026-09-29 10:11:42 +00:00
weichen left a comment
Owner

issue#2 收官批准:全量短测必需门禁首次全绿。

issue#2 收官批准:全量短测必需门禁首次全绿。
weichen merged commit ed4e17c819 into dev 2026-09-29 10:11:43 +00:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System#18