diff --git a/src/pkg/stagelabels/hold_test.go b/src/pkg/stagelabels/hold_test.go index a06f8bb514..ad425980d8 100644 --- a/src/pkg/stagelabels/hold_test.go +++ b/src/pkg/stagelabels/hold_test.go @@ -114,7 +114,7 @@ func TestStoreNoteHold(t *testing.T) { func TestRouteHumanNamesWhoHeld(t *testing.T) { base := Evidence{Head: "abc1234", Verdict: VerdictApproved, Checks: CheckSummary{Total: 3, Green: 3, Known: true}, DCO: DCOYes, Holds: []string{"hold"}, Cause: CauseDecision, SelfAuthored: true} plain := RouteHuman(base) - if plain.Stage != NeedsDecision || strings.Join(plain.Reasons, "|") != "the `hold` label is set|the automerge lane will not merge this unattended" || plain.Hold != nil { + if plain.Stage != NeedsDecision || strings.Join(plain.Reasons, "|") != "the `hold` label is set|"+decisionConsequenceReason || plain.Hold != nil { t.Fatalf("plain route = %+v", plain) } hive := base @@ -131,7 +131,7 @@ func TestRouteHumanNamesWhoHeld(t *testing.T) { person.Holds = []string{"do-not-merge", "hold"} person.Hold = &HoldProvenance{By: "clubanderson", Source: HoldSourceLabel} route = RouteHuman(person) - if strings.Join(route.Reasons, "|") != "the `do-not-merge` label is set|the `hold` label was set by @clubanderson|the automerge lane will not merge this unattended" { + if strings.Join(route.Reasons, "|") != "the `do-not-merge` label is set|the `hold` label was set by @clubanderson|"+decisionConsequenceReason { t.Fatalf("person-held route reasons = %q", route.Reasons) } } diff --git a/src/pkg/stagelabels/human_test.go b/src/pkg/stagelabels/human_test.go index eb68b952b3..0f3666bcdc 100644 --- a/src/pkg/stagelabels/human_test.go +++ b/src/pkg/stagelabels/human_test.go @@ -169,7 +169,7 @@ func TestRouteHumanDecision(t *testing.T) { e.HumanSummaries = []string{"security requires human: relay owner should confirm before merge"} }, "reviewer summary: security requires human: relay owner should confirm before merge"}, {"lane rule", func(e *Evidence) { e.Cause, e.CauseReason = CauseDecision, "the lane excludes `workflow-paths` edits" }, "the lane excludes `workflow-paths` edits"}, - {"lane rule unnamed", func(e *Evidence) { e.Cause = CauseDecision }, "the automerge lane will not merge this unattended"}, + {"lane rule unnamed", func(e *Evidence) { e.Cause = CauseDecision }, decisionConsequenceReason}, } for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { @@ -572,7 +572,7 @@ func TestRouteHumanForkGuard(t *testing.T) { if r.Stage != NeedsDecision || r.LaneReason != "" || !containsString(r.Reasons, want) { t.Fatalf("fork-guard route = %+v", r) } - if containsString(r.Reasons, "the automerge lane will not merge this unattended") { + if containsString(r.Reasons, decisionConsequenceReason) { t.Fatalf("fork-guard route names the generic lane rule: %+v", r) } if got := DecisionComment(r); !strings.Contains(got, want) {