reporter

package
v1.7.1-0...-23dd39d Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 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 NewGardenerESReporter

func NewGardenerESReporter(filename, index string) ginkgo.Reporter

NewGardenerESReporter creates a new Gardener elasticsearch reporter. The json bulk will be stored in the passed filename in the given es index.

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"
	// SpecPhaseTimeout is a test which execution time was longer than the specified timeout
	SpecPhaseTimeout ESSpecPhase = "Timeout"
)

func PhaseForState

func PhaseForState(state ginkgotypes.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 *ginkgotypes.SetupSummary)

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

func (*GardenerESReporter) BeforeSuiteDidRun

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

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

func (*GardenerESReporter) SpecDidComplete

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

SpecDidComplete analysis the completed test and creates new es entry

func (*GardenerESReporter) SpecSuiteDidEnd

func (reporter *GardenerESReporter) SpecSuiteDidEnd(summary *ginkgotypes.SuiteSummary)

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

func (*GardenerESReporter) SpecSuiteWillBegin

func (reporter *GardenerESReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *ginkgotypes.SuiteSummary)

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

func (*GardenerESReporter) SpecWillRun

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

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

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