Repository navigation
fix(devtools): expose live pytest verify progress (#2006) - #2074
Conversation
Problem: long pytest-testmon runs only wrote the structured pytest report at process completion, so an active default verify could look stalled even while pytest was still collecting or executing tests. What changed: verify now maintains .cache/verify/current-pytest-progress.json during pytest steps, updating it on start, output, heartbeat, termination, and finish. The pytest step metadata reports that path, and the MCP query descriptor parity check now fails if a query-bearing MCP field lacks descriptor metadata. Verification: nix develop --command devtools test tests/unit/core/test_query_descriptor_parity.py tests/unit/devtools/test_verify.py -k 'descriptor_mcp_names_match_mcp_query_request_fields or pytest_run_writes_live_progress_artifact or pytest_run_streams_child_output_live or pytest_run_emits_heartbeat_for_long_silent_child or pytest_run_terminates_after_runtime_budget or pytest_run_terminates_after_output_stall or run_reads_structured_pytest_report'; nix develop --command devtools verify --quick
|
Warning Review limit reached
More reviews will be available in 42 minutes and 6 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesLive pytest progress artifact
MCP/descriptor parity enforcement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/unit/devtools/test_verify.py`:
- Around line 342-352: The test_pytest_run_writes_live_progress_artifact
function reads and writes to a shared path (PYTEST_PROGRESS_PATH) without
filesystem isolation, which can cause flaky behavior during parallel test
execution. Add monkeypatch and tmp_path as parameters to the function signature,
then call monkeypatch.chdir(tmp_path) at the start of the test to isolate the
working directory. This will ensure the test writes to an isolated temporary
directory instead of a shared .cache/verify location, following the pattern used
in test_testmon_preflight_* tests.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: efb2e22c-fc24-41a7-af68-7678b17fa067
📒 Files selected for processing (3)
devtools/verify.pytests/unit/core/test_query_descriptor_parity.pytests/unit/devtools/test_verify.py
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8510ef192
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The live progress artifact test now runs from a tmp_path cwd so xdist workers and sibling tests cannot race on the repo-level .cache/verify file.
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Adds a live progress artifact for pytest-backed
devtools verifyruns and turns MCP query descriptor parity into an enforced contract now that coverage is complete.Problem
The final pytest JSON report is written only when pytest exits. During long pytest-testmon runs, that left no machine-readable progress artifact to inspect, so an active verify could look hung even when the subprocess was alive. Separately, the MCP query descriptor parity test had become a no-op even though current MCP query fields are fully represented by descriptor metadata.
Solution
devtools verifynow writes.cache/verify/current-pytest-progress.jsonduring pytest steps on start, output, heartbeat, timeout/stall termination, and finish. The artifact records elapsed time, pid, output byte counts, RSS/state when sampled, return code, and termination reason when applicable. Pytest step metadata now reports the progress path. The descriptor parity test now asserts that every query-bearingMCPSessionQueryRequestfield is represented byQUERY_FIELD_DESCRIPTORS, excluding only control fields.Verification
nix develop --command devtools test tests/unit/core/test_query_descriptor_parity.py tests/unit/devtools/test_verify.py -k 'descriptor_mcp_names_match_mcp_query_request_fields or pytest_run_writes_live_progress_artifact or pytest_run_streams_child_output_live or pytest_run_emits_heartbeat_for_long_silent_child or pytest_run_terminates_after_runtime_budget or pytest_run_terminates_after_output_stall or run_reads_structured_pytest_report'-> 7 passed, 41 deselected.nix develop --command devtools verify --quick-> exit_code 0.devtools verify --quickreran ond8510ef1-> exit_code 0.Ref #2006
Summary by CodeRabbit
New Features
Tests