pytest.fix_ci_tests
Analyze and fix failure of tests in GitHub CI
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-02
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- model
- haiku
- description
- Analyze and fix failure of tests in GitHub CI
03 SKILL.md 正文
Goal
- Given a run of the GitHub CI analyze the failures and fix the failing tests
Workflow
- Read
.claude/skills/pytest.rules.md
Parse Logs From CI
-
Parse the output of
invoke gh_workflow_listwhich contains information on the failing tests -
The log of the failing tests on the CI is stored in a file
<CI_LOG>like:# Log is in 'tmp.failure.check_if_the_linter_was_run.gp_scratch_19.txt' -
The list of failing tests
<FAILING_TESTS>is in a file<REPRO_SCRIPT>like:... # To run the tests: ... > ./tmp.pytest_repro.fast_tests.sh
Check Whether the Failure Reproduces Locally
- Parse
<CI_LOG> - Run the script
<REPRO_SCRIPT>locally to check whether<FAILING_TESTS>fail there too- For the tests that involve running Docker / Apple containers run the same tests
with different builds, as per
## Analyze the Effect of Container Buildsin.claude/skills/pytest.rules.md
- For the tests that involve running Docker / Apple containers run the same tests
with different builds, as per
- Note any difference in behavior between CI and local: e.g., environment
variables, secrets, container build, or flakiness.
/pytest.fix_local_testscannot see this CI-specific context, so capture it here
Diagnose and Fix
- Use
/pytest.fix_local_testspassing<REPRO_SCRIPT>as<FAILURE_INFO>to diagnose the root cause and fix the failing tests- If a failure only reproduces on CI (not locally), diagnose the CI-specific cause directly instead (env, secrets, container build, flakiness) and fix it
- Report a table with the information of what tests are passing in the CI, locally,
and why they are failing in the CI and locally, in the file
plan-pytest.fix_ci_tests.mdin the current dir - Verify the fixes work correctly as per
# Verification of the Fixfrom.claude/skills/pytest.rules.md
Ask the User to Commit
- Ask the user to review and commit the changes
- Wait for the CI to pick up the changes and run the tests, and repeat the workflow
Verification
- [ ]
plan-pytest.fix_ci_tests.mdlists a fix for every failing test - [ ] Every fix follows
# Verification of the Fixin.claude/skills/pytest.rules.md - [ ] The failing tests pass both on the CI and locally after the fix
04 同仓库更多 Skills
tutorial_in_60_mins.propagate_docker_changes
Sync tutorial and class-project Docker files to match project_template
tutorial_in_60_mins.merge_markdown
Merge the content of a markdown file into a Jupyter notebook
tutorial_in_60_mins.format
Format a directory to follow the "Learn X in 60 Minutes" tutorial conventions
tutorial_in_60_mins.create
Create a tutorial directory for the Learn X in 60 Minutes conventions
todo.reorg_in_progress
Reorganize ai_task_queue.md so in-progress tasks, not-started tasks, and mislabeled topic headers sit under the right H1 stage
todo.reorg_headers
Reorganize ai_task_queue.md .md so every H2 topic matches ALL TOPICS and every H3 task sits under the right topic, keeping its H1 stage