testngxml

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

type Class struct {
	Name    string        `json:"name"`
	Methods []*TestMethod `json:"methods"`
}

func NewClass

func NewClass(name string) *Class

type Exception

type Exception struct {
	Class          string `json:"class"`
	Message        string `json:"message"`
	FullStacktrace string `json:"fullStacktrace"`
}

func NewException

func NewException(class string) *Exception

type NgParser

type NgParser struct {
}

func (NgParser) Parse

func (NgParser) Parse(endpoint, ak, sk, bucket, objectName string) ([]*apistructs.TestSuite, error)

parse xml to entity 1. get file from cloud storage 2. parse

func (NgParser) Register

func (ng NgParser) Register()

type NgStatus

type NgStatus string
const (
	NgPassed  NgStatus = "PASS"
	NgFailed  NgStatus = "FAIL"
	NgSkipped NgStatus = "SKIP"

	NgTotalSkip   NgStatus = "skipped"
	NgTotalFail   NgStatus = "failed"
	NgTotalPassed NgStatus = "passed"
	NgTotalIgnore NgStatus = "ignored"
	NgTotal       NgStatus = "total"
)

func (NgStatus) ToStatus

func (s NgStatus) ToStatus() apistructs.TestStatus

type NgTestResult

type NgTestResult struct {
	Skipped        int             `json:"skipped" yaml:"skipped"`
	Failed         int             `json:"failed" yaml:"failed"`
	Ignored        int             `json:"ignored"`
	Total          int             `json:"total"`
	Passed         int             `json:"passed"`
	ReporterOutput *ReporterOutput `json:"output"`
	Suites         []*Suite        `json:"suite"`
}

func Ingest

func Ingest(data []byte) (*NgTestResult, error)

Ingest will parse the given XML data and return a slice of all contained JUnit test suite definitions.

func IngestFile

func IngestFile(filename string) (*NgTestResult, error)

IngestFile will parse the given XML file and return a slice of all contained JUnit test suite definitions.

func IngestFiles

func IngestFiles(filenames []string) ([]*NgTestResult, error)

IngestFiles will parse the given XML files and return a slice of all contained JUnit test suite definitions.

func New

func New(skipped, failed, ignored, passed, total int) *NgTestResult

func (*NgTestResult) Transfer

func (ng *NgTestResult) Transfer() ([]*apistructs.TestSuite, error)

set ng test result to standard output

type Param

type Param struct {
	Index int    `json:"index"`
	Value string `json:"value"`
}

func NewParam

func NewParam() *Param

type ReporterOutput

type ReporterOutput struct {
	Lines []string `json:"line" xml:"line"`
}

func NewReporterOutput

func NewReporterOutput() *ReporterOutput

func (*ReporterOutput) String

func (o *ReporterOutput) String() string

type Suite

type Suite struct {
	Name       string        `json:"name"`
	Duration   time.Duration `json:"duration"`
	StartedAt  string        `json:"startedAt"`
	FinishedAt string        `json:"finishedAt"`
	Groups     string        `json:"groups"` // ignored
	Tests      []*Test       `json:"test"`
}

func NewSuite

func NewSuite(name, started, finished string, d time.Duration) *Suite

type Test

type Test struct {
	Name       string        `json:"name"`
	Duration   time.Duration `json:"duration"`
	StartedAt  string        `json:"startedAt"`
	FinishedAt string        `json:"finishedAt"`
	Classes    []*Class      `json:"class"`
}

func NewTest

func NewTest(name string, d time.Duration, started, finished string) *Test

type TestMethod

type TestMethod struct {
	Status         NgStatus        `json:"status"`
	Signature      string          `json:"signature"`
	Name           string          `json:"name"`
	IsConfig       bool            `json:"isConfig"`
	Duration       time.Duration   `json:"duration"`
	StartedAt      string          `json:"startedAt"`
	FinishedAt     string          `json:"finishedAt"`
	DataProvider   string          `json:"dataProvider"`
	ReporterOutput *ReporterOutput `json:"output"`
	Params         []*Param        `json:"params"`
	Exception      *Exception      `json:"exception"`
}

func NewTestMethod

func NewTestMethod(name, signature, provider, started, finished string, status NgStatus, d time.Duration, isConfig bool) *TestMethod

Jump to

Keyboard shortcuts

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