testflow

package
v0.0.0-...-02c6b06 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyConfigScope

func ApplyConfigScope(steps map[string]*Step)

ApplyConfigScope calculates the artifacts from all serial parent nodes and merges them. Whereas the nearer parent's configs overwrites the config when collisions occur

func ApplyOutputScope

func ApplyOutputScope(steps map[string]*Step) error

ApplyOutputScope defines the artifact scopes for outputs. This is done by getting the last serial step and setting is as the current nodes artifact source.

func CreateInitialDAG

func CreateInitialDAG(steps map[string]*Step, root *node.Node)

CreateInitialDAG creates a DAG by evaluating the dependsOn steps.

func ReorderChildrenOfNodes

func ReorderChildrenOfNodes(list *node.Set) *node.Set

ReorderChildrenOfNodes recursively reorders all children of a nodelist so that serial steps run in serial after parallel nodes. Returns nil if successful.

func SetSerialNodes

func SetSerialNodes(root *node.Node)

SetSerialNodes evaluates real serial steps and marks them as serial. A node is considered serial if all children of the root node point to one child.

func Validate

func Validate(fldPath *field.Path, tf tmv1beta1.TestFlow, locs locations.Locations, ignoreEmptyFlow bool) (field.ErrorList, bool)

Validate validates a testrun and all its subcomponenets. This function validate in addition to the default validation function also the testlocations. Returns true if the operation cvan be retried. todo: refactor this to use better errors

Types

type Flow

type Flow struct {
	ID   FlowIdentifier
	Root *node.Node
	// contains filtered or unexported fields
}

Flow represents the internal DAG.

func NewFlow

func NewFlow(flowID FlowIdentifier, root *node.Node, tf tmv1beta1.TestFlow, loc locations.Locations, globalConfig []*config.Element) (*Flow, error)

NewFlow takes a testflow and the global config, and generates the DAG. It generates an internal DAG representation and creates the corresponding argo DAG and templates.

func (*Flow) GetDAGTemplate

func (f *Flow) GetDAGTemplate(phase testmachinery.Phase, trustedTokenMounts, untrustedTokenMounts []node.ProjectedTokenMount) *argov1.DAGTemplate

func (*Flow) GetStatuses

func (f *Flow) GetStatuses() []*tmv1beta1.StepStatus

GetStatuses returns the status of all nodes of the current flow.

func (*Flow) GetTemplates

func (f *Flow) GetTemplates() ([]argov1.Template, error)

GetTemplates returns all TestDefinitions templates and the DAG of the testrun

func (*Flow) GetVolumes

func (f *Flow) GetVolumes() []corev1.Volume

GetVolumes returns all volumes of local TestDefLocations and used configuration with a reference to a secret or configuration.

func (*Flow) Iterate

func (f *Flow) Iterate() <-chan *node.Node

Iterate iterates over the flow and returns their nodes.

type FlowIdentifier

type FlowIdentifier string

FlowIdentifier is the flow identifier

const (
	// FlowIDTest represents the flow identifier of the main testflow "spec.testflow"
	FlowIDTest FlowIdentifier = "testflow"
	// FlowIDExit represents the flow identifier of the onExit testflow "spec.onExit"
	FlowIDExit FlowIdentifier = "exit"
)

type Step

type Step struct {
	Info  *tmv1beta1.DAGStep
	Nodes *node.Set
}

Step is a StepDefinition with its specific Row and Column in the testflow.

type Testflow

type Testflow struct {
	Info tmv1beta1.TestFlow
	Flow *Flow
}

Testflow is an object containing informations about the testflow of a testrun

func New

func New(flowID FlowIdentifier, tf tmv1beta1.TestFlow, locs locations.Locations, globalConfig []*config.Element, prepareDef *prepare.Definition) (*Testflow, error)

New takes a testflow definition, test definitions and the global config, and creates a new tesrun representation

func (*Testflow) GetLocalVolumes

func (tf *Testflow) GetLocalVolumes() []apiv1.Volume

GetLocalVolumes returns all volumes of local TestDefLocations

func (*Testflow) GetTemplates

func (tf *Testflow) GetTemplates(name string, phase testmachinery.Phase, trustedTokenMounts, untrustedTokenMounts []node.ProjectedTokenMount) ([]argov1.Template, error)

GetTemplates returns all TestDefinitions templates and the DAG of the testrun

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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