Split TicketFixture into a value-only fixture and TicketScenario #1459
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
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
rule-proposal
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#1459
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?
Split TicketFixture into a value-only fixture and TicketScenario [capture]
Problem
TicketFixturemixes value methods with disk writes.TicketFixture.seedcallswrite_configandwrite_ticket_file, so a fixture does I/O, and 20 test files call it. A test that wants only a body must go through a class that writes files.Approach
Required work:
ticket_fixture.rbto value methodscomplete_body(**sections),without(section), andwith_required_work(item). The last method replaces the.subinbody_with_itematplugins/os-sdlc/tests/implementation/open_ticket_shape_test.rb:177— check: absentFileinplugins/os-sdlc/tests/support/ticket_fixture.rbplugins/os-sdlc/tests/support/ticket_scenario.rbthat holdsseed,write_config, andwrite_ticket_file(now lines 11-38 ofticket_fixture.rb) with the same keyword signature — check: presentclass TicketScenarioinplugins/os-sdlc/tests/support/ticket_scenario.rbgrep -rln 'TicketFixture\.seed' plugins/os-sdlc/tests(20 files) to callTicketScenario.seed— check: absentTicketFixture.seedinplugins/os-sdlc/tests/**/*.rbRoute: fast-batch.
Acceptance criteria
ticket_fixture.rb, when a reader opens it, then it has noFileorFileUtilscall.TicketScenario.seed(dir, tickets:, body:), when called, then it writes the same config file and ticket files asTicketFixture.seedwrote before.TicketFixture.with_required_work(item), when called, then it returns the complete body with its Required work item replaced byitem.Owner sketch
Non-goals
Origin
VERDICT: CREATE
Parent: #1019
Depends on: #1458
Resolution
Done: TicketFixture is a value-only module (complete, with_required_work, with_section, without; constants private, no File/FileUtils). TicketScenario owns seed/write_config/write_ticket_file byte-for-byte. 20 seed callers changed receiver only; 2 body: args use TicketFixture.complete. New tests/support_ticket_fixture_test.rb.
Evidence: fast-batch-21 commits
de84efd9+ fix-list b06e78ce/5fe189df, merged to main70ecc103; grep -c File ticket_fixture.rb = 0; full suite 2903 runs 0 failures; memo docs/crc/os-sdlc/fast-batch-21/finding-b-ticket-fixture-split.md; review ruling R2 removed the unused without("Required work") branchFollow-ups: none