Rename the nine I/O-doing *_fixture.rb support files to scenarios #1463
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#1463
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?
Problem
Nine support files carry the name
*Fixturebut write disk, git, or DB.The convention in
plugins/os-sdlc/skills/lens-testing/references/record-fixtures.mdrule 2 says a Fixture returns a value and does no I/O.A Scenario owns the disk.
The files and their I/O:
changed_project_fixture.rb— File.write at 29, 33, 58; git through Open3 at 62-63.crc_ledger_fixture.rb— lines 9-13.entry_map_fixture.rb— lines 5-6.evidence_fixture.rb— lines 25-32.gate_commands_project_fixture.rb— lines 20-38.git_repo_fixture.rb— lines 13-30.lesson_fixture.rb— write at 22-24; FIELDS andyamlare pure.dispatch_fixture.rb— DB creates at 5-8.open_implementation_fixture.rb— Initiation.open_project and Open.call at 5-6; 26 references.Approach
Rename each file to
<Name>Scenarioin*_scenario.rb, and update the callers (usegrep -rlwper constant).Split LessonFixture: keep
LessonFixturewith FIELDS andyaml(pure), and movewritetoLessonScenario.Three helper files are also scenarios:
cli_next_instruction_helpers.rb(git init, disk, DB at 13-41, 163, 181),seeded_git_repo_helpers.rb(14-23),evidence_bin_helpers.rb(46-51).Rename them to
*_scenario.rb, or keep them as helpers with a ruling.Required work:
class ChangedProjectFixtureinplugins/os-sdlc/tests/**LessonScenarioinplugins/os-sdlc/tests/support/lesson_scenario.rbAcceptance criteria
plugins/os-sdlc/tests/support/*_fixture.rb, whengrep -l 'File\|FileUtils\|Open3\|\.create'runs on them, then it lists nothing.Owner sketch
Non-goals
Record fixtures for lib records (see the other conversion tickets).
Route: fast-batch.
Origin
VERDICT: CREATE
Parent: #1019
Work started on branch fast-batch-22 (os-sdlc fast-batch). The ChangedProjectFixture and GateCommandsProjectFixture renames merge with #1269 into WorkingTreeChangesScenario.
Resolution
Done: I/O-doing support fixtures are Scenarios: GitRepo, Dispatch, EntryMap, Evidence, OpenImplementation, CliNextInstruction (ruling O1), LessonScenario split from pure LessonFixture; ChangedProject + GateCommandsProject merged into WorkingTreeChangesScenario (#1269); CrcLedgerFixture merged into CrcLedgerScenario (ruling A1).
Evidence: fast-batch-22 merged to main
5f32ca8f; commits2d2d88d7,af7f61df,9ae47fd3,01c96785. AC2: no tests/support/*_fixture.rb does File/FileUtils/Open3/create I/O. Full suite 2904 runs, 0 failures.Follow-ups: dropped: leftovers (rescue_source require, SeededGitRepoHelpers#run_git status, CrcLedgerScenario write name) got a ticket-skeptic DROP (speculative hardening); list posted on #1019.