Stub rubocop subprocess in autocorrect-prepass tests #487
Labels
No labels
P0
P1
P2
P3
bug
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#487
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Context
13 tests (AutocorrectPrepassTest, CliAutocorrectPrepassTest) invoke the real rubocop binary via Open3.capture3 (lib/os_sdlc/autocorrect_prepass.rb:45) at ~1.3s each, ~17s of suite time, dominated by rubocop cold start.
Tasks
Acceptance criteria
~12-15s suite-time saving; end-to-end coverage of the real subprocess path retained.
Origin
Work started: stubbing rubocop subprocess in autocorrect-prepass tests (batch session 2026-08-23).
Resolution
Done: Stubbed rubocop for the config-resolution/reporting tests via new FakeRubocopRunner (RuboCop::Cop::Team in-process, CopTestHelper pattern) injected through the existing AutocorrectPrepass runner: seam; kept the end-to-end test on the real binary. The 5 CliAutocorrectPrepassTest subprocess tests were deliberately left on the real binary: they pin the process boundary by documented design (tests/autocorrect_prepass_test.rb:8-12) and stubbing across it would need a speculative env-var seam.
Evidence: Commit
7ef230e: 2 test files, 77 insertions. Targeted run 15 runs, 55 assertions, 0 failures. Full suite 1035 runs, 0 failures, 49.1s (vs 51.9s post-#486). Saving 2.8s, short of the ticket's 12-15s estimate; the estimate assumed all 13 tests could be stubbed, but 5 pin the subprocess boundary intentionally. Residual wait is subprocess I/O, absorbed by parallelization ticket #488.Follow-ups: Dropped: env-var runner seam for the CLI subcommand tests — speculative cross-process seam; #488 parallelization absorbs the residual time. Dropped: FakeRubocopRunner COPS-list future-proofing — speculative; the fixture's cop list is stable and a mismatch fails loudly.
Follow-up (user-decided): deleted the 5 CliAutocorrectPrepassTest subprocess tests; in-process unit and runner-contract tests retained. Commit
f4e386c.