func GenerateJSONReport(report types.Report, destination string) error
GenerateJSONReport produces a JSON-formatted report at the passed in destination
func GenerateJUnitReport(report types.Report, dst string) error
func GenerateJUnitReportWithConfig(report types.Report, dst string, config JunitReportConfig) error
func GenerateTeamcityReport(report types.Report, dst string) error
func MergeAndCleanupJSONReports(sources []string, destination string) ([]string, error)
MergeJSONReports produces a single JSON-formatted report at the passed in destination by merging the JSON-formatted reports provided in sources It skips over reports that fail to decode but reports on them via the returned messages []string
func MergeAndCleanupJUnitReports(sources []string, dst string) ([]string, error)
func MergeAndCleanupTeamcityReports(sources []string, dst string) ([]string, error)
func RenderTimeline(spec types.SpecReport, noColor bool) string
func ReportViaDeprecatedReporter(reporter DeprecatedReporter, report types.Report)
ReportViaDeprecatedReporter takes a V1 custom reporter and a V2 report and calls the custom reporter's methods with appropriately transformed data from the V2 report.
ReportViaDeprecatedReporter should be called in a `ReportAfterSuite()`
Deprecated: ReportViaDeprecatedReporter method exists to help developer bridge between deprecated V1 functionality and the new reporting support in V2. It will be removed in a future minor version of Ginkgo.
type DefaultReporter struct {
// contains filtered or unexported fields
}
func NewDefaultReporter(conf types.ReporterConfig, writer io.Writer) *DefaultReporter
func NewDefaultReporterUnderTest(conf types.ReporterConfig, writer io.Writer) *DefaultReporter
func (r *DefaultReporter) DidRun(report types.SpecReport)
func (r *DefaultReporter) EmitFailure(state types.SpecState, failure types.Failure)
func (r *DefaultReporter) EmitProgressReport(report types.ProgressReport)
func (r *DefaultReporter) EmitReportEntry(entry types.ReportEntry)
func (r *DefaultReporter) EmitSpecEvent(event types.SpecEvent)
func (r *DefaultReporter) SuiteDidEnd(report types.Report)
func (r *DefaultReporter) SuiteWillBegin(report types.Report)
func (r *DefaultReporter) WillRun(report types.SpecReport)
Deprecated: DeprecatedReporter was how Ginkgo V1 provided support for CustomReporters this has been removed in V2. Please read the documentation at: https://onsi.github.io/ginkgo/MIGRATING_TO_V2#removed-custom-reporters for Ginkgo's new behavior and for a migration path.
type DeprecatedReporter interface { SuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) BeforeSuiteDidRun(setupSummary *types.SetupSummary) SpecWillRun(specSummary *types.SpecSummary) SpecDidComplete(specSummary *types.SpecSummary) AfterSuiteDidRun(setupSummary *types.SetupSummary) SuiteDidEnd(summary *types.SuiteSummary) }
type JUnitError struct { //Message maps onto the panic/exception thrown - equivalent to SpecReport.Failure.ForwardedPanic - or to "interrupted" Message string `xml:"message,attr"` //Type is one of "panicked" or "interrupted" Type string `xml:"type,attr"` //Description maps onto the captured stack trace for a panic, or the failure message for an interrupt which will include the dump of running goroutines Description string `xml:",chardata"` }
type JUnitFailure struct { //Message maps onto the failure message - equivalent to SpecReport.Failure.Message Message string `xml:"message,attr"` //Type is "failed" Type string `xml:"type,attr"` //Description maps onto the location and stack trace of the failure Description string `xml:",chardata"` }
type JUnitProperties struct { Properties []JUnitProperty `xml:"property"` }
func (jup JUnitProperties) WithName(name string) string
type JUnitProperty struct { Name string `xml:"name,attr"` Value string `xml:"value,attr"` }
Deprecated JUnitReporter (so folks can still compile their suites)
type JUnitReporter struct{}
func NewJUnitReporter(_ string) *JUnitReporter
func (reporter *JUnitReporter) AfterSuiteDidRun(_ *types.SetupSummary)
func (reporter *JUnitReporter) BeforeSuiteDidRun(_ *types.SetupSummary)
func (reporter *JUnitReporter) SpecDidComplete(_ *types.SpecSummary)
func (reporter *JUnitReporter) SpecWillRun(_ *types.SpecSummary)
func (reporter *JUnitReporter) SuiteDidEnd(_ *types.SuiteSummary)
func (reporter *JUnitReporter) SuiteWillBegin(_ config.GinkgoConfigType, _ *types.SuiteSummary)
type JUnitSkipped struct { // Message maps onto "pending" if the test was marked pending, "skipped" if the test was marked skipped, and "skipped - REASON" if the user called Skip(REASON) Message string `xml:"message,attr"` }
type JUnitTestCase struct { // Name maps onto the full text of the spec - equivalent to "[SpecReport.LeafNodeType] SpecReport.FullText()" Name string `xml:"name,attr"` // Classname maps onto the name of the test suite - equivalent to Report.SuiteDescription Classname string `xml:"classname,attr"` // Status maps onto the string representation of SpecReport.State Status string `xml:"status,attr"` // Time is the time in seconds to execute the spec - maps onto SpecReport.RunTime Time float64 `xml:"time,attr"` // Owner is the owner the spec - is set if a label matching Label("owner:X") is provided. The last matching label is used as the owner, thereby allowing specs to override owners specified in container nodes. Owner string `xml:"owner,attr,omitempty"` //Skipped is populated with a message if the test was skipped or pending Skipped *JUnitSkipped `xml:"skipped,omitempty"` //Error is populated if the test panicked or was interrupted Error *JUnitError `xml:"error,omitempty"` //Failure is populated if the test failed Failure *JUnitFailure `xml:"failure,omitempty"` //SystemOut maps onto any captured stdout/stderr output - maps onto SpecReport.CapturedStdOutErr SystemOut string `xml:"system-out,omitempty"` //SystemOut maps onto any captured GinkgoWriter output - maps onto SpecReport.CapturedGinkgoWriterOutput SystemErr string `xml:"system-err,omitempty"` }
type JUnitTestSuite struct { // Name maps onto the description of the test suite - maps onto Report.SuiteDescription Name string `xml:"name,attr"` // Package maps onto the absolute path to the test suite - maps onto Report.SuitePath Package string `xml:"package,attr"` // Tests maps onto the total number of specs in the test suite (this includes any suite nodes such as BeforeSuite) Tests int `xml:"tests,attr"` // Disabled maps onto specs that are pending Disabled int `xml:"disabled,attr"` // Skiped maps onto specs that are skipped Skipped int `xml:"skipped,attr"` // Errors maps onto specs that panicked or were interrupted Errors int `xml:"errors,attr"` // Failures maps onto specs that failed Failures int `xml:"failures,attr"` // Time is the time in seconds to execute all the test suite - maps onto Report.RunTime Time float64 `xml:"time,attr"` // Timestamp is the ISO 8601 formatted start-time of the suite - maps onto Report.StartTime Timestamp string `xml:"timestamp,attr"` //Properties captures the information stored in the rest of the Report type (including SuiteConfig) as key-value pairs Properties JUnitProperties `xml:"properties"` //TestCases capture the individual specs TestCases []JUnitTestCase `xml:"testcase"` }
type JUnitTestSuites struct { XMLName xml.Name `xml:"testsuites"` // Tests maps onto the total number of specs in all test suites (this includes any suite nodes such as BeforeSuite) Tests int `xml:"tests,attr"` // Disabled maps onto specs that are pending and/or skipped Disabled int `xml:"disabled,attr"` // Errors maps onto specs that panicked or were interrupted Errors int `xml:"errors,attr"` // Failures maps onto specs that failed Failures int `xml:"failures,attr"` // Time is the time in seconds to execute all test suites Time float64 `xml:"time,attr"` //The set of all test suites TestSuites []JUnitTestSuite `xml:"testsuite"` }
type JunitReportConfig struct { // Spec States for which no timeline should be emitted for system-err // set this to types.SpecStatePassed|types.SpecStateSkipped|types.SpecStatePending to only match failing specs OmitTimelinesForSpecState types.SpecState // Enable OmitFailureMessageAttr to prevent failure messages appearing in the "message" attribute of the Failure and Error tags OmitFailureMessageAttr bool //Enable OmitCapturedStdOutErr to prevent captured stdout/stderr appearing in system-out OmitCapturedStdOutErr bool // Enable OmitSpecLabels to prevent labels from appearing in the spec name OmitSpecLabels bool // Enable OmitLeafNodeType to prevent the spec leaf node type from appearing in the spec name OmitLeafNodeType bool // Enable OmitSuiteSetupNodes to prevent the creation of testcase entries for setup nodes OmitSuiteSetupNodes bool }
type NoopReporter struct{}
func (n NoopReporter) DidRun(report types.SpecReport)
func (n NoopReporter) EmitFailure(state types.SpecState, failure types.Failure)
func (n NoopReporter) EmitProgressReport(progressReport types.ProgressReport)
func (n NoopReporter) EmitReportEntry(entry types.ReportEntry)
func (n NoopReporter) EmitSpecEvent(event types.SpecEvent)
func (n NoopReporter) SuiteDidEnd(report types.Report)
func (n NoopReporter) SuiteWillBegin(report types.Report)
func (n NoopReporter) WillRun(report types.SpecReport)
type Reporter interface { SuiteWillBegin(report types.Report) WillRun(report types.SpecReport) DidRun(report types.SpecReport) SuiteDidEnd(report types.Report) //Timeline emission EmitFailure(state types.SpecState, failure types.Failure) EmitProgressReport(progressReport types.ProgressReport) EmitReportEntry(entry types.ReportEntry) EmitSpecEvent(event types.SpecEvent) }