ginkgo_reporters

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

README

Ginkgo reporters

These reporters will build the xunit xml

Polarion reporter

This reporter fills in the xunit file the needed fields in order to upload it into Polarion as test run

Required parameters:
  • --polarion-execution=true to enable the reporter
  • --project-id="QE" will be set under 'properties'
  • --polarion-custom-plannedin="QE_1_0" will be set under 'properties'
Optional parameters:
  • --polarion-report-file the output file will be generated under working directory, the default is polarion_results.xml
  • --test-suite-params="OS=EL8 Storage=NFS Arch=x86" will be set under 'properties' and the values will get concatenated to the test run name
  • --test-id-prefix="PREFIX" will set "PREFIX" for each test ID in test properties, if this parameter is not passed, the project ID parameter is set to be that prefix by default
  • --test-run-template="Existing template name" will create the test run from an existing template
  • --test-run-title="Title" will set the test run title
Usage

Include the reporter in the tests entry point

if ginkgo_reporters.Polarion.Run {
		reporters = append(reporters, &ginkgo_reporters.Polarion)
	}

when executing the tests, in addition to your regular execution parameters, add the reporter parameters as specified above

go test YOUR_PARAMS --polarion-execution=true --project-id="QE" --polarion-custom-plannedin="QE_1_0" --polarion-report-file="polarion.xml"

Will generate polarion.xml file under the work directory that can be imported into polarion.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JunitOutput = ""
View Source
var Polarion = PolarionReporter{}

Functions

func NewJunitReporter

func NewJunitReporter() *reporters.JUnitReporter

Types

type JUnitFailureMessage

type JUnitFailureMessage struct {
	Type    string `xml:"type,attr"`
	Message string `xml:",chardata"`
}

type JUnitSkipped

type JUnitSkipped struct {
	XMLName xml.Name `xml:"skipped"`
}

type PolarionProperties

type PolarionProperties struct {
	Property []PolarionProperty `xml:"property"`
}

type PolarionProperty

type PolarionProperty struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
}

type PolarionReporter

type PolarionReporter struct {
	Suite           PolarionTestSuite
	Run             bool
	Filename        string
	TestSuiteName   string
	ProjectId       string
	PlannedIn       string
	LookupMethod    string
	TestSuiteParams string
	TestIDPrefix    string
	TestRunTemplate string
	TestRunTitle    string
}

func (*PolarionReporter) AfterSuiteDidRun

func (reporter *PolarionReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary)

func (*PolarionReporter) BeforeSuiteDidRun

func (reporter *PolarionReporter) BeforeSuiteDidRun(setupSummary *types.SetupSummary)

func (*PolarionReporter) SpecDidComplete

func (reporter *PolarionReporter) SpecDidComplete(specSummary *types.SpecSummary)

func (*PolarionReporter) SpecSuiteDidEnd

func (reporter *PolarionReporter) SpecSuiteDidEnd(summary *types.SuiteSummary)

func (*PolarionReporter) SpecSuiteWillBegin

func (reporter *PolarionReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary)

func (*PolarionReporter) SpecWillRun

func (reporter *PolarionReporter) SpecWillRun(specSummary *types.SpecSummary)

type PolarionTestCase

type PolarionTestCase struct {
	Name           string               `xml:"name,attr"`
	Properties     PolarionProperties   `xml:"properties"`
	FailureMessage *JUnitFailureMessage `xml:"failure,omitempty"`
	Skipped        *JUnitSkipped        `xml:"skipped,omitempty"`
	SystemOut      string               `xml:"system-out,omitempty"`
}

type PolarionTestSuite

type PolarionTestSuite struct {
	XMLName    xml.Name           `xml:"testsuite"`
	Tests      int                `xml:"tests,attr"`
	Failures   int                `xml:"failures,attr"`
	Time       float64            `xml:"time,attr"`
	Properties PolarionProperties `xml:"properties"`
	TestCases  []PolarionTestCase `xml:"testcase"`
}

Jump to

Keyboard shortcuts

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