fix(testmap): Python modules were offered as runnable test scripts - #236
qinghuanandejiangshi wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe change adds evidence-based Python runner detection, root-scoped matching, command caching, safe path handling, and end-to-end tests for pytest, main guards, fallback runners, and isolated project roots. ChangesPython runner detection
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant TestRunnerIndex
participant PythonEvidence
participant ProjectRoot
participant RunnerHintTests
TestRunnerIndex->>PythonEvidence: inspect source and pytest evidence
PythonEvidence->>ProjectRoot: read configuration within crawl root
ProjectRoot-->>PythonEvidence: return matching project evidence
PythonEvidence-->>TestRunnerIndex: return validated runner
TestRunnerIndex-->>RunnerHintTests: emit runner hint
RunnerHintTests->>TestRunnerIndex: verify roots, commands, and unsafe paths
Merge Risk: ⚪ Minimal · up to The runner-hint paths have no identified merge-blocking issue. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Thanks @qinghuanandejiangshi. This makes run= trustworthy on Python repos: an agent in a Django/pytest tree now gets Must fix before merge
Optional, fine as a follow-up
CodeRabbit comments you can safely ignore
Queue: this PR is 3rd in landing order — #231 → #237 → #236 → #235 + #233 (reconciled together) → #224 → #44 (Windows, being refactored). |
Python test modules received
run="python3 ..."even when importing the file runs no tests or fails without Django settings. Run hints now require a top-level main guard for direct Python execution, or pytest configuration between the test directory and its crawl root. Modules without that evidence retain the existing unknown-runner disclosure.The existing parsers distinguish main guards and TOML tables from documentation examples. Candidate commands are cached, fallback runners stay within their own workspace root, and shell quoting plus option termination apply to pytest paths too. Django settings and custom test runners are left unknown rather than inferred.
Closes #229.
Validation (macOS):
test/runhintcheck.shpasses on the fix, covering test-gate JSON, affected XML, situ text, unknown-runner disclosures, root boundaries, fallback and hostile paths.runhintcheck.shpass with no sanitizer error output. Three fixture scans are byte-identical, cold/warm caches agree, XML parses, and the committed golden matches.ripwirepubliccheck.sh, failed becausepdftotextwas missing; it passes after installing Poppler. Final runhint/cppqual checks and the format gate pass.asan/ripwire; the sanitizer build and execution above used a separate build directory. Local checks used base216802ad;git merge-treeconfirms a clean merge into current main30f14a27.