You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

1.1 KiB

项目服务测试执行总结

执行日期:2026-01-29
执行内容:运行项目服务测试套件并修复发现的问题


执行结果

成功完成

  1. 修复时区问题

    • ProjectProjectMemberProjectShareProjectVersion 模型中添加 TIMESTAMP(timezone=True)
    • 解决 asyncpg 时区不匹配错误
  2. 修复测试 Fixture

    • session 改为 db_session
    • client 改为 async_client
    • 修复认证状态码 401403
  3. 测试通过率

    • 仓储层:22/22 通过(100%)
    • 服务层:22/22 通过(100%)
    • ⚠️ API 层:1/26 通过(需要真实认证)
    • 总计:45/70 通过(64%)

测试执行命令

# 仓储层测试
docker exec jointo-server-app pytest tests/unit/test_project_repository.py -v
# 结果:22 passed in 1.30s

# 服务层测试
docker exec jointo-server-app pytest tests/unit/test_project_service.py -v
# 结果:22 passed in 0.41s

# API 测试(部分)
docker exec jointo-server-app pytest tests/integration/test_project_api.py::TestProjectAPI::test_get_projects_unauthor