in infra/utils/fbf/cmd/flaky.go [120:160]
func (f *FlakyFinder) Render() {
// verbose table with build ids
tableVerbose := table.NewWriter()
tableVerbose.SetOutputMirror(os.Stdout)
tableVerbose.AppendHeader(table.Row{"Repo", "Commit", "Pass Build IDs", "Fail Build IDs"})
// flakes per repo
repoFlakeCount := make(map[string]int)
// flake failures per repo
repoFlakeFailCount := make(map[string]int)
for _, f := range f.flakes {
repoFlakeCount[f.repo]++
repoFlakeFailCount[f.repo] += len(f.fails)
pass := ""
for id := range f.passes {
pass += id + "\n"
}
fail := ""
for id := range f.fails {
fail += id + "\n"
}
tableVerbose.AppendRow(table.Row{f.repo, f.commitSHA, pass, fail})
tableVerbose.AppendSeparator()
}
if f.verbose {
tableVerbose.Render()
}
// overview table with total number of flakes per repo
tableOverview := table.NewWriter()
tableOverview.SetOutputMirror(os.Stdout)
tableOverview.AppendHeader(table.Row{"Repo", "Flakes", "Flake Failures"})
totalFlakeCount := 0
totalFlakeFailCount := 0
for repo, flakeCount := range repoFlakeCount {
tableOverview.AppendRow(table.Row{repo, flakeCount, repoFlakeFailCount[repo]})
totalFlakeCount += flakeCount
totalFlakeFailCount += repoFlakeFailCount[repo]
}
tableOverview.AppendFooter(table.Row{"Total", totalFlakeCount, totalFlakeFailCount})
tableOverview.Render()
}