fix(testrun): the dead-run refusal gets its own opt-out

--allow-no-properties was waiving two unrelated refusals, so a sweep passing
it for the property-free reason silently lost a detector it never asked to
disable, and a run with properties could only get the dead-run exemption by
claiming one it did not want.
This commit is contained in:
pj committed 2026-08-18 20:10:29 +05:30
1 parent aa49c3bc34
commit 93614a48b9
2 files changed
+36 -11

No files matched your search

+24 -5
View File
@@ -411,11 +411,11 @@ func TestRunOutcome_ARunThatDroveNothingIsNotASuccess(t *testing.T) {
t.Errorf("a run whose generator dispatched one action must succeed, got %v", err)
}
// The sweeps that measure what a spec extracts and where a generator reaches
// ask for a run that judges nothing by name, and "the generator reached
// nothing here" is their measurement rather than their failure.
if err := runOutcome(Options{AllowNoProperties: true}, droveNothing); err != nil {
t.Errorf("the property-free opt-out no longer carries a run through, got %v", err)
// The sweeps that measure where a generator reaches ask for a run that
// explores nothing by name, and "the generator reached nothing here" is
// their measurement rather than their failure.
if err := runOutcome(Options{AllowNoGeneratorActions: true}, droveNothing); err != nil {
t.Errorf("the dead-run opt-out no longer carries a run through, got %v", err)
}
// A run cut short before it took a step never got going, which the deadline
@@ -473,6 +473,25 @@ func TestRunOutcome_SetupActionsDoNotCarryARunWhoseGeneratorDroveNothing(t *test
}
}
// Two refusals, two flags. A sweep that runs a property-free spec asked to
// judge nothing, not to explore nothing, and a run with properties that needs
// the dead-run exemption must be able to say so without claiming a waiver it
// does not want.
func TestRunOutcome_TheDeadRunRefusalHasItsOwnOptOut(t *testing.T) {
droveNothing := runner.Summary{
Steps: 200,
SkippedActions: map[string]int{"no_action_produced": 200},
}
var dead NoGeneratorActionsError
if err := runOutcome(Options{AllowNoProperties: true}, droveNothing); !errors.As(err, &dead) {
t.Errorf("--allow-no-properties waived the dead-run refusal, which it does not name: got %v", err)
}
if err := runOutcome(Options{AllowNoGeneratorActions: true}, droveNothing); err != nil {
t.Errorf("--allow-no-generator-actions did not carry a run that drove nothing through, got %v", err)
}
}
// A recorded violation is a verdict, and a run that reached one is not a dead
// run whatever drove the app to it. Campaigns are where this bites: they never
// pass --exit-on-violation, so refusing such a run writes exit_code 1 into the