Atlas › Test

TestFormatMessageForDebug

Exact test identity: go.temporal.io/server/tools/ci-notify/TestFormatMessageForDebug

Package
go.temporal.io/server/tools/ci-notify
Suite / test hierarchy
TestFormatMessageForDebug
Test
TestFormatMessageForDebug
Introduced at
slack.go ×1 Frontier kind: Joint frontier
Covered ranges
1
Covered lines
13
Covered files
1

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/tools/ci-notify/slack.go 13 covered LOC · 1 range

Open complete file

114
115 // FormatMessageForDebug formats the message for console output
116 > func FormatMessageForDebug(report *FailureReport) string { slack.go
117 > var sb strings.Builder
118 > fmt.Fprint(&sb, "🚨 CI Failed on Main Branch 🚨\n\n")
119 > fmt.Fprintf(&sb, "Workflow: %s\n", report.Workflow.Name)
120 > fmt.Fprintf(&sb, "Branch: %s\n", report.Workflow.HeadBranch)
121 > fmt.Fprintf(&sb, "Commit: %s (%s)\n", report.Commit.ShortSHA, report.Commit.Author)
122 > fmt.Fprintf(&sb, "Failed Jobs: %d of %d total jobs\n\n", len(report.FailedJobs), report.TotalJobs)
123 > fmt.Fprintln(&sb, "Failed Jobs:")
124 > for _, job := range report.FailedJobs {
125 > fmt.Fprintf(&sb, " • %s\n %s\n", job.Name, job.URL)
126 > }
127 > fmt.Fprintf(&sb, "\nView Full Workflow Run: %s\n", report.Workflow.URL)
128 > return sb.String()
129 }
130