Extract shared base classes for brief_facts and dispatch model tests #674
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#674
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
Two duplicated groups within plugins/os-sdlc tests: (a) init_test_project and run! are duplicated between plugins/os-sdlc/tests/pipeline/brief_facts_diff_facts_never_truncated_test.rb (lines 70, 81) and brief_facts_enrichment_facts_test.rb (lines 168, 179), mass 312. (b) setup is duplicated across plugins/os-sdlc/tests/model/dispatch_record_usage_test.rb:10, dispatch_step_summaries_test.rb:9, dispatch_test.rb:9; new_dispatch is duplicated across plugins/os-sdlc/tests/model/objection_test.rb:57, plugins/os-sdlc/tests/pipeline/objection_intake_test.rb:71, plugins/os-sdlc/tests/pipeline/objections_digest_test.rb:54; mass 288. No shared base classes exist.
Approach
Create two support base classes: (1) BriefFactsTestCase for brief_facts tests holding init_test_project and run! methods. (2) DispatchTestCase for dispatch and objection tests holding setup and new_dispatch methods. Callers subclass and delete their local copies.
Required work:
flay -m16 plugins/os-sdlc/tests/pipeline/brief_facts* | grep -E "init_test_project|run!"flay -m16 plugins/os-sdlc/tests/model/dispatch* plugins/os-sdlc/tests/model/objection_test.rb plugins/os-sdlc/tests/pipeline/objection* | grep -E "setup|new_dispatch"Acceptance criteria
ruby -I plugins/os-sdlc/lib:plugins/os-sdlc/tests plugins/os-sdlc/tests/**/*_test.rb, then all tests pass.Reproduce
n/a: refactor ticket, measured by flay
Origin
Session: e9385b96-96c4-4de0-9bc3-33573da7c95c
Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/e9385b96-96c4-4de0-9bc3-33573da7c95c.jsonl
Where: plugins/os-sdlc/tests/pipeline/ and plugins/os-sdlc/tests/model/
Work started on branch ticket-674 (worktree).
Resolution
Done: DispatchTestCase holds the shared Db.connect setup for the three dispatch model tests; ObjectionTestCase holds new_dispatch for objection_test and objections_digest_test. The brief_facts half was dropped at merge: #657 deleted both brief_facts test files on main before this branch landed, so BriefFactsTestCase had no callers and was removed.
Evidence: merged main
321f0d02(branch48192eb5); os-sdlc suite 1383 runs 0 failures.Follow-ups: none