From e46a4a192c115bb5e9b3b0301e7f077b049ac74e Mon Sep 17 00:00:00 2001 From: csh Date: Sun, 21 Jun 2026 18:14:16 +0800 Subject: [PATCH] :wrench: chore(test): fix test directory path references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix incorrect test directory references throughout the repository: - .gitea/workflows/test.yml: tests/ → test/ (5 locations) - CONTRIBUTING.md: tests/ → test/ (7 locations) - test/README.md: update directory structure and commands Also remove one more documentation consistency test: - test/test_thirdparty_skill_curation.py: checks YAML config for exact text All 63 functional tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitea/workflows/test.yml | 10 +++--- CONTRIBUTING.md | 15 +++++---- test/README.md | 25 +++++---------- test/test_thirdparty_skill_curation.py | 42 -------------------------- 4 files changed, 20 insertions(+), 72 deletions(-) delete mode 100644 test/test_thirdparty_skill_curation.py diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 47dbbe05..b509eccd 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -106,17 +106,17 @@ jobs: echo "📝 模板验证测试" echo "========================================" - sh tests/templates/validate_python_templates.sh - sh tests/templates/validate_cpp_templates.sh - sh tests/templates/validate_ci_templates.sh - sh tests/templates/validate_project_templates.sh + sh test/templates/validate_python_templates.sh + sh test/templates/validate_cpp_templates.sh + sh test/templates/validate_ci_templates.sh + sh test/templates/validate_project_templates.sh echo "✅ 模板验证通过" echo "========================================" echo "🔗 文档链接检查" echo "========================================" - sh tests/integration/check_doc_links.sh + sh test/integration/check_doc_links.sh echo "✅ 文档链接检查通过" echo "🎉 所有测试完成" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 95795cee..508ef161 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,7 +8,7 @@ backwards compatible when possible. - Templates: `templates/`, `rulesets/`, `docs/` - Tooling: `scripts/` -- Tests: `tests/` +- Tests: `test/` ## Commit messages @@ -20,13 +20,12 @@ Run the relevant checks before pushing: ```bash npm run lint:md -python -m unittest discover -s tests/cli -v -python -m unittest discover -s tests -p "test_*.py" -v -sh tests/templates/validate_python_templates.sh -sh tests/templates/validate_cpp_templates.sh -sh tests/templates/validate_ci_templates.sh -sh tests/templates/validate_project_templates.sh -sh tests/integration/check_doc_links.sh +python -m unittest discover -s test -p "test_*.py" -v +sh test/templates/validate_python_templates.sh +sh test/templates/validate_cpp_templates.sh +sh test/templates/validate_ci_templates.sh +sh test/templates/validate_project_templates.sh +sh test/integration/check_doc_links.sh ``` ## Templates and docs diff --git a/test/README.md b/test/README.md index ee768d55..5b07f5ef 100644 --- a/test/README.md +++ b/test/README.md @@ -5,16 +5,10 @@ ## 📋 目录结构 ```txt -tests/ +test/ ├── README.md # 本文件:测试文档 -├── cli/ # Python CLI 测试(unittest) -│ ├── test_claude_md_sync.py # CLAUDE.md 同步与注入测试 -│ ├── test_install_skills.py # install_skills 与 skill_link 行为测试 -│ ├── test_sync_standards_cli.py # sync_standards 规则集同步测试 -│ └── test_playbook_cli.py # playbook.py 基础功能测试 ├── test_format_md_action.py # format_md 动作测试 ├── test_gitea_workflow_bootstrap.py # Gitea workflow 自举顺序回归测试 -├── test_firstparty_skills_quality.py # first-party skills 元数据与结构质量测试 ├── test_gitattributes_modes.py # gitattr_mode 行为测试 ├── test_no_backup_flags.py # no_backup 行为测试 ├── test_sync_directory_actions.py # sync_memory_bank/sync_prompts 行为测试 @@ -37,20 +31,17 @@ tests/ # 进入 playbook 根目录 cd /path/to/playbook -# 1. 运行 Python CLI 测试 -python -m unittest discover -s tests/cli -v - -# 1.1 运行其他 Python 测试(tests/ 下的 test_*.py) -python -m unittest discover -s tests -p "test_*.py" -v +# 1. 运行 Python 测试(test/ 下的 test_*.py) +python -m unittest discover -s test -p "test_*.py" -v # 2. 运行模板验证测试 -sh tests/templates/validate_python_templates.sh -sh tests/templates/validate_cpp_templates.sh -sh tests/templates/validate_ci_templates.sh -sh tests/templates/validate_project_templates.sh +sh test/templates/validate_python_templates.sh +sh test/templates/validate_cpp_templates.sh +sh test/templates/validate_ci_templates.sh +sh test/templates/validate_project_templates.sh # 3. 运行文档链接检查 -sh tests/integration/check_doc_links.sh +sh test/integration/check_doc_links.sh ``` ## 🧭 CI 自动化测试 diff --git a/test/test_thirdparty_skill_curation.py b/test/test_thirdparty_skill_curation.py deleted file mode 100644 index a98bd380..00000000 --- a/test/test_thirdparty_skill_curation.py +++ /dev/null @@ -1,42 +0,0 @@ -import unittest -from pathlib import Path - - -ROOT = Path(__file__).resolve().parents[1] -CURATION = ROOT / "skills" / "thirdparty" / "thirdparty-skills.yml" - - -def read_text(path: Path) -> str: - return path.read_text(encoding="utf-8") - - -class ThirdpartySkillCurationTests(unittest.TestCase): - def test_architecture_skills_are_recorded_for_sync(self): - text = read_text(CURATION) - self.assertIn("id: brooks-lint", text) - self.assertIn("upstream_repo: https://github.com/hyhmrright/brooks-lint", text) - self.assertIn("architecture audit", text) - self.assertIn("sync: enabled", text) - - self.assertIn("id: codebase-recon", text) - self.assertIn("upstream_repo: https://github.com/outfitter-dev/agents", text) - self.assertIn("upstream_paths:", text) - self.assertIn("plugins/outfitter/skills/codebase-recon", text) - self.assertIn("plugins/outfitter/skills/pathfinding", text) - self.assertIn("upstream_layout: multi_skill_subset", text) - self.assertIn("pathfinding/references/confidence.md", text) - self.assertIn("risk scan", text) - - self.assertIn("id: codebase-migrate", text) - self.assertIn("upstream_repo: https://github.com/ComposioHQ/awesome-codex-skills", text) - self.assertIn("upstream_path: codebase-migrate", text) - self.assertIn("large codebase migrations", text) - - self.assertIn("id: uncle-bob-craft", text) - self.assertIn("upstream_repo: https://github.com/sickn33/antigravity-awesome-skills", text) - self.assertIn("upstream_path: skills/uncle-bob-craft", text) - self.assertIn("design-pattern misuse checks", text) - - -if __name__ == "__main__": - unittest.main()