Documentation
¶
Index ¶
- func CleanLog(log string) string
- func FormatFailure(f Failure) string
- func GroupByName(failures []Failure) map[string][]Failure
- func RegisterParser(p Parser)
- func StripANSI(log string) string
- func StripJobPrefix(log string) string
- func StripTimestamps(log string) string
- type Failure
- type GoTestParser
- type LintParser
- type Parser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatFailure ¶
FormatFailure returns a human-readable representation of the failure.
func GroupByName ¶
GroupByName groups failures by name (e.g., linter name, test name).
func StripANSI ¶
StripANSI removes ANSI color codes from the log. Input: "=== [31mFAIL[0m: TestName" Output: "=== FAIL: TestName"
func StripJobPrefix ¶
StripJobPrefix removes GitHub Actions job/step prefix from each line. Input: "Test\tRun tests\t2026-01-26... content" Output: "content"
func StripTimestamps ¶
StripTimestamps removes CI log timestamp prefixes from each line. Input: "2026-01-26T14:49:40.7760945Z --- FAIL: TestName" Output: "--- FAIL: TestName"
Types ¶
type Failure ¶
type Failure struct {
Name string // What failed (test name, lint rule, build target)
Context string // Where in codebase (package, module, directory)
File string // e.g., "triggered_broadcast_test.go"
Line int // e.g., 203
Column int // e.g., 15 (0 if not applicable)
Message string // The error/failure message
RawOutput string // Relevant log snippet for context
}
Failure represents a parsed CI failure (test, lint, build, etc.).
func ParseFailures ¶
ParseFailures attempts to parse failures using all registered parsers.
type GoTestParser ¶
type GoTestParser struct{}
GoTestParser parses Go test output, including testify and gotestsum formats.
func (*GoTestParser) CanParse ¶
func (p *GoTestParser) CanParse(logContent string) bool
CanParse returns true if the log contains Go test output.
type LintParser ¶
type LintParser struct{}
LintParser parses golangci-lint output from GitHub Actions logs.
func (*LintParser) CanParse ¶
func (p *LintParser) CanParse(logContent string) bool
CanParse returns true if the log contains golangci-lint output.