chore(ci): extract behave-parallel runner script from noxfile.py into scripts/ #1775
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#1538 TEST-INFRA: [ci-pipeline-design] Extract behave-parallel Script from noxfile.py
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core!1775
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "chore/extract-behave-parallel-script"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Extracts the inline
_BEHAVE_PARALLEL_CLI_SOURCEstring constant (334 lines of raw Python source) fromnoxfile.pyinto a proper, standalone module atscripts/run_behave_parallel.py. This improves maintainability by making the parallel behave runner a first-class Python file with full type annotations, linting, and formatting support rather than an opaque embedded string.Changes
scripts/run_behave_parallel.py: Contains the full in-process parallel behave runner logic previously embedded as the_BEHAVE_PARALLEL_CLI_SOURCEraw string constant innoxfile.py. The extracted script is now a proper Python module with:Summary = dict[str, Any]type alias to handle the untypedbehavelibrarycontextlib.suppressto satisfy theruffSIM105 rule (replacing baretry/except/passblocks)rufflint and format checks_install_behave_parallel()innoxfile.py: Replaced the inline_BEHAVE_PARALLEL_CLI_SOURCEstring with a dynamic file read usingPath(__file__).parent / "scripts" / "run_behave_parallel.py". The function now reads the script content from disk and writes it into the temporary package directory, preserving the identical runtime behaviour._BEHAVE_PARALLEL_CLI_SOURCEfromnoxfile.py: Deleted the 334-line string constant and its associated comment block, significantly reducing the size and cognitive load ofnoxfile.py.Design Decisions
Path(__file__).parentfor script location: The script is resolved relative tonoxfile.pyitself rather than the current working directory. This ensures the path is correct regardless of wherenoxis invoked from.contextlib.suppress(ImportError)overtry/except/pass: The extracted script is now subject torufflinting. The SIM105 rule flags baretry/except/passpatterns;contextlib.suppressis the idiomatic replacement.Summary = dict[str, Any]type alias: Thebehavelibrary ships without type stubs. A local type alias captures intent while keeping the file fully annotated and# type: ignore-free.behave_parallel.cliunder the same temporary package directory, preserving thebehave-parallelconsole script entry point.Testing
rufflint and format checks: ✅ Pass on bothscripts/run_behave_parallel.pyand the updatednoxfile.pyModules Affected
noxfile.py— removed_BEHAVE_PARALLEL_CLI_SOURCEconstant; updated_install_behave_parallel()to read from the new script filescripts/run_behave_parallel.py— new file containing the extracted parallel behave runner moduleCloses #1538
Automated by CleverAgents Bot
Supervisor: Implementation | Agent: ca-issue-worker
Automated by CleverAgents Bot
Supervisor: Implementation | Agent: ca-pr-api-creator
Review claimed by reviewer pool instance pr-reviewer-pool-3983434-1775170710. Dispatching independent code review.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer
Code Review: APPROVED ✅
Summary
Clean, well-executed refactoring that extracts the 334-line
_BEHAVE_PARALLEL_CLI_SOURCEinline string constant fromnoxfile.pyinto a standalonescripts/run_behave_parallel.pymodule. No functional changes — the installedbehave-parallelentry point is identical to the previous embedded version.Review Findings
Specification Alignment: N/A — this is a CI/infrastructure chore, not a feature change. No spec concerns.
Code Quality ✅
Summary = dict[str, Any]alias for untyped behave library# type: ignoresuppressionsfrom __future__ import annotationsfor modern type syntaxcontextlib.suppress(ImportError)replaces baretry/except/pass(ruff SIM105 compliance)Correctness ✅
Path(__file__).parent / "scripts" / "run_behave_parallel.py"is robust regardless of CWDread_text(encoding="utf-8")— explicit encoding specificationbehave_parallel.climodule)noxfile.py Improvement ✅
_install_behave_parallel()docstring to explain new approachCommit Quality ✅
ISSUES CLOSED: #1538footer presentCI Status: Failures in lint, typecheck, security, and unit_tests are pre-existing on master (same failures on commit
921c13f4). This PR does not introduce any new CI failures. Thequalitycheck passes on both master and this PR.Verdict
Approved for merge. This is a textbook refactoring — improves maintainability and enables proper tooling support for the parallel runner script without changing any runtime behavior.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer
Review: PR #1775 — chore(ci): extract behave-parallel runner script
Decision: APPROVED ✅ — Proceeding to merge
Clean refactor extracting 334-line string constant into proper Python module. Full type annotations,
contextlib.suppressfor SIM105 compliance,Summarytype alias. Logic identical to original. Significant maintainability improvement.Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer
Code Review: ✅ APPROVED
Reviewed against: CONTRIBUTING.md rules, code maintainability best practices.
Summary:
Extracts 334-line string constant from
noxfile.pyintoscripts/run_behave_parallel.py. No logic changes.Path(__file__).parentensures correct path resolution regardless of CWDcontextlib.suppress(ImportError)satisfies ruff SIM105 ruleSummary = dict[str, Any]handles untyped behave library without# type: ignoreProceeding to merge.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer