assert

package
v0.0.0-...-dc1648f Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnmatchedRegexp regular expression doesn't match any results.
	ErrUnmatchedRegexp = errors.New("unmatched regexp")

	// ErrStepFailed indicates one or more steps (status condition) failed.
	ErrStepFailed = errors.New("failed step")
)
View Source
var ErrUnsupportedGV = errors.New("unsupported resource group-version")

ErrUnsupportedGV the resource group version informed (subject) is not supported.

Functions

This section is empty.

Types

type Assert

type Assert interface {
	// Status asserts the instance status conditions.
	Status() error

	// Results asserts the instance results against the slice of regular expressions.
	Results(_ []regexp.Regexp) error
}

Assert defines the Assert role, responsible for asserting the final status of the different type of resources asserted by this application.

func NewAssert

func NewAssert(ctx context.Context, cfg *config.Config, subject *probe.Subject) (Assert, error)

NewAssert proxy the Assert instantiation based on the subject resource group-version (GVR).

type PipelineRunAssert

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

PipelineRunAssert asserts the elements of a PipelineRun instance.

func NewPipelineRunAssert

func NewPipelineRunAssert(
	ctx context.Context,
	cfg *config.Config,
	subject *probe.Subject,
) (*PipelineRunAssert, error)

NewPipelineRunAssert instantiates the PipelineRunAssert with a up-to-date PipelineRun instance and the children TaskRun statuses.

func (*PipelineRunAssert) Results

func (a *PipelineRunAssert) Results(rules []regexp.Regexp) error

Results asserts the PipelineRun children TaskRun instances.

func (*PipelineRunAssert) Status

func (a *PipelineRunAssert) Status() error

Status asserts the instance status conditions.

type TaskRunAssert

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

TaskRunAssert asserts a TaskRun instance.

func NewTaskRunAssert

func NewTaskRunAssert(cfg *config.Config, subject *probe.Subject) (*TaskRunAssert, error)

NewTaskRunAssert instantiate the TaskRunAssert by loading the TaskRun (subject) resource.

func (*TaskRunAssert) Results

func (a *TaskRunAssert) Results(rules []regexp.Regexp) error

Results asserts the TaskRun results against the informed regular expressions.

func (*TaskRunAssert) Status

func (a *TaskRunAssert) Status() error

Status assert the TaskRun status conditions.

Jump to

Keyboard shortcuts

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