results

package
v1.1.19 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	TestCase     *model.TestCase
	ResponseTime time.Duration // Http Response Time
	ResponseSize int           // Size in bytes of the HTTP Response body
}

func NewMetrics

func NewMetrics(testCase *model.TestCase, responseTime time.Duration, responseSize int) Metrics

func NewMetricsFromRestyResponse

func NewMetricsFromRestyResponse(testCase *model.TestCase, response *resty.Response) Metrics

func NoMetrics

func NoMetrics() Metrics

func (Metrics) MarshalJSON added in v1.1.6

func (m Metrics) MarshalJSON() ([]byte, error)

MarshalJSON is a custom marshaler which formats a Metrics struct with a response time represented as unit of milliseconds response time decimal precision is up the nanosecond eg: 1.234ms

type ResultKey added in v1.1.6

type ResultKey struct {
	APIName    string
	APIVersion string
}

type TestCase

type TestCase struct {
	Id         string   `json:"id"`
	Pass       bool     `json:"pass"`
	Metrics    Metrics  `json:"metrics"`
	Fail       []string `json:"fail,omitempty"`
	Detail     string   `json:"detail"`
	RefURI     string   `json:"refURI"`
	Endpoint   string   `json:"endpoint"`
	API        string   `json:"-"`
	APIVersion string   `json:"-"`
}

TestCase result for a run

func NewTestCaseFail

func NewTestCaseFail(id string, metrics Metrics, errs []error, endpoint, api, apiVersion, detail, refURI string) TestCase

NewTestCaseFail returns a failed test

func NewTestCaseResult

func NewTestCaseResult(id string, pass bool, metrics Metrics, errs []error, endpoint, apiName, apiVersion, detail, refURI string) TestCase

NewTestCaseResult return a new TestCase instance

Jump to

Keyboard shortcuts

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