report

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package report parses output of "go test" tool, formats and provides information about uncovered packages and failed tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FailureGroup

type FailureGroup map[string]Failures

FailureGroup is a set of packages with failed tests

type Failures

type Failures map[string][]string

Failures contains output lines of failed package tests

type Formatter

type Formatter struct {
	// contains filtered or unexported fields
}

Formatter creates a text coverage report from "go test" tool

func NewReportFormatter

func NewReportFormatter() *Formatter

NewReportFormatter returns new "go test" tool report formatter

It reads and formats output from stdout of "go test" command

func (*Formatter) FailedTests

func (a *Formatter) FailedTests() (string, int)

FailedTests returns pre-formatted lines about failed tests

func (*Formatter) UncoveredPackages

func (a *Formatter) UncoveredPackages() (string, int)

UncoveredPackages returns pre-formatted lines about uncovered packages

func (*Formatter) Write

func (a *Formatter) Write(p []byte) (n int, err error)

Write implements io.Writer

type Line

type Line struct {
	Time    string
	Action  string
	Package string
	Test    string
	Output  string
}

Line represents JSON line from "go test" tool's lines

func Parse

func Parse(data []byte) (l Line, err error)

Parse parses go test report JSON line

type Lines

type Lines []Line

Lines is set of lines

func (*Lines) AppendData

func (lns *Lines) AppendData(data []byte) error

AppendData appends data to report

func (Lines) Failed

func (lns Lines) Failed() FailureGroup

Failed returns packages with failed tests

func (Lines) SkippedPackages

func (lns Lines) SkippedPackages() []string

SkippedPackages returns list of packages without unit tests

Jump to

Keyboard shortcuts

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