Documentation ¶
Index ¶
- func ApplyConfigScope(steps map[string]*Step)
- func ApplyOutputScope(steps map[string]*Step) error
- func CreateInitialDAG(steps map[string]*Step, root *node.Node)
- func ReorderChildrenOfNodes(list *node.Set) *node.Set
- func SetSerialNodes(root *node.Node)
- func Validate(fldPath *field.Path, tf tmv1beta1.TestFlow, locs locations.Locations, ...) (field.ErrorList, bool)
- type Flow
- type FlowIdentifier
- type Step
- type Testflow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyConfigScope ¶
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 ¶
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 ¶
CreateInitialDAG creates a DAG by evaluating the dependsOn steps.
func ReorderChildrenOfNodes ¶
ReorderChildrenOfNodes recursively reorders all children of a nodelist so that serial steps run in serial after parallel nodes. Returns nil if successful.
func SetSerialNodes ¶
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 ¶
GetTemplates returns all TestDefinitions templates and the DAG of the testrun
func (*Flow) GetVolumes ¶
GetVolumes returns all volumes of local TestDefLocations and used configuration with a reference to a secret or configuration.
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 Testflow ¶
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 ¶
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