Skip to content

ci: register new Python tests automatically at commit time - #14153

Merged
teamleaderleo merged 1 commit into
mainfrom
claude/auto-register-python-tests
Sep 24, 2026
Merged

teamleaderleo merged 1 commit into
mainfrom
claude/auto-register-python-tests

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A new tests/test_*.py fails the preflight guard until someone pastes a [[test]] block into tests/test-execution.toml. This happens even when ci-guards.yml already runs the file and the validator has already worked out the lane. #14148 hit exactly this.

After this change, adding a test and its ci-guards.yml step is all a commit needs:

  • python3 scripts/ci/validate_test_execution_registry.py --write registers every unregistered test that a workflow already runs, on linux-guard, then validates as before.
  • The pre-commit hook (scripts/git-hooks/pre-commit, installed by ./scripts/setup.sh) runs --write whenever a commit stages a test or workflow file, and stages the updated registry. It leaves the registry alone if the registry has unstaged edits. It never blocks a commit, because CI still validates.
  • A test that no workflow runs is not registered. Someone has to decide where it executes. CI still fails on it with the paste-in hint, and the hint now also mentions --write.

Testing

  • python3 tests/test_ci_test_execution_registry.py passes. Two new tests check that --write:
    • registers a test a workflow runs, the result validates, and a second run is a no-op
    • leaves a test no workflow runs untouched
  • End-to-end run of the hook: I committed a new test plus its ci-guards.yml step in a throwaway clone with the hook installed. The hook printed registered new tests in tests/test-execution.toml, the commit included the registry entry, and validate_test_execution_registry.py --base-sha HEAD~1 passed.
  • validate_test_execution_registry.py --write on current main changes nothing, and the registry is valid.

Checklist

  • I tested the change locally
  • I added or updated tests for behavior changes

🤖 Generated with Claude Code

https://claude.ai/code/session_01RSxoKWiT1D35DDmEYxk59f


Generated by Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Automates registration of new Python tests in tests/test-execution.toml so adding a test and its ci-guards.yml step is all a commit needs, instead of the preflight guard failing until someone pastes in a [[test]] block.

  • validate_test_execution_registry.py --write registers every unregistered test a workflow already runs, then validates as before.
  • The pre-commit hook runs --write when a commit stages test or workflow files and stages the updated registry; it skips if the registry has unstaged edits and never blocks a commit.
  • Tests no workflow runs are left unregistered for a person to place; CI still fails on them with the hint now also mentioning --write.

Written for commit d0a766c. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added automatic registration for unlisted tests when a workflow already runs them. Tests without a clear workflow placement remain unregistered for manual review.
    • The pre-commit hook can sync the test registry when relevant test or workflow changes are staged.
  • Bug Fixes
    • Registration errors are reported, and the validation command exits with a failure status when registration cannot be completed.

A new tests/test_*.py fails preflight until someone pastes a [[test]]
block into tests/test-execution.toml, even when ci-guards.yml already
runs it and the validator has already worked out the lane.

validate_test_execution_registry.py --write now appends that block for
every unregistered test a workflow runs, and the pre-commit hook runs it
whenever a commit stages a test or workflow and stages the result. A
test no workflow runs is left for a person to place; CI still fails on
it with the hint, which now mentions --write.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RSxoKWiT1D35DDmEYxk59f
@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 14fb2b70-9d82-4e1d-b56c-b324c582d630

📥 Commits

Reviewing files that changed from the base of the PR and between f70a62b and d0a766c.

📒 Files selected for processing (3)
  • scripts/ci/validate_test_execution_registry.py
  • scripts/git-hooks/pre-commit
  • tests/test_ci_test_execution_registry.py
 _________________________________________________________________________________________________
< Errare Humanum Est, Perseverare in Debugging. To err is human, to persist in debugging, divine. >
 -------------------------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@teamleaderleo
teamleaderleo merged commit 455179c into main Sep 24, 2026
50 of 52 checks passed
rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 24, 2026
82543c5 ci: stop restoring the test compilation cache in compile admission (manaflow-ai#14161)
5da27d6 ci: route the persistent compile fleet command as control plane only (manaflow-ai#14157)
b2ec91b ci: bring a Mac mini onto the compile fleet with one command (manaflow-ai#14148)
1f39b14 ci: cancel orphaned runs from the queue janitor (manaflow-ai#14156)
455179c ci: register new Python tests automatically at commit time (manaflow-ai#14153)
e6ca0a2 fix(ios): mirror the signed-in account so pushes decrypt after launch (manaflow-ai#14110)
fd028fe ci: run forks' own macOS CI on GitHub-hosted macos-26 (manaflow-ai#14151)
f70a62b ci: cancel stale pull request runs on every janitor sweep (manaflow-ai#14144)
e2fd37e ci: default the seed adoption kill switch to on (manaflow-ai#14150)
4926f0f fix: split the SSH session-list merge so it type-checks on slow runners (manaflow-ai#14142)
34d33d2 ci: run R2 cache writers in a main-only ci-cache-writer environment (manaflow-ai#14147)
4b7f66a ci: skip the Mac wrapper and remote-daemon lanes for ci.yml routing edits (manaflow-ai#14145)
4ca24a2 ci: give the DerivedData seeder the R2 public URL (manaflow-ai#14146)

# Conflicts:
#	.github/workflows/app-host-test-rerun.yml
#	.github/workflows/auth-refresh-tests.yml
#	.github/workflows/ci-guards.yml
#	.github/workflows/ci-macos.yml
#	.github/workflows/ci-queue-janitor.yml
#	.github/workflows/ci.yml
#	.github/workflows/cli-pipe-regressions.yml
#	.github/workflows/cloud-command-deadlines.yml
#	.github/workflows/cloud-machine-tests.yml
#	.github/workflows/cloud-task-local-tests.yml
#	.github/workflows/iroh-v2.yml
#	.github/workflows/nightly.yml
#	.github/workflows/relay-tls.yml
#	.github/workflows/remote-daemon.yml
#	.github/workflows/seed-derived-data.yml
#	.github/workflows/terminal-hang-diagnostics.yml
#	.github/workflows/test-ios.yml
teamleaderleo added a commit to teamleaderleo/cmux that referenced this pull request Sep 24, 2026
Main's pre-commit hook now also runs
scripts/ci/validate_test_execution_registry.py --write, so the hook
installer, the trust note in docs/contributor-verification.md and the
dev-workflow skill describe it as more than the pbxproj normalizer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo added a commit that referenced this pull request Sep 24, 2026
* Add contributor verification receipts for local and CI checks

Adapt the existing docs-auth guard recipe; retain source qualifications and provider outcomes.

Refs teamleaderleo/Tact#83.

* Test assessed zero-test receipts fail at the CLI boundary

* Cover unknown receipt schemas and unavailable Git observations

* Share fast CI checks with a focused local preflight command

* Clarify verification scope and consolidate contributor guidance

* test: reproduce missing focused Swift syntax preflight

* feat: catch Swift syntax failures before native iteration

* test: cover changed-file and composable Swift selection

* feat: discover Swift edits and support composable verification

* test: reject private checkout paths in parser receipts

* fix: keep parser receipts checkout-relative

* docs: connect the verification ladder to automatic preflight

* Run shared static checks automatically on pushed commit tips

* test: reject implicit candidate code execution during push

* fix: remove automatic execution of untrusted push candidates

* Make the testing skill start with a task and focused check

* Test affected preflight selection and input drift

* Select local verification checks from changed inputs

Explain selection and skipped checks; use the full recipe for unknown inputs.

* Test receipt behavior when Python startup fails

* Report missing Python without claiming test execution

Clarify trusted-checkout requirements at skill entry points.

* Test automatic local verification defaults

* Automatically choose local checks and changed Swift inputs

Use local remote-default refs, explain fallback, and preserve full static checks in CI.

* Describe the pre-commit hook's test registration from #14153

Main's pre-commit hook now also runs
scripts/ci/validate_test_execution_registry.py --write, so the hook
installer, the trust note in docs/contributor-verification.md and the
dev-workflow skill describe it as more than the pbxproj normalizer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant