Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/pkg/stagelabels/hold_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
}
4 changes: 2 additions & 2 deletions src/pkg/stagelabels/human_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
Loading