You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@magpie.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2026/10/23 00:19:07 UTC
[PR] fix(dev): test only changed workspace members, in parallel, in the local pytest hook [magpie]
potiuk opened a new pull request, #1764:
URL: https://github.com/apache/magpie/pull/1764
## Summary
- **Only changed members run in the local `workspace-pytest` hook.** It ran every member's suite whenever any matched file changed, the root `pyproject.toml` included, so every dev-version bump ran everything. The hook now passes its changed files to `tools/dev/run-workspace-check.sh`, which runs only the members `tools/dev/ci-pytest-batches.py` selects, the same selection the PR `tests` workflow makes. A dev-version bump runs nothing locally. CI still runs everything when a root build input changes.
- **The selection is wider where it matters.** A member is picked when any of its files changed, except Markdown and `.claude-plugin/` manifests: tests also run shell scripts and read data files (e.g. `tools/agent-isolation` tests `agent-iso.sh`). Symlinked source directories count too. Members that depend on a picked member are added transitively, through `[project]` dependencies, optional dependencies and dependency groups (e.g. `release-management` tests run `release-config`). The shared `magpie-dev` toolchain is not followed, or any `tools/dev` change would be a full run.
- **Tests run in parallel.** `pytest-xdist` joins the shared `magpie-dev` toolchain. Both the hook and the `tests` workflow run each member with `-n auto`.
## Type of change
- [ ] Skill change (`.claude/skills/<name>/`) — eval fixtures updated below
- [ ] Tool / bridge contract (`tools/<system>/*.md`)
- [X] Python package (`tools/*/` with `pyproject.toml`)
- [ ] Groovy reference impl
- [X] Cross-cutting (RFC, AGENTS.md, sandbox, privacy-LLM)
- [X] Documentation (`docs/`, `README.md`, `CONTRIBUTING.md`)
- [ ] Project template (`projects/_template/`)
- [X] CI / dev loop (`prek`, workflows, validators)
- [ ] Other:
## Test plan
- [X] `prek run --files <changed files> --skip workspace-pytest` passes
- [X] `prek run workspace-pytest --from-ref origin/main --to-ref HEAD` passes. It selects all 50 members, since `tools/dev` changed, and runs them under xdist.
- [X] `tools/dev/tests/test_ci_pytest_batches.py` covers the new selection rules: non-Python files, manifests, dependency groups, and the toolchain exclusion
- [X] `adversarial-review` passes 3× in a row with `-n auto`, and serially
- [ ] Other:
## RFC-AI-0004 compliance
- [X] **Sandbox** — no new host access. The hook no longer writes a temp file outside the repo.
## Linked issues
## Notes for reviewers (optional)
- `adversarial-review`'s `test_reviewers_run_in_parallel_and_keep_order` asserted that two 3 s stubs finished in under 5.5 s. Under xdist it failed every time (~6.7 s). It now records each stub's run span and asserts the two spans overlapped. That is the actual property under test, and it does not depend on load.
- The changed-file list now reaches `ci-pytest-batches.py` through stdin (`--changed-file /dev/stdin`) rather than a `mktemp` file. `mktemp` fails when the system temp directory is not writable, which happens for sandboxed agents, and the script did not check for that.
- `AGENTS.md`, `CONTRIBUTING.md` and the AI contribution policy now say to run `prek run --all-files --skip workspace-pytest`, then `prek run workspace-pytest --from-ref origin/main --to-ref HEAD`.
---
Generative AI disclosure: prepared with Claude Code (Claude Opus 5); reviewed by the author.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@magpie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(dev): test only changed workspace members, in parallel, in the local pytest hook [magpie]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #1764:
URL: https://github.com/apache/magpie/pull/1764
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@magpie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org