Atlas › Test

TestSlowestRuns

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

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

Covered source

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

go.temporal.io/server/tools/ci-notify/types.go 11 covered LOC · 3 ranges

Open complete file

42 }
43
44 > func (r *DigestReport) slowestRuns(limit int) []github.Run { types.go
45 > if limit <= 0 {
46 return nil
47 }
48
49 > sorted := make([]github.Run, 0, len(r.Runs)) types.go
50 > for _, run := range r.Runs {
51 > if run.Duration > 0 {
52 > sorted = append(sorted, run)
53 > }
54 }
55 > sort.Slice(sorted, func(i, j int) bool { types.go
56 > return sorted[i].Duration > sorted[j].Duration
57 > })
58 > return sorted[:min(limit, len(sorted))]
59 }