testreport

package
v0.6.1-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package testreport turns go test's JSON event stream into a durable timing report.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Action  string  `json:"Action"`
	Package string  `json:"Package"`
	Test    string  `json:"Test"`
	Elapsed float64 `json:"Elapsed"`
	Output  string  `json:"Output"`
}

type Package

type Package struct {
	Name    string  `json:"name"`
	Action  string  `json:"action"`
	Seconds float64 `json:"seconds"`
	Cached  bool    `json:"cached,omitempty"`
}

type Report

type Report struct {
	Schema          int       `json:"schema"`
	GeneratedAt     time.Time `json:"generated_at"`
	Events          int       `json:"events"`
	TestsPassed     int       `json:"tests_passed"`
	TestsFailed     int       `json:"tests_failed"`
	TestsSkipped    int       `json:"tests_skipped"`
	PackageFailures int       `json:"package_failures"`
	Incomplete      []string  `json:"incomplete_packages,omitempty"`
	Truncated       bool      `json:"truncated,omitempty"`
	Packages        []Package `json:"packages"`
	Tests           []Test    `json:"tests"`
}

func Read

func Read(r io.Reader, progress io.Writer, now time.Time) (Report, error)

Read consumes exactly one JSON object per line. It rejects empty and malformed streams because a timing artifact that silently omitted a compiler failure is worse than no artifact.

type Test

type Test struct {
	Package string  `json:"package"`
	Name    string  `json:"name"`
	Action  string  `json:"action"`
	Seconds float64 `json:"seconds"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL