Skip to content

Commit e8dee04

Browse files
authored
Add troubleshooting section for flaky tests in GitHub summary (#1647)
1 parent dc6cbe8 commit e8dee04

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tools/flakeguard/reports/presentation.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ func GenerateGitHubSummaryMarkdown(w io.Writer, testReport *TestReport, maxPassR
100100
if artifactLink != "" {
101101
renderArtifactSection(w, artifactName, artifactLink)
102102
}
103+
104+
if testReport.SummaryData.FlakyTests > 0 {
105+
renderTroubleshootingSection(w)
106+
}
103107
}
104108

105109
// GeneratePRCommentMarkdown generates a markdown summary of the test results for a GitHub PR comment.
@@ -242,6 +246,14 @@ func renderArtifactSection(w io.Writer, artifactName, artifactLink string) {
242246
}
243247
}
244248

249+
// renderTroubleshootingSection appends a troubleshooting section with a link to the README
250+
func renderTroubleshootingSection(w io.Writer) {
251+
fmt.Fprintln(w)
252+
fmt.Fprintln(w, "## Troubleshooting Flaky Tests 🔍")
253+
fmt.Fprintln(w)
254+
fmt.Fprintln(w, "For guidance on diagnosing and resolving E2E test flakiness, refer to the [Finding the Root Cause of Test Flakes](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/tools/flakeguard/e2e-flaky-test-guide.md) guide.")
255+
}
256+
245257
// printTable prints a markdown table to the given writer in a pretty format.
246258
func printTable(w io.Writer, table [][]string, collapsible bool) {
247259
colWidths := calculateColumnWidths(table)

0 commit comments

Comments
 (0)