perf(tests): reduce BDD test suite and coverage report runtime by 90%+ #493
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
#479 perf(tests): profile and optimize the 8 slowest feature files (>100s each)
cleveragents/cleveragents-core
#480 perf(tests): profile and optimize the 20 medium-slow feature files (10-100s)
cleveragents/cleveragents-core
#481 perf(tests): replace subprocess-per-feature parallelism with in-process execution
cleveragents/cleveragents-core
#482 perf(tests): optimize coverage instrumentation and reporting pipeline
cleveragents/cleveragents-core
#483 perf(tests): reduce per-feature startup cost via shared fixtures and lazy imports
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core!493
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "perf/bdd-test-optimization"
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
Consolidates 5 stacked PRs (#484, #487, #488, #489, #490) into a single clean branch with one commit per issue, incorporating all code review fixes. No merge commits — cherry-pick only.
Epic: #478 — Reduce BDD test suite runtime from 26 minutes to under 3 minutes
Results
nox -s unit_testsnox -s coverage_reportCommits (1 per issue)
1.
perf(tests): optimize coverage instrumentation and reporting pipelineCloses #482 — Replace coverage.py (sys.settrace) with slipcover (bytecode instrumentation). Workers produce per-feature JSON; slipcover
--mergecombines them. CI workflows handle both output formats defensively.2.
perf(tests): reduce per-feature startup cost with shared fixtures and lazy importsCloses #483 — New
scripts/create_template_db.pypre-creates a fully-migrated SQLite template.environment.pymonkey-patchesMigrationRunner.init_or_upgradeto copy the template (~1ms) instead of running 25 Alembic migrations (~0.5-3s) per scenario.3.
perf(tests): optimize the 8 slowest BDD feature filesCloses #479 — Added
@mock_onlytag support, lightweight in-memory plan service for 14 actor-resolution scenarios, extracted helper functions in services_coverage steps. The 8 features dropped from 113-248s to 0.7-31.6s each.4.
perf(tests): optimize medium-slow BDD features (10-100s tier)Closes #480 — Global
time.sleep/asyncio.sleepcap at 10ms, subprocess.run replaced with CliRunner, in-memory SQLite defaults,_original_sleepescapes for timing-sensitive tests. 20 features dropped from 10-65s to 0.02-3.4s each.5.
perf(tests): replace behave-parallel subprocess model with in-process parallelismCloses #481 — Replace 342 subprocess spawns with behave
RunnerAPI. Sequential mode for coverage,multiprocessing.Poolwith fork for parallel. Removes PyPI tarball download, per-worker subprocess overhead, and regex-based summary parsing.Review fixes applied (vs original PRs)
ISSUES CLOSED: #NNNfooter format per CONTRIBUTING.md# DEBUG: trace which calls reach the patch) fromfeatures/environment.py_original_sleepescape infeatures/steps/subplan_execution_steps.pyfor timeout/delay tests broken by the global sleep capQuality
coverage_reportverified on final commit: 98% (above 97% threshold)b3c47a9ef9f26fcfc44e