From 9fe0029633a4dadcf558aff759cb5b5c70e79618 Mon Sep 17 00:00:00 2001 From: ila <2+ila@noreply.git.ilapage.cn> Date: Fri, 28 Aug 2026 10:20:39 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E8=AE=B0=E5=BD=95=20Sense=20=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E4=BA=8B=E4=BB=B6=E9=95=BF=E6=9C=9F=E4=BA=8B=E5=AE=9E?= =?UTF-8?q?=20(#73)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Local-Development-and-Verification.-.md | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Local-Development-and-Verification.-.md b/Local-Development-and-Verification.-.md index f244fa4..8e9999e 100644 --- a/Local-Development-and-Verification.-.md +++ b/Local-Development-and-Verification.-.md @@ -392,3 +392,30 @@ D:\supervisor\supervisord.exe ctl /c D:\supervisor\supervisord.conf reload 当前 Go Supervisor 的 `reload` 会重新读取独立配置;实际受影响实例必须以命令输出和 reload 前后 PID 为准。切换托管前先停止占用 Sense 端口的非 Supervisor 实例,防止自动启动进入 Backoff。验证至少包含 Supervisor 状态为 Running、`http://127.0.0.1:18080/health` 与首页返回 200,以及受控重启后 Sense 和受管 MediaMTX PID 均更新。 + +### Sense 本地事件验证 + +合成数据通过 `local_event.SeedSyntheticFixture` 在测试中显式装载,不存在生产自动开关,也不要求 Brain 或 Bell 进程。定向及回归命令: + +```powershell +cd Sense/server +go test -race ./app/sense/local_event +go test ./... +go vet ./... +go build ./... + +cd ../ui +corepack pnpm@9.15.1 lint +corepack pnpm@9.15.1 test:unit +corepack pnpm@9.15.1 build:prod +``` + +PostgreSQL 迁移测试使用独立 schema;连接值只放当前进程环境,不写入仓库或日志: + +```powershell +$env:SENSE_LOCAL_EVENT_MIGRATION_TEST_DATABASE_URL = '<隔离 PostgreSQL 连接>' +go test ./cmd/migrate/migration/version -run TestLocalEventMigrationOnPostgres -count=1 -v +``` + +验证应覆盖:candidate/confirmed 与 pending/success/failed 的独立组合、分页和时间/状态/关键词筛选、详情及保留提示、viewer/实施/站点管理员只读权限、操作审计,以及 Brain/Bell 均未启动时的合成候选 smoke。没有可用 PostgreSQL 测试连接时必须明确记录为未验证,不得以 SQLite 单测替代 PostgreSQL 结论。 +