一键导入
testing
Verify testing coverage and run tests for PyPTO project. Use when running tests, checking test coverage, or when the user asks about testing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Verify testing coverage and run tests for PyPTO project. Use when running tests, checking test coverage, or when the user asks about testing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | testing |
| description | Verify testing coverage and run tests for PyPTO project. Use when running tests, checking test coverage, or when the user asks about testing. |
| context | fork |
You are a specialized testing agent. Build the project and run all tests to verify code changes haven't broken anything.
If .claude/skills/testing/testing.env exists: Source it before testing.
[ -f .claude/skills/testing/testing.env ] && source .claude/skills/testing/testing.env
If doesn't exist: Skip and suggest creating one (see testing.env.example).
When working in a git worktree, always build and test from within the worktree — never copy .so files from the main repo. Create a build directory inside the worktree if one doesn't exist.
# 1. Activate environment (if testing.env exists)
[ -f .claude/skills/testing/testing.env ] && source .claude/skills/testing/testing.env
# 2. Configure CMake if build is not configured (worktree, fresh clone)
[ ! -f build/CMakeCache.txt ] && cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
# 3. Build project (parallel)
cmake --build build --parallel
# 4. Set PYTHONPATH
export PYTHONPATH=$(pwd)/python:$PYTHONPATH
# 5. Run tests
python -m pytest tests/ut/ -n auto --maxprocesses 8 -v
# Run all tests
python -m pytest tests/ut/ -n auto --maxprocesses 8 -v
# Run specific test file
python -m pytest tests/ut/core/test_error.py -n auto --maxprocesses 8 -v
# Run specific test
python -m pytest tests/ut/core/test_error.py::TestErrorTypes::test_value_error_type -n auto --maxprocesses 8 -v
tests/ut/
├── core/ # Core functionality
├── ir/ # IR (nodes, expressions, operators, parser)
└── pass/ # Pass manager
tests/ut/ (not elsewhere)| Issue | Solution |
|---|---|
ImportError: No module named 'pypto_core' | export PYTHONPATH=$(pwd)/python:$PYTHONPATH |
| Tests fail after code changes | cmake --build build --parallel then re-run |
| Tests in wrong location | Move to tests/ut/ |
| Build not configured (worktree/fresh clone) | cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo |
## Testing Summary
**Status:** ✅ PASS / ⚠️ WARNINGS / ❌ FAIL
### Build Results
[Compiler output, warnings/errors]
### Test Results
- Total: X | Passed: X | Failed: X | Skipped: X
### Failures
[Failed test details if any]
### Recommendations
[Actions to fix issues]
| Status | Criteria |
|---|---|
| PASS | All tests pass, build succeeds, no new warnings |
| WARNINGS | Tests pass but new warnings or skipped tests |
| FAIL | Build fails or tests fail |
.claude/skills/testing/testing.env if it exists. If it doesn't exist, show a helpful tip about creating it.build/CMakeCache.txt), run cmake -B build to configure before building.--parallel.tests/ut/)Profile PyPTO kernels in-core with the Ascend msprof op-simulator — cycle-accurate per-kernel traces. Use when the user wants to profile a built case, inspect kernel timing or instruction streams, or generate MindStudio Insight traces.
Generate a weekly changelog markdown file summarizing external API and feature changes from git commits in a date range. Extracts before/after Python examples per commit, groups by theme (DSL / distributed / runtime / IR deprecations), and attributes each change to its author. Use when the user asks for a weekly report, changelog, commit summary, or interface-change digest.
Compare codegen output (.pto files and pass dumps) between origin/main and the current branch for a given test case. Runs the test with --save-kernels and --dump-passes on both branches via git worktree, then diffs the results. Use when the user asks to compare codegen output, diff .pto files between branches, or check what changed in generated code.
Add new operator definitions to PyPTO across all layers (C++, Python IR, Python DSL, tests, codegen, docs). Covers tile ops, tensor ops, tensor-to-tile conversion, and codegen registration. Use when the user asks to add a new op, define a new operator, implement a new tile/tensor operation, or extend the operator system.
Create a GitHub PR then autonomously loop on CI failures and review comments until the PR is fully green. Combines branch prep, PR creation, and a hands-off fix loop. Use when the user wants to ship a PR end-to-end, auto-fix a PR until green, or create-and-fix a PR in one go.
Fix GitHub PR issues — address review comments and resolve CI failures in a loop until the PR is fully clean. Fetches CI errors online and triages review feedback. Use when fixing PR problems, addressing review comments, or resolving CI failures.