testngxml

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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