Skip to content

Commit 3e19109

Browse files
committed
Refactor settings table generation to conditionally include project name
1 parent ee2ff56 commit 3e19109

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tools/flakeguard/reports/presentation.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,23 @@ func GeneratePRCommentMarkdown(w io.Writer, testReport *TestReport, maxPassRatio
156156
func buildSettingsTable(testReport *TestReport, maxPassRatio float64) [][]string {
157157
rows := [][]string{
158158
{"**Setting**", "**Value**"},
159-
{"Project", testReport.GoProject},
160-
{"Max Pass Ratio", fmt.Sprintf("%.2f%%", maxPassRatio*100)},
161-
{"Test Run Count", fmt.Sprintf("%d", testReport.TestRunCount)},
162-
{"Race Detection", fmt.Sprintf("%t", testReport.RaceDetection)},
163159
}
160+
161+
if testReport.GoProject != "" {
162+
rows = append(rows, []string{"Project", testReport.GoProject})
163+
}
164+
165+
rows = append(rows, []string{"Max Pass Ratio", fmt.Sprintf("%.2f%%", maxPassRatio*100)})
166+
rows = append(rows, []string{"Test Run Count", fmt.Sprintf("%d", testReport.TestRunCount)})
167+
rows = append(rows, []string{"Race Detection", fmt.Sprintf("%t", testReport.RaceDetection)})
168+
164169
if len(testReport.ExcludedTests) > 0 {
165170
rows = append(rows, []string{"Excluded Tests", strings.Join(testReport.ExcludedTests, ", ")})
166171
}
167172
if len(testReport.SelectedTests) > 0 {
168173
rows = append(rows, []string{"Selected Tests", strings.Join(testReport.SelectedTests, ", ")})
169174
}
175+
170176
return rows
171177
}
172178

0 commit comments

Comments
 (0)