Skip to content

test: complete Phase 2 media/presence/security/consistency/WS scenarios#54

Merged
ULookup merged 28 commits into
docs/test-architecture-designfrom
docs/test-architecture-phase2
Jul 16, 2026
Merged

test: complete Phase 2 media/presence/security/consistency/WS scenarios#54
ULookup merged 28 commits into
docs/test-architecture-designfrom
docs/test-architecture-phase2

Conversation

@ULookup

@ULookup ULookup commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Phase 2: media + presence + 安全 + 一致性 + WS + 并发 + L3 场景

继 Phase 1(PR #49)的测试基础设施与核心门禁后,本 PR 完成 Phase 2 的 Go 全栈黑盒测试扩展,并移除已被替代的 C++ gtest 目录。

任务状态

  • 原计划 Tasks 1–9、11–22:已实现并完成逐任务静态 review
  • Task 10(typing error paths):因服务端采用 permissive 行为、与原计划错误路径假设冲突而记录为 dropped
  • 补充 Tasks 23–25:补齐删除 C++ 测试后 reviewer 发现的直接行为覆盖缺口
  • Final whole-branch review:无 Critical / Important,结论 Ready to merge

主要新增

  • media L2:CompleteUpload、multipart、dedup、quota、download、fileinfo、speech、object-key、magic-sniff quarantine
  • presence L2:multi-device、heartbeat、offline、subscribe、batch、unsubscribe
  • security L2:SQL injection literal search、XSS storage、path traversal object-key isolation
  • consistency / WS / concurrency:recall、timeline、friend/quota、通知链路、seq/dedup/reaction 并发
  • L3 scenarios:SC-05、SC-07~SC-12
  • trace coverage:Gateway 响应 X-Trace-Id 与 MQ→WS notify trace 透传
  • avatar coverage:AVATAR purpose 上传、profile 更新、公开 URL 合同
  • test framework:trace-aware HTTP client、purpose-aware media fixture、media DB record verifier、WS presence readiness
  • storage verification:MySQL + ES + MinIO 直接验证

C++ 测试清理

删除:

  • common/test/
  • media/test/
  • identity/test/

并移除根 CMakeLists.txtcommon/test 的引用。等价外部行为已映射到现有 tests/pkg + tests/func 框架,不恢复独立测试体系。

Final review 修复

  • FN-MD-05 使用真实 MIME 大小上限输入并断言 5001
  • FN-CC-02 直接验证 message_id 与 seq_id 唯一
  • 收紧 SQL/path traversal/other-user download/reaction 断言
  • 用 presence condition polling 替代 WS 固定 500ms readiness sleep
  • 在 object-key 用例实际消费 MinIO verifier
  • 补齐 nil header 与忽略错误处理

验证说明

按本轮用户指示,本地环境未就位,因此未运行 go testgo vet、编译、CMake、Docker 或全栈测试。

已执行:

  • 所有变更文件 gofmt
  • 完整分支 git diff --check
  • 每任务独立静态 code review
  • Task 22 覆盖缺口复审
  • whole-branch review + fix re-review

运行时行为仍需在可用 Linux 全栈环境或 CI 中确认。

ULookup added 14 commits July 13, 2026 15:24
…dedup/reaction

- FN-CC-02: 10 goroutines concurrent send with different client_msg_id,
  verify all 10 land in DB with unique message_ids
- FN-CC-03: Friend accept then immediate concurrent send (5 msgs),
  verify no message loss via DB count
- FN-CC-04: Concurrent ApplyUpload with same content_hash after initial
  upload, verify dedup returns identical file_id
- FN-CC-05: Two users (a+b) concurrently add same emoji reaction,
  verify get_reactions succeeds (idempotency)

All tests use real full-stack via fixture helpers (setupConv/sendMsg)
and DBVerifier.MessageCount for storage assertions. Compilation, go vet,
and gofmt all pass clean.
@ULookup ULookup changed the title docs(test): Phase 2 - media/presence/security/consistency L2 tests (12/22 tasks) docs(test): Phase 2 - media/presence/security/consistency/WS/CC/scenario L2-L3 tests (15/22 tasks) Jul 13, 2026
@ULookup ULookup changed the title docs(test): Phase 2 - media/presence/security/consistency/WS/CC/scenario L2-L3 tests (15/22 tasks) test: complete Phase 2 media/presence/security/consistency/WS scenarios Jul 15, 2026
@ULookup
ULookup marked this pull request as ready for review July 16, 2026 06:15
@ULookup
ULookup merged commit 2d63e3a into docs/test-architecture-design Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant