parser

package
v1.16.12-beta056 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: MIT, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyReport = errors.New("empty JTL report")

Functions

func CSVToMap

func CSVToMap(reader io.Reader) ([]map[string]string, error)

CSVToMap takes a reader and returns an array of dictionaries, using the header row as the keys

func MakeSuccessExecution

func MakeSuccessExecution(out []byte) (result testkube.ExecutionResult)

func ParseJTLReport

func ParseJTLReport(report io.Reader, resultOutput []byte) (testkube.ExecutionResult, error)

Types

type AssertionResult

type AssertionResult struct {
	XMLName        xml.Name `xml:"assertionResult"`
	Name           string   `xml:"name"`
	Failure        bool     `xml:"failure"`
	Error          bool     `xml:"error"`
	FailureMessage string   `xml:"failureMessage"`
}

AssertionResult contains assertion

type CSVResult

type CSVResult struct {
	Success      bool
	Error        string
	Label        string
	ResponseCode string
	Duration     time.Duration
}

func MapElementToResult

func MapElementToResult(in map[string]string) CSVResult

type CSVResults

type CSVResults struct {
	HasError         bool
	LastErrorMessage string
	Results          []CSVResult
}

type Example

type Example struct {
	Time            int              `xml:"t,attr"`
	Success         bool             `xml:"s,attr"`
	Label           string           `xml:"lb,attr"`
	ResponseCode    string           `xml:"rc,attr"`
	AssertionResult *AssertionResult `xml:"assertionResult"`
}

Example is example details

type TestResult

type TestResult struct {
	Message string `xml:"message,attr"`
	Type    string `xml:"type,attr,omitempty"`
}

TestResult represents the result of a testcase

type Testcase

type Testcase struct {
	XMLName    xml.Name    `xml:"testcase"`
	Name       string      `xml:"name,attr"`
	ClassName  string      `xml:"classname,attr"`
	Assertions int         `xml:"assertions,attr,omitempty"`
	Time       float32     `xml:"time,attr,omitempty"`
	File       string      `xml:"file,attr,omitempty"`
	Line       int         `xml:"line,attr,omitempty"`
	Skipped    *TestResult `xml:"skipped,omitempty"`
	Failure    *TestResult `xml:"failure,omitempty"`
	Error      *TestResult `xml:"error,omitempty"`
}

Testcase define a testcase

type Testsuite

type Testsuite struct {
	XMLName    xml.Name   `xml:"testsuite"`
	Testcases  []Testcase `xml:"testcase"`
	Name       string     `xml:"name,attr"`
	Tests      int        `xml:"tests,attr"`
	Failures   int        `xml:"failures,attr"`
	Errors     int        `xml:"errors,attr"`
	Skipped    int        `xml:"skipped,attr,omitempty"`
	Assertions int        `xml:"assertions,attr,omitempty"`
	Time       float32    `xml:"time,attr"`
	Timestamp  string     `xml:"timestamp,attr,omitempty"`
	File       string     `xml:"file,attr,omitempty"`
}

Testsuite contains testsuite definition

type Testsuites

type Testsuites struct {
	XMLName    xml.Name    `xml:"testsuites"`
	Testsuites []Testsuite `xml:"testsuite,omitempty"`
	Name       string      `xml:"name,attr,omitempty"`
	Tests      int         `xml:"tests,attr,omitempty"`
	Failures   int         `xml:"failures,attr,omitempty"`
	Errors     int         `xml:"errors,attr,omitempty"`
	Skipped    int         `xml:"skipped,attr,omitempty"`
	Assertions int         `xml:"assertions,attr,omitempty"`
	Time       float32     `xml:"time,attr,omitempty"`
	Timestamp  string      `xml:"timestamp,attr,omitempty"`
}

Testsuites is a root element of junit report

type XMLResults

type XMLResults struct {
	XMLName     xml.Name  `xml:"testResults"`
	HTTPSamples []Example `xml:"httpSample,omitempty"`
	Samples     []Example `xml:"sample,omitempty"`
}

XMLResults is a root element of junit xml report

Jump to

Keyboard shortcuts

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