milestone

package
v0.0.0-...-d08dcf8 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvironmentType      = "dev.knative.rekt.environment.v1"
	NamespaceCreatedType = "dev.knative.rekt.namespace.created.v1"
	NamespaceDeletedType = "dev.knative.rekt.namespace.deleted.v1"
	TestStartedType      = "dev.knative.rekt.test.started.v1"
	TestFinishedType     = "dev.knative.rekt.test.finished.v1"
	StepsPlannedType     = "dev.knative.rekt.steps.planned.v1"
	StepStartedType      = "dev.knative.rekt.step.started.v1"
	StepFinishedType     = "dev.knative.rekt.step.finished.v1"
	TestSetStartedType   = "dev.knative.rekt.testset.started.v1"
	TestSetFinishedType  = "dev.knative.rekt.testset.finished.v1"
	FinishedType         = "dev.knative.rekt.finished.v1"
	ExceptionType        = "dev.knative.rekt.exception.v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Emitter

type Emitter interface {
	Environment(env map[string]string)
	NamespaceCreated(namespace string)
	NamespaceDeleted(namespace string)
	TestStarted(feature string, t feature.T)
	TestFinished(feature string, t feature.T)
	StepsPlanned(feature string, steps map[feature.Timing][]feature.Step, t feature.T)
	StepStarted(feature string, step *feature.Step, t feature.T)
	StepFinished(feature string, step *feature.Step, t feature.T)
	TestSetStarted(featureSet string, t feature.T)
	TestSetFinished(featureSet string, t feature.T)
	Finished(result Result)
	Exception(reason, messageFormat string, messageA ...interface{})
}

Emitter sends milestone events.

func Compose

func Compose(emitters ...Emitter) Emitter

Compose creates an Emitter from a list of Emitters.

func NewMilestoneEmitter

func NewMilestoneEmitter(instance, namespace, uri string) (Emitter, error)

NewMilestoneEmitter will convert target uri to a milestone event sender and return it.

func NewMilestoneEmitterFromEnv

func NewMilestoneEmitterFromEnv(instance, namespace string) (Emitter, error)

NewMilestoneEmitterFromEnv will attempt to pull the env var `MILESTONE_EVENTS_TARGET` as the target uri for sending milestone events.

func NewTracingGatherer

func NewTracingGatherer(ctx context.Context, namespace string, zipkinNamespace string, t feature.T) (Emitter, error)

NewTracingGatherer implements Emitter and gathers traces for events from the tracing entpoint.

type Factory

type Factory struct {
	Subject string
	Source  string
}

func NewFactory

func NewFactory(id, namespace string) *Factory

func (*Factory) Environment

func (ef *Factory) Environment(env map[string]string) cloudevents.Event

func (*Factory) Exception

func (ef *Factory) Exception(reason, messageFormat string, messageA ...interface{}) cloudevents.Event

func (*Factory) Finished

func (ef *Factory) Finished() cloudevents.Event

func (*Factory) NamespaceCreated

func (ef *Factory) NamespaceCreated(namespace string) cloudevents.Event

func (*Factory) NamespaceDeleted

func (ef *Factory) NamespaceDeleted(namespace string) cloudevents.Event

func (*Factory) StepFinished

func (ef *Factory) StepFinished(feature, stepName, timing, level, testName string, skipped, failed bool) cloudevents.Event

func (*Factory) StepStarted

func (ef *Factory) StepStarted(feature, stepName, timing, level, testName string) cloudevents.Event

func (*Factory) StepsPlanned

func (ef *Factory) StepsPlanned(feature string, steps map[string][]string, testName string) cloudevents.Event

func (*Factory) TestFinished

func (ef *Factory) TestFinished(feature, testName string, skipped, failed bool) cloudevents.Event

func (*Factory) TestSetFinished

func (ef *Factory) TestSetFinished(featureSet, testName string, skipped, failed bool) cloudevents.Event

func (*Factory) TestSetStarted

func (ef *Factory) TestSetStarted(featureSet, testName string) cloudevents.Event

func (*Factory) TestStarted

func (ef *Factory) TestStarted(feature, testName string) cloudevents.Event

type LogEmitter

type LogEmitter struct {
	AlwaysDumpEvents bool
	// contains filtered or unexported fields
}

LogEmitter is an Emitter that logs milestone events.

func NewLogEmitter

func NewLogEmitter(ctx context.Context, namespace string) *LogEmitter

NewLogEmitter creates an Emitter that logs milestone events.

func (LogEmitter) Environment

func (l LogEmitter) Environment(env map[string]string)

func (LogEmitter) Exception

func (l LogEmitter) Exception(reason, messageFormat string, messageA ...interface{})

func (LogEmitter) Finished

func (l LogEmitter) Finished(result Result)

func (LogEmitter) NamespaceCreated

func (l LogEmitter) NamespaceCreated(namespace string)

func (LogEmitter) NamespaceDeleted

func (l LogEmitter) NamespaceDeleted(namespace string)

func (LogEmitter) StepFinished

func (l LogEmitter) StepFinished(feature string, step *feature.Step, t feature.T)

func (LogEmitter) StepStarted

func (l LogEmitter) StepStarted(feature string, step *feature.Step, t feature.T)

func (LogEmitter) StepsPlanned

func (l LogEmitter) StepsPlanned(feature string, steps map[feature.Timing][]feature.Step, t feature.T)

func (LogEmitter) TestFinished

func (l LogEmitter) TestFinished(feature string, t feature.T)

func (LogEmitter) TestSetFinished

func (l LogEmitter) TestSetFinished(featureSet string, t feature.T)

func (LogEmitter) TestSetStarted

func (l LogEmitter) TestSetStarted(featureSet string, t feature.T)

func (LogEmitter) TestStarted

func (l LogEmitter) TestStarted(feature string, t feature.T)

type NilSafeClient

type NilSafeClient struct {
	Client  cloudevents.Client
	Factory *Factory
}

NilSafeClient is a simple wrapper around a cloudevent client that implements Emitter to provide nil check safety.

func (*NilSafeClient) Environment

func (n *NilSafeClient) Environment(env map[string]string)

func (*NilSafeClient) Event

func (n *NilSafeClient) Event(ctx context.Context, event cloudevents.Event)

Event implements Emitter.Event.

func (*NilSafeClient) Exception

func (n *NilSafeClient) Exception(reason, messageFormat string, messageA ...interface{})

func (*NilSafeClient) Finished

func (n *NilSafeClient) Finished(_ Result)

func (*NilSafeClient) NamespaceCreated

func (n *NilSafeClient) NamespaceCreated(namespace string)

func (*NilSafeClient) NamespaceDeleted

func (n *NilSafeClient) NamespaceDeleted(namespace string)

func (*NilSafeClient) StepFinished

func (n *NilSafeClient) StepFinished(feature string, step *feature.Step, t feature.T)

func (*NilSafeClient) StepStarted

func (n *NilSafeClient) StepStarted(feature string, step *feature.Step, t feature.T)

func (*NilSafeClient) StepsPlanned

func (n *NilSafeClient) StepsPlanned(feature string, steps map[feature.Timing][]feature.Step, t feature.T)

func (*NilSafeClient) TestFinished

func (n *NilSafeClient) TestFinished(feature string, t feature.T)

func (*NilSafeClient) TestSetFinished

func (n *NilSafeClient) TestSetFinished(featureSet string, t feature.T)

func (*NilSafeClient) TestSetStarted

func (n *NilSafeClient) TestSetStarted(featureSet string, t feature.T)

func (*NilSafeClient) TestStarted

func (n *NilSafeClient) TestStarted(feature string, t feature.T)

type Result

type Result interface {
	Failed() bool
}

Jump to

Keyboard shortcuts

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