Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
Tests []TestTiming `json:"tests"`
DefaultDur time.Duration `json:"default_duration"`
// contains filtered or unexported fields
}
Cache holds timing data for tests and provides lookup functionality.
func LoadCache ¶
LoadCache reads timing data from a JSON file. Returns an empty cache if the file doesn't exist.
func (*Cache) GetDuration ¶
GetDuration returns the duration for a test, falling back to default if unknown. Looks up by full name (package.TestName) first, then just test name.
func (*Cache) Update ¶
func (c *Cache) Update(timings []TestTiming)
Update merges new timing data into the cache.
type TestTiming ¶
type TestTiming struct {
Name string `json:"name"`
Package string `json:"package"`
Duration time.Duration `json:"duration"`
}
TestTiming holds duration data for a single test.
func ParseTestOutput ¶
func ParseTestOutput(r io.Reader) ([]TestTiming, error)
ParseTestOutput reads `go test -json` output and extracts timing data.
Click to show internal directories.
Click to hide internal directories.