Skip to content

test: 归一测试树(主仓 tests/ -> zzz-od-test/test/)+ entry 文档告知 - #2439

Merged
DoctorReid merged 3 commits into
mainfrom
unify-test-tree
Jul 5, 2026
Merged

test: 归一测试树(主仓 tests/ -> zzz-od-test/test/)+ entry 文档告知#2439
DoctorReid merged 3 commits into
mainfrom
unify-test-tree

Conversation

@DoctorReid

@DoctorReid DoctorReid commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

背景

两痛点:① 主仓 tests/ + zzz-od-test/test/ 两套测试树,放哪说不清;② gitignore 的 zzz-od-test 被 AI 工具默认忽略。放弃 submodule(破坏 fork-aware CI),改归一测试树 + entry 文档告知。

改动(主仓)

  • pyproject[tool.pytest.ini_options] pythonpath=['src'](@a71b42fa)
  • tests/ 整目录 + CI 删 PYTHONPATH env(pythonpath 接管) + manual_verificationtools/(@df22146d)
  • entry 文档:AGENTS/ai_coding/agent_guidelines 告知测试仓 + 修 tests/->test/ 笔误(@3bf05508)

配套

zzz-od-test 同名分支 unify-test-tree 含搬迁的 11 测试 + 修 7 预存失败(git_service/code_sync API 漂移) + 合并本地 backend/run-status-schema 的 backend 用例。fork-aware CI(test-check.yml:38)拉同名分支。

验证

  • 项目根 uv run pytest zzz-od-test/ collect 145 无 ImportError;backend 72 passed
  • final whole-branch review(opus)通过,无 Critical/Important

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • 更新了测试仓相关说明,明确测试文件的统一放置位置与查找方式。
    • 补充了开发环境中使用测试仓的操作指引。
  • Chores

    • 调整了测试环境配置,让 pytest 自动识别 src/ 路径。
    • 移除了 CI 中对测试路径的额外环境变量设置。

DoctorReid and others added 3 commits July 5, 2026 17:59
…入 path

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
…I 删 PYTHONPATH env(用 pyproject pythonpath)

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
…sts->test 笔误

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: glm-5.2 <noreply@bigmodel.cn>
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

该 PR 将测试代码统一迁移至独立仓库 zzz-od-test/test/,删除主仓多个测试文件(含 GPU 推理、屏幕匹配、后端 HTTP/MCP、Git 同步进度等测试),通过 pyproject.toml 新增 pytest pythonpath 配置取代 CI 环境变量方式,并更新相关文档说明。

Changes

测试仓迁移与配置

Layer / File(s) Summary
pytest 路径配置变更
pyproject.toml, .github/workflows/test-check.yml
移除 CI “Run tests”步骤中的 PYTHONPATH: src 环境变量,改为在 pyproject.toml 新增 [tool.pytest.ini_options] 配置 pythonpath = ["src"]
测试仓文档更新
AGENTS.md, docs/develop/setup/ai_coding.md, docs/develop/spec/agent_guidelines.md
更新文档说明测试统一放置于 zzz-od-test/test/,强调该目录被 .gitignore 排除、检索时需显式指定路径,并声明主仓 tests/ 已废弃。
移除主仓测试文件
tests/one_dragon/..., tests/zzz_od/...
删除主仓内多个测试文件(GPU 推理序列化、屏幕匹配、Git 服务、代码同步进度、CV 超时控制、后端 context/http/mcp/schemas 等),相关测试逻辑不再存在于主仓。
工具脚本导入格式调整
tools/manual_verification.py
将部分 import 语句从单行改为括号多行写法,未改变导入目标或逻辑。

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: Usagi-wusaqi

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了将主仓测试树统一到 zzz-od-test/test/ 并补充入口文档说明的主要变更。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch unify-test-tree

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
AGENTS.md (1)

17-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

把这条测试仓说明收敛到工具专属文档。

AGENTS.md 作为跨工具统一源,最好只保留各工具都适用的硬约束;这里的 Read/grep.gitignore 说明更偏 Claude Code 行为,放在 docs/develop/setup/ai_coding.md 就够了,避免共享入口里混入工具细节。Based on learnings:AGENTS.md 需要保持“纯指令、单一信息源”,工具特有内容应留在对应入口文件。

♻️ 建议调整
- 所有测试统一在独立仓 `zzz-od-test/test/`(`.gitignore`,须 clone 到仓库根目录才能读/改;clone 见 [quickstart §②](docs/develop/setup/quickstart.md),测试规范见 [agent_guidelines](docs/develop/spec/agent_guidelines.md))。主仓不保留测试。AI 查测试用 `Read`/`grep` 显式指定 `zzz-od-test/`(默认搜索会跳过 .gitignore)。
+ 所有测试统一在独立仓 `zzz-od-test/test/`;主仓不保留测试。更细的工具发现规则放到 `docs/develop/setup/ai_coding.md`。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@AGENTS.md` at line 17, Move the testing-repo and tool-specific lookup
guidance out of AGENTS.md and into the tool-specific documentation entry in
docs/develop/setup/ai_coding.md. Keep AGENTS.md as a shared, tool-agnostic
source of hard requirements only, and preserve any references to
zzz-od-test/test, clone/setup, and test rules in the dedicated ai_coding.md
document instead.

Source: Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@AGENTS.md`:
- Line 17: Move the testing-repo and tool-specific lookup guidance out of
AGENTS.md and into the tool-specific documentation entry in
docs/develop/setup/ai_coding.md. Keep AGENTS.md as a shared, tool-agnostic
source of hard requirements only, and preserve any references to
zzz-od-test/test, clone/setup, and test rules in the dedicated ai_coding.md
document instead.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d5e38e4f-0d75-439d-b7ec-3197d53b0f12

📥 Commits

Reviewing files that changed from the base of the PR and between 1a4f987 and 3bf0550.

📒 Files selected for processing (17)
  • .github/workflows/test-check.yml
  • AGENTS.md
  • docs/develop/setup/ai_coding.md
  • docs/develop/spec/agent_guidelines.md
  • pyproject.toml
  • tests/one_dragon/base/matcher/ocr/ocr_utilss/test_match_word_list_by_priority.py
  • tests/one_dragon/base/screen/test_screen_match.py
  • tests/one_dragon/envs/test_git_service.py
  • tests/one_dragon/test_code_sync_progress.py
  • tests/one_dragon/test_gpu_inference_serialization.py
  • tests/zzz_od/auto_battle/test_cv_timeout_control.py
  • tests/zzz_od/backend/test_backend_context.py
  • tests/zzz_od/backend/test_entry_server.py
  • tests/zzz_od/backend/test_http_routes.py
  • tests/zzz_od/backend/test_mcp_app.py
  • tests/zzz_od/backend/test_schemas.py
  • tools/manual_verification.py
💤 Files with no reviewable changes (12)
  • tests/one_dragon/base/matcher/ocr/ocr_utilss/test_match_word_list_by_priority.py
  • tests/one_dragon/test_gpu_inference_serialization.py
  • tests/zzz_od/backend/test_entry_server.py
  • tests/zzz_od/backend/test_schemas.py
  • tests/zzz_od/backend/test_http_routes.py
  • tests/one_dragon/envs/test_git_service.py
  • .github/workflows/test-check.yml
  • tests/one_dragon/test_code_sync_progress.py
  • tests/zzz_od/auto_battle/test_cv_timeout_control.py
  • tests/zzz_od/backend/test_backend_context.py
  • tests/zzz_od/backend/test_mcp_app.py
  • tests/one_dragon/base/screen/test_screen_match.py

@DoctorReid
DoctorReid merged commit dbafa71 into main Jul 5, 2026
8 checks passed
@DoctorReid
DoctorReid deleted the unify-test-tree branch July 5, 2026 11:22
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant