Commit Graph

4 Commits

Author SHA1 Message Date
Your Name
85dac3ad44 fix: 修复 TimeoutMiddleware 并发问题并更新测试文档
问题修复:
- 修复 TimeoutMiddleware 死锁问题(嵌套锁调用)
- 修复竞态条件(responseSent 标志确保只发送一次响应)
- 基准测试超时从 5ms 改为 100ms 避免 race 检测不稳定

文档更新:
- 添加中间件并发测试要点(testing_strategy_v1.md)
- 添加 TimeoutMiddleware 并发安全经验(project_experience_summary.md)
- 更新测试覆盖率报告
- 新建项目状态报告
2026-04-08 18:20:40 +08:00
Your Name
4349666ccb docs: enhance testing strategy to v1.2 with industry best practices
Based on expert review, key improvements:

1. Standardize testing pyramid to 3 layers (Unit/Integration/E2E)
   - Remove non-standard "Component" layer
   - Add target percentages per industry standards

2. Add test utilities infrastructure
   - testutil/factory/ - Test data factories
   - testutil/mock/ - Unified mock library
   - testutil/assert/ - Custom assertions

3. Add missing build tags
   - //go:build slow for performance tests
   - //go:build e2e for E2E tests

4. Add performance regression testing guidelines

5. Fix flaky test handling
   - Proper use of context timeout
   - Skip flaky tests in local dev, run in CI

6. Update references to Google Testing Blog and Atlassian Testing Guide

Coverage targets remain aligned with industry:
- Unit: 70-80%
- Integration: 15-20%
- E2E: 5-10%
2026-04-08 10:23:13 +08:00
Your Name
698759b665 docs: refine testing strategy based on code review
Changes:
- docs/testing_strategy_v1.md v1.1:
  - Clarify test pyramid with build tags (unit/integration/e2e)
  - Add Middleware to priority module list
  - Add coverage run discrepancy warning (individual vs ./...)
  - Update action items to reflect completed work
  - Add race detector usage guidelines
  - Add test cleanup patterns

- reports/test_coverage_report_2026-04-08.md:
  - Clarify coverage run discrepancy (individual vs ./...)
  - Add dual columns: individual run vs combined run
  - Update status to  all key modules passing
  - Add week-over-week trending
  - Remove incorrect "emergency" status
2026-04-08 10:15:45 +08:00
Your Name
e21021c88c docs: add testing strategy and coverage report
- docs/testing_strategy_v1.md: comprehensive testing strategy
  - Test pyramid definition (Unit/Integration/E2E)
  - File naming conventions
  - Mock interface guidelines
  - Coverage requirements
  - Test execution commands
  - Common issues solutions

- reports/test_coverage_report_2026-04-08.md: current coverage status
  - Module-by-module breakdown
  - Coverage达标情况
  - Mock implementations inventory
  - Next action items

- CLAUDE.md: update test specifications
  - Add audit store mock signature
  - Detailed coverage targets per module
  - Test naming conventions
2026-04-08 10:08:33 +08:00