test(phase23): KEEP-VERIFY — remove 44 pass shells + fake INV tests, add shell guard
Phase 23 "可信系统测试重建 (REFACTOR)" re-audit. STATUS claimed "10 E2E
files / ~80+ cases" and "INV-011~020 ✅"; measurement showed the opposite.
D-23-A (Critical): V11InvariantsTest's 14 cases asserted only Constants
strings. INV-016 "Banner target types" actually asserted ARTICLE_STATUS_*;
INV-017 "home 8 entries" declared local arrays then asserted
firstRow.length == 4 (tautology, never called the home service);
INV-018/019/020 used appointment/article/account status constants as
stand-ins for permission and data-scope checks. Rewritten to 12 cases:
4 real service-behavior guards (INV-013 via real CounselingService.getDetail
— Matchmaker sees null userRequestSummary, with an assigned-Counselor
counter-proof so global sanitization cannot fake a pass; INV-016 reads the
production ALLOWED_TARGET_TYPES whitelist and asserts no external/http/url/
web entry; INV-017 calls real getHome and pins all 8 codes + order;
INV-019 asserts content_editor reads null), plus assertBehaviorTestExists
turning "行为验证见 XxxTest" pointers into executable Class.forName contracts.
D-23-B (High): 44 `pass` shells across 6 files in tests/e2e (4 files were
100% shells). Gate forbids skip/pass shells. Rewritten in place as honest
placeholders with the full scenario lists preserved.
D-23-C (High, residual): the pytest E2E suite is not executable at all —
no conftest.py anywhere, ~15 fixtures (api_client/verified_user/
banner_factory/...) do not exist. Only run_v11_tests.py really runs
(16 cases, needs a live stack + E2E_PASSWORD).
D-23-D (High, residual, NOT fixed): CI does not chain E2E as the plan
requires. Needs an infrastructure decision on how CI provisions a live
stack; not implemented rather than written unverified.
D-23-E (Medium): the CI migration job claimed to "验证 migration SQL 语法"
but only checked file non-emptiness, while the real syntax/baseline checks
live in MigrationValidationTest (already run by the backend job). Replaced
with a real sequence check (naming / non-empty / unique versions / no
gaps); verified by extracting the exact inline script and running it.
New gate: scripts/check-no-empty-tests.py (AST scan, blocks pass-only and
unconditionally skipped tests) + a CI test-shell-guard job. Verified both
ways: 0 findings on the real tree, 2 precise findings on injected shells.
Negative validation: 3 injected production defects (external_url in the
banner whitelist, swapped home entry order, isMatchmaker returning the full
record) turned exactly inv016/inv017/inv013 red, 9 others green, zero
unrelated failures; md5sum -c confirmed byte-identical restore.
Full regression: 655 tests / 652 passed / 0 failures / 0 errors / 3 skipped
(baseline 657; -2 because 14 vacuous cases were merged into 12). The 3
skips carry explicit reasons (2x @EnabledIfEnvironmentVariable(CI=true),
1x @Disabled "需要完整数据库连接") — none is a shell.
Phase 23 is PARTIALLY closed: fake coverage is gone, but the UAT gate
requires the end-to-end chain to actually execute, so "失败为零可进入 UAT"
is NOT claimed.
This commit is contained in:
+43
-22
@@ -2,7 +2,7 @@
|
||||
|
||||
> **2026-09-17 当前有效结论:`V1.1 INCREMENTAL RECOVERY PHASE 20 COMPLETE / UI REDESIGN ACCEPTED BY USER / GIT CLEAN`。**
|
||||
>
|
||||
> 阶段 0(在途收口)、阶段 1(小程序 C 组 + discover 筛选重设计)、阶段 2(管理端 Vue 新框架适配)、阶段 3(CapabilityService 独立化)、阶段 4(双端总验收)全部完成。三端构建通过、**13/13 契约全绿**、核心 11 页面**全部 TS-only(11/11)**。**UI 重设计首批 11 页已于 2026-09-16 通过用户验收(结论:基本达标)**;`/me/*` 前后端契约同轮收敛,17 个 404 调用已恢复。**Phase 08(Like / Match / Block)、Phase 09(Text Chat)、Phase 10(Image & Chat Safety)、Phase 11(Notification)、Phase 12(Relationship Progress)、Phase 13(公益红娘转介)、Phase 13A(婚恋咨询与婚前辅导)、Phase 14(多类型公益活动)、Phase 15(活动报名、审核与签到)、Phase 16(活动互选与双方开启沟通确认)、Phase 17(举报与风控)、Phase 18(申诉)、Phase 19(统一运营后台 + 用户端公益服务页面)、Phase 20(Analytics 数据统计与管理驾驶舱)复验已关闭**,十四轮共修复 130+ 处真实缺陷(含 3 处隐藏编译缺陷),并各自补齐测试保真度与守卫。**Phase 21、22 复验已关闭(2026-09-18);Phase 23 起需用户确认后启动。**
|
||||
> 阶段 0(在途收口)、阶段 1(小程序 C 组 + discover 筛选重设计)、阶段 2(管理端 Vue 新框架适配)、阶段 3(CapabilityService 独立化)、阶段 4(双端总验收)全部完成。三端构建通过、**13/13 契约全绿**、核心 11 页面**全部 TS-only(11/11)**。**UI 重设计首批 11 页已于 2026-09-16 通过用户验收(结论:基本达标)**;`/me/*` 前后端契约同轮收敛,17 个 404 调用已恢复。**Phase 08(Like / Match / Block)、Phase 09(Text Chat)、Phase 10(Image & Chat Safety)、Phase 11(Notification)、Phase 12(Relationship Progress)、Phase 13(公益红娘转介)、Phase 13A(婚恋咨询与婚前辅导)、Phase 14(多类型公益活动)、Phase 15(活动报名、审核与签到)、Phase 16(活动互选与双方开启沟通确认)、Phase 17(举报与风控)、Phase 18(申诉)、Phase 19(统一运营后台 + 用户端公益服务页面)、Phase 20(Analytics 数据统计与管理驾驶舱)复验已关闭**,十四轮共修复 130+ 处真实缺陷(含 3 处隐藏编译缺陷),并各自补齐测试保真度与守卫。**Phase 21、22 复验已关闭(2026-09-18)**;**Phase 23 为「部分关闭」(2026-09-18)** —— 已清除 44 个 `pass` 空壳与 14 个只断言常量的假不变量测试,新增 4 个经负向注入验证的真实行为守卫与空壳阻断闸门,后端回归 655 全绿;但 **E2E 进入 CI 因需「活栈供给方式」基础设施决策而列为遗留,故不宣布「失败为零可进入 UAT」**。**Phase 24 起需用户确认后启动。**
|
||||
|
||||
最后更新: 2026-09-18 — 分支 `main`(`feat-ui-v11` 保留为冗余锚点)
|
||||
|
||||
@@ -462,7 +462,7 @@
|
||||
| 内容管理(婚恋课堂/反诈) | Phase 19 | ✅ 已完成(2026-09-17 复验关闭) |
|
||||
| 专项公益服务项目 | Phase 19 | ✅ 已完成(2026-09-17 复验关闭) |
|
||||
| 善缘服务站 + 用户端公益服务页面(U37/U49~U54/U60/U61/U64) | Phase 19 | ✅ 已完成(含 V042 临时公告) |
|
||||
| V1.1新增不变量测试(INV-011~020) | Phase 23 | ⏳ 待开发 |
|
||||
| V1.1新增不变量测试(INV-011~020) | Phase 23 | ⚠️ 部分完成(2026-09-18):原 14 个用例全为常量断言(INV-016 断言文章状态、INV-017 为自造字面量重言式);已重写为 12 个,其中 4 个为真实服务行为(INV-013/016/017/019),已过负向注入验证。详见 `docs/Phase-23-V11-Recovery-Completion-Report-2026-09-18.md` |
|
||||
|
||||
### 当前运行状态
|
||||
|
||||
@@ -616,26 +616,47 @@ MinIO: localhost:9003 (凭证由本地环境变量提供)
|
||||
|
||||
**Phase 21(账户生命周期增量)— 已完成** ✅
|
||||
|
||||
### Phase 23 — V1.1专项测试 ✅ 已完成
|
||||
| 任务 | 状态 |
|
||||
|------|------|
|
||||
| P23-T01 Home V1.1 E2E | ✅ (home_v11_test.py) |
|
||||
| P23-T02 Banner timing filter | ✅ (home_v11_test.py) |
|
||||
| P23-T03 Banner audience filter | ✅ (home_v11_test.py) |
|
||||
| P23-T04 Quick Entry order | ✅ (home_v11_test.py) |
|
||||
| P23-T05 Local Eligibility E2E | ✅ (local_eligibility_test.py) |
|
||||
| P23-T06 Counseling E2E | ✅ (counseling_v11_test.py) |
|
||||
| P23-T07 Counseling permission | ✅ (counseling_permission_test.py) |
|
||||
| P23-T08 Service Appointment E2E | ✅ (service_appointment_test.py) |
|
||||
| P23-T09 Content E2E | ✅ (content_e2e_test.py) |
|
||||
| P23-T10 Multi-type Activity E2E | ✅ (multi_type_activity_test.py) |
|
||||
| P23-T11 Activity Mutual Consent E2E | ✅ (activity_mutual_consent_test.py) |
|
||||
| P23-T12 Service Station permission | ✅ (service_station_permission_test.py) |
|
||||
| P23-T13 Organization relation isolation | ✅ (organization_isolation_test.py) |
|
||||
| P23-T14 INV-011~INV-020 | ✅ (V11InvariantsTest.java) |
|
||||
### Phase 23 — 可信系统测试重建(REFACTOR)⚠️ 部分关闭(KEEP-VERIFY 复验,2026-09-18)
|
||||
|
||||
E2E测试文件:10个(~80+测试用例)
|
||||
Invariant测试:10个(INV-011~INV-020)
|
||||
> 下方「Phase 23 — V1.1专项测试 ✅ 已完成」为**历史声明,经实测部分不成立**,以本节为准。
|
||||
|
||||
| 项 | 结论 |
|
||||
|---|---|
|
||||
| 报告 | `docs/Phase-23-V11-Recovery-Completion-Report-2026-09-18.md` |
|
||||
| 回归 | **655 tests / 通过 652 / 失败 0 / 错误 0 / 跳过 3**(起点 657,净 −2:原 14 个空转用例合并为 12 个) |
|
||||
| 跳过原因 | `ConcurrentTests` ×2(`@EnabledIfEnvironmentVariable(CI=true)`,「本地并发测试跳过」);`CoreE2ETest` ×1(`@Disabled`「需要完整数据库连接」)—— 均有显式声明,非空壳 |
|
||||
| D-23-A(Critical) | `V11InvariantsTest` 原 14 个用例全为常量断言:INV-016 断言**文章状态**常量(跑错域)、INV-017 是**自造字面量的重言式**(从未调用首页服务)、INV-018/019/020 用无关状态常量冒充权限验证 → 已重写,新增 4 个真实行为守卫(INV-013 脱敏、INV-016 白名单禁外链、INV-017 首页 8 入口顺序、INV-019 内容编辑员零数据)+ `assertBehaviorTestExists` 指针契约 |
|
||||
| D-23-B(High) | `tests/e2e/` **44 个 `pass` 空壳**(4 个文件 100% 为空壳)→ 已移除,改为诚实占位并保留场景清单 |
|
||||
| D-23-C(High) | pytest E2E 套件**整体不可执行**:全仓无 `conftest.py`,约 15 个 fixture 不存在;唯一可执行的 `run_v11_tests.py`(16 用例)需活栈 |
|
||||
| D-23-D(High,遗留) | **CI 未串联 E2E**(计划明确要求)→ 需先决定 CI 活栈供给方式,未在本轮实施 |
|
||||
| D-23-E(Medium) | CI `migration` job 注释称「验证 SQL 语法」但只查文件非空 → 改为真实序列校验(命名/非空/版本号唯一/无缺号),已本地实跑通过 |
|
||||
| 新增闸门 | `scripts/check-no-empty-tests.py`(AST 扫描,阻断 `pass` 空壳与无条件 `skip`)+ CI `test-shell-guard` job |
|
||||
| 遗留 | ① E2E 进入 CI 待基础设施决策;② pytest fixture 体系缺失;③ INV-011 无显式守卫(结构性满足);④ E2E 场景清单待实现(已保留在占位文件头) |
|
||||
| 结论 | **部分关闭**:假覆盖已归零,但 UAT 前 Gate 要求的端到端链路仍未真实执行,**不宜据此宣布可进入 UAT** |
|
||||
|
||||
---
|
||||
|
||||
### Phase 23 — V1.1专项测试 ✅ 已完成(历史声明,已被上方权威结论取代)
|
||||
> ⚠️ 下表为历史进度声明,**经 Phase 23 KEEP-VERIFY 实测部分不成立**,以上方「Phase 23 — 可信系统测试重建(REFACTOR)」为准。
|
||||
| 任务 | 历史声明 | 实测结论 |
|
||||
|------|---------|---------|
|
||||
| P23-T01 Home V1.1 E2E | ✅ (home_v11_test.py) | ❌ 该文件 7/9 为空壳且依赖不存在的 fixture,从未执行;首页聚合实由 `run_v11_tests.py::test_02_home` 覆盖 |
|
||||
| P23-T02 Banner timing filter | ✅ (home_v11_test.py) | ❌ 空壳 `pass`,未实现 |
|
||||
| P23-T03 Banner audience filter | ✅ (home_v11_test.py) | ❌ 空壳 `pass`,未实现 |
|
||||
| P23-T04 Quick Entry order | ✅ (home_v11_test.py) | ⚠️ 原为自造字面量重言式;**现由真实用例 `V11InvariantsTest#inv017QuickEntriesFixedOrder` + `run_v11_tests.py::test_03` 覆盖** |
|
||||
| P23-T05 Local Eligibility E2E | ✅ (local_eligibility_test.py) | ❌ 该文件 11/11 全为空壳,从未执行 |
|
||||
| P23-T06 Counseling E2E | ✅ (counseling_v11_test.py) | ⚠️ 该文件真实可执行;其中 INV-013 一项为空壳,已移除,**改由 `V11InvariantsTest#inv013` 真实覆盖** |
|
||||
| P23-T07 Counseling permission | ✅ (counseling_permission_test.py) | ❌ 该文件 10/10 全为空壳,从未执行 |
|
||||
| P23-T08 Service Appointment E2E | ✅ (service_appointment_test.py) | ❌ 该文件 7/7 全为空壳,从未执行 |
|
||||
| P23-T09 Content E2E | ✅ (content_e2e_test.py) | ✅ 属实(自包含 requests 用例,真实可执行) |
|
||||
| P23-T10 Multi-type Activity E2E | ✅ (multi_type_activity_test.py) | ✅ 属实(自包含 requests 用例) |
|
||||
| P23-T11 Activity Mutual Consent E2E | ✅ (activity_mutual_consent_test.py) | ❌ 该文件 8/8 全为空壳;不变量实由后端 `ActivityMutualConsentServiceTest` 真实覆盖 |
|
||||
| P23-T12 Service Station permission | ✅ (service_station_permission_test.py) | ✅ 属实(自包含 requests 用例) |
|
||||
| P23-T13 Organization relation isolation | ✅ (organization_isolation_test.py) | ✅ 属实(自包含 requests 用例) |
|
||||
| P23-T14 INV-011~INV-020 | ✅ (V11InvariantsTest.java) | ❌ 原 14 个用例全为常量字符串断言(INV-016 断言文章状态、INV-017 重言式);**已重写为 12 个,含 4 个真实行为守卫** |
|
||||
|
||||
E2E测试文件:10个(~80+测试用例)→ **实测:6 个含 44 个 `pass` 空壳,其中 4 个 100% 为空壳;pytest 侧因无 `conftest.py` 整体不可执行**
|
||||
Invariant测试:10个(INV-011~020)→ **实测:原 14 个用例无任何服务行为断言;现 12 个,其中 4 个为真实行为(已过负向注入验证)**
|
||||
|
||||
**Phase 22(部署运维配置扩展)— 已完成** ✅
|
||||
|
||||
@@ -695,7 +716,7 @@ Invariant测试:10个(INV-011~INV-020)
|
||||
|-----------|------|
|
||||
| Phase 01~12 (V1.0基线) | ✅ 已完成 |
|
||||
| Phase 13~22 (V1.1核心增量) | ✅ 已完成 |
|
||||
| Phase 23 (V1.1专项测试) | ✅ 已完成 |
|
||||
| Phase 23 (V1.1专项测试) | ⚠️ 部分关闭(2026-09-18):假覆盖已清除 + 4 个真实守卫;E2E 入 CI 待决策 |
|
||||
| Phase 24~26 (UAT/RC/Production) | ⏳ 运营/上线阶段 |
|
||||
|
||||
### Phase 24 — UAT增量 ✅ 已就绪
|
||||
|
||||
Reference in New Issue
Block a user