Files
user-system/.workbuddy/memory/2026-04-06.md
long-agent 5b6bd93179 refactor: 整理项目根目录结构
整理内容:
- 删除 60+ 临时测试输出文件 (*.txt)
- 移动二进制文件到 bin/ 目录
- 移动 Shell 脚本到 scripts/ 目录
  - scripts/dev/: check_gitea.sh, check_sub2api.sh, run_tests.sh
  - scripts/deploy/: deploy_*.sh, simple_deploy.sh
  - scripts/ops/: fix_nginx.sh, fix_ssl.sh, install_docker.sh
  - scripts/test/: test_*.sh, test_*.bat
- 移动批处理文件到 scripts/
- 移动 Python 脚本到 tools/
- 清理临时日志文件

保留根目录必要文件:
- go.mod, go.sum, go.work
- Makefile, docker-compose.yml
- .env.example, .gitignore
- README.md, AGENTS.md, DEPLOY_GUIDE.md

验证: go build ./... && go test ./... 通过
2026-04-07 18:10:36 +08:00

19 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 2026-04-06 工作日志
## 方案一business_logic_test.go优化 ✅ 已完成
- 共享 DB → 隔离 DBcache=private + newIsolatedDB
- testEnv 结构体 + setupTestEnv() 模式
- 新增 3 个并发测试 CONC_001~003含 SQLite 锁重试机制)
- 删除死代码getDBForTest, getUserRoleRepo, setupBusinessLogicTestServer
- 全部测试通过,编译通过
## 方案二scale_test.go优化 ✅ 已完成
- 19 个规模/并发测试全部从 setupScaleTestDB 迁移到 newIsolatedDB
- P99/P95 延迟统计覆盖 11 个查询场景
- 双阈值 SLA 体系SQLite 本地宽松 + PG 生产目标严格
- 新增 3 个并发压测CONC_001(注册) / CONC_002(设备) / CONC_003(日志)
- runConcurrent 辅助函数5次重试 + 指数退避)
- 删除死代码setupScaleTestDB, ptrInt64
- 保留辅助函数generateTestUsers, ptrString, ptrDeviceStatus, generatePermissionTree, generateDeepPermissionTree
- **最终验证173 测试全部通过19 Scale + 154 BusinessLogic编译通过**