• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

umputun / ralphex / 21806395831

08 Feb 2026 10:17PM UTC coverage: 81.027% (+0.3%) from 80.766%
21806395831

Pull #76

github

umputun
fix(progress): add missing PhaseHolder arg to LogDiffStats tests

NewLogger signature gained a *status.PhaseHolder parameter in #75,
but the two new LogDiffStats tests were written against the pre-merge
signature causing build failure after merge.
Pull Request #76: Web dashboard fixes: diff stats, session replay, watcher improvements

149 of 166 new or added lines in 8 files covered. (89.76%)

5 existing lines in 2 files now uncovered.

5035 of 6214 relevant lines covered (81.03%)

208.55 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

72.73
/pkg/web/diff_stats.go
1
package web
2

3
import (
4
        "regexp"
5
        "strconv"
6
)
7

8
// DiffStats holds git diff statistics for a session.
9
type DiffStats struct {
10
        Files     int `json:"files"`
11
        Additions int `json:"additions"`
12
        Deletions int `json:"deletions"`
13
}
14

15
var diffStatsPattern = regexp.MustCompile(`^DIFFSTATS:\s*files=(\d+)\s+additions=(\d+)\s+deletions=(\d+)\s*$`)
16

17
func parseDiffStats(text string) (DiffStats, bool) {
28✔
18
        matches := diffStatsPattern.FindStringSubmatch(text)
28✔
19
        if matches == nil {
53✔
20
                return DiffStats{}, false
25✔
21
        }
25✔
22

23
        files, err := strconv.Atoi(matches[1])
3✔
24
        if err != nil {
3✔
NEW
25
                return DiffStats{}, false
×
NEW
26
        }
×
27
        additions, err := strconv.Atoi(matches[2])
3✔
28
        if err != nil {
3✔
NEW
29
                return DiffStats{}, false
×
NEW
30
        }
×
31
        deletions, err := strconv.Atoi(matches[3])
3✔
32
        if err != nil {
3✔
NEW
33
                return DiffStats{}, false
×
NEW
34
        }
×
35

36
        return DiffStats{
3✔
37
                Files:     files,
3✔
38
                Additions: additions,
3✔
39
                Deletions: deletions,
3✔
40
        }, true
3✔
41
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc