parser

package
v0.0.0-...-0560a14 Latest Latest
Warning

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

Go to latest
Published: May 3, 2019 License: MIT Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Console console // = true

Console write debug output

Functions

This section is empty.

Types

type ACTION

type ACTION int

ACTION Represents what action is being performed during the test step

const (
	UNKNOWN ACTION = 0
	CREATE  ACTION = 1
	UPDATE  ACTION = 2
	DESTROY ACTION = 3
)

What the test step is doing

func (ACTION) String

func (action ACTION) String() string

type Package

type Package struct {
	Name        string
	Time        float64
	Tests       []*Test
	CoveragePct string
}

Package contains the test results of a single package.

type Report

type Report struct {
	Packages []Package
}

Report is a collection of package tests.

func Parse

func Parse(r io.Reader, pkgName string, parseAzure bool) (*Report, error)

Parse parses go test output from reader r and returns a report with the results. An optional pkgName can be given, which is used in case a package result line is missing.

func (*Report) Failures

func (r *Report) Failures() int

Failures counts the number of failed tests in this report

type ResourceTime

type ResourceTime struct {
	ResourceName string   `json:"resourcename"`
	Duration     float64  `json:"duration"`
	Action       []ACTION `json:"action"`
}

ResourceTime Contains the result if individual actions per resource

func (*ResourceTime) MarshalJSON

func (u *ResourceTime) MarshalJSON() ([]byte, error)

MarshalJSON custom marshal function to format json output

type Result

type Result int

Result represents a test result.

const (
	PASS Result = 0
	FAIL Result = 1
	SKIP Result = 2
)

Test result constants

func (Result) String

func (result Result) String() string

type Test

type Test struct {
	Name              string         `json:"name"`
	ResourceGroup     string         `json:"rg"`
	Time              float64        `json:"time"`
	TestOverhead      float64        `json:"overhead"`
	CreateTime        float64        `json:"createtime"`
	CreateDestroyTime float64        `json:"createdestroytime"`
	Result            Result         `json:"result"`
	Output            []string       `json:"-"`
	CreateText        []string       `json:"-"`
	DestroyText       []string       `json:"-"`
	Steps             []ResourceTime `json:"steps"`
	CleanUp           []ResourceTime `json:"cleanup"`
}

Test contains the results of a single test.

func (*Test) MarshalJSON

func (u *Test) MarshalJSON() ([]byte, error)

MarshalJSON custom marshal function to format json output

Jump to

Keyboard shortcuts

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