Accept edited existing test methods in takedown final-red #1687
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#1687
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
The takedown step
final-redrejects a design whose failing tests edit an existing test method.RedCheckcounts a failing-test file as red only when the file adds a new test method.A ticket that changes a kept behavior needs an edit of the existing test, so the run ends with
FAILED final-redand the design is lost, after about $3.5 and 19 minutes.Observed
Takedown run
docs/takedown/1682-20261110-162833(ticket #1682) ended with:The design
revise-2held two failing-test files.plugins/os-sdlc/test/os_sdlc/project_collaborators_test.rbadded a new method that was red at base (NoMethodError: undefined method 'shell' for an instance of OsSdlc::Project).plugins/os-sdlc/test/fast_gate/fast_gate_bin_smoke_test.rbedited an existing method, so it added none.Run files:
revise-2.red-check.json("red": false, the note above) and16-final-red.json.Step
revise-1failed the same check earlier (not red at base: OsSdlc::ProjectCollaboratorsTest#test_shell_defaults_to_a_project_shell, ...).Code that produces this:
plugins/os-sdlc/eval/ticket-takedown/lib/takedown/model/red_check.rb:23-29(run_file):fresh = TestMethods.ids(file.fetch("content")) - bases.fetch(path); whenfreshis empty it returnsUnnamedTest.new(file: path).plugins/os-sdlc/eval/ticket-takedown/lib/takedown/model/unnamed_test.rb:9:def red? = false.plugins/os-sdlc/eval/ticket-takedown/lib/takedown/model/red_check.rb:35:def red? = !@results.empty? && @results.all?(&:red?). OneUnnamedTestmakes the whole design not red.plugins/os-sdlc/eval/ticket-takedown/lib/takedown/command/final_red_step.rb:7-14: a not-red check fails the step.An edit of an existing method gives
freshempty because the method id is already in the base file, even when the edit makes that method fail at base.Related, not the same: #1002 asks the design cards to say that every new
failing_testsmethod must be red at base; it does not cover edited methods.Reproduce
n/a: a run costs minutes and money. A unit test of
Takedown::RedCheck.runwith afailing_testsentry whose content changes one assertion of an existing method shows theUnnamedTestresult.Approach
Decide how
RedChecktreats an edited existing method.Option A: compare method bodies, treat a method whose body changed as a candidate, and run it at base.
Option B: keep the rule and state it in the designer, critic, and reviser cards, so that a design moves each change of an existing test into the "Retired tests" and "Kept behavior" work.
State the chosen option in the ticket decomposition.
Required work:
RedCheck.run_file— check: presentchangedinplugins/os-sdlc/eval/ticket-takedown/lib/takedown/model/red_check.rbAcceptance criteria
RedCheckruns, then that method is run and its result is red.RedCheckruns, then the result isUnnamedTestand the check is not red.final-redruns, then the step is ok.Owner sketch
Non-goals (optional)
The wording of the design cards (#1002).
Origin
bin/takedown-runfor ticket #1682 (rundocs/takedown/1682-20261110-162833) ended atfinal-red.final-red←RedCheck.run_filetreats a file with no new method id asUnnamedTest(red_check.rb:26) ← the check was written for new test files and new methods (#995)VERDICT: CREATE
REASON: Observed failure on the #1682 takedown run; #1002 covers the design card wording, not the check code.