reporter

package
v1.40.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDeprecatedGardenerESReporter added in v1.40.0

func NewDeprecatedGardenerESReporter(filename, index string) reporters.DeprecatedReporter

NewDeprecatedGardenerESReporter creates a new Gardener elasticsearch reporter. The json bulk will be stored in the passed filename in the given es index. It can be used with reporters.ReportViaDeprecatedReporter in ginkgo v2 to get the same reporting as in ginkgo v1. However, it must be invoked in ReportAfterSuite instead of passed to RunSpecsWithDefaultAndCustomReporters, hence it was renamed to force dependent repositories to adapt. Deprecated: this needs to be reworked to ginkgo's new reporting infrastructure, ReportViaDeprecatedReporter will be removed in a future version of ginkgo v2, see https://onsi.github.io/ginkgo/MIGRATING_TO_V2#removed-custom-reporters

Types

type ESSpecPhase

type ESSpecPhase string

ESSpecPhase represents the phase of a test

const (
	// SpecPhaseUnknown is a test that unknown or skipped
	SpecPhaseUnknown ESSpecPhase = "Unknown"
	// SpecPhasePending is a test that is still running
	SpecPhasePending ESSpecPhase = "Pending"
	// SpecPhaseSucceeded is a successfully completed test
	SpecPhaseSucceeded ESSpecPhase = "Succeeded"
	// SpecPhaseFailed is a failed test
	SpecPhaseFailed ESSpecPhase = "Failed"
	// SpecPhaseInterrupted is a test which execution time was longer than the specified timeout
	SpecPhaseInterrupted ESSpecPhase = "Interrupted"
)

func PhaseForState

func PhaseForState(state types.SpecState) ESSpecPhase

PhaseForState maps ginkgo spec states to internal elasticsearch used phases

type FailureMessage

type FailureMessage struct {
	Type    ESSpecPhase `json:"type"`
	Message string      `json:"message"`
}

FailureMessage describes the error and the log output if a error occurred.

type GardenerESReporter

type GardenerESReporter struct {
	// contains filtered or unexported fields
}

GardenerESReporter is a custom ginkgo exporter for gardener integration tests that write a summary of the tests in a elastic search json report.

func (*GardenerESReporter) AfterSuiteDidRun

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

AfterSuiteDidRun is implemented as a noop to satisfy the reporter interface for ginkgo.

func (*GardenerESReporter) BeforeSuiteDidRun

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

BeforeSuiteDidRun is implemented as a noop to satisfy the reporter interface for ginkgo.

func (*GardenerESReporter) SpecDidComplete

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

SpecDidComplete analysis the completed test and creates new es entry

func (*GardenerESReporter) SpecWillRun

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

SpecWillRun is implemented as a noop to satisfy the reporter interface for ginkgo.

func (*GardenerESReporter) SuiteDidEnd added in v1.40.0

func (reporter *GardenerESReporter) SuiteDidEnd(summary *types.SuiteSummary)

SuiteDidEnd collects the metadata for the whole test suite and writes the results as elasticsearch json bulk to the specified location.

func (*GardenerESReporter) SuiteWillBegin added in v1.40.0

func (reporter *GardenerESReporter) SuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary)

SuiteWillBegin is the first function that is invoked by ginkgo when a test suites starts. It is used to setup metadata information about the suite

type TestCase

type TestCase struct {
	Metadata       *TestSuiteMetadata `json:"suite"`
	Name           string             `json:"name"`
	ShortName      string             `json:"shortName"`
	Labels         []string           `json:"labels,omitempty"`
	Phase          ESSpecPhase        `json:"phase"`
	FailureMessage *FailureMessage    `json:"failure,omitempty"`
	Duration       float64            `json:"duration"`
	SystemOut      string             `json:"system-out,omitempty"`
}

TestCase is one instanace of a test execution

type TestSuiteMetadata

type TestSuiteMetadata struct {
	Name     string      `json:"name"`
	Phase    ESSpecPhase `json:"phase"`
	Tests    int         `json:"tests"`
	Failures int         `json:"failures"`
	Errors   int         `json:"errors"`
	Duration float64     `json:"duration"`
}

TestSuiteMetadata describes the metadata of a whole test suite with all tests.

Jump to

Keyboard shortcuts

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