executeutil

package
v0.0.0-...-040724e Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: BSD-3-Clause, GPL-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotABundle   = errors.New("Path is not parsable as a valid bundle.")
	ErrNotAWorkflow = errors.New("Path is not parsable as a valid workflows.")
	ErrNotAParams   = errors.New("Path is not parsable as a valid params.")
)

Functions

func UnmarshalAll

func UnmarshalAll(paths ...string) (map[string]*Bundle, map[string]*workflow.Desc, map[string]*execute.RawParams, utils.ErrorSlice)

UnmarshalAll attempts to read and parse all the file paths supplied, categorising the content into Bundles, Workflows and Params. Resulting maps have the path as the key.

Types

type Bundle

type Bundle struct {
	workflow.Desc
	execute.RawParams
	workflowtest.TestOpt
	Version    string             `json:"version"`
	Properties workflowProperties `json:"Properties"`
}

A Bundle is a workflow with its inputs

func UnmarshalSingle

func UnmarshalSingle(bundlePath, workflowPath, paramsPath string) (*Bundle, error)

UnmarshalSingle can either be supplied with a single bundlePath, or with both a workflowPath and a paramsPath. This slightly unusual API exists because there are a few places where due to flags or other sources of input, it is simplest to provide all possible inputs here. The bundle returned will either be constructed from the bundlePath alone, or from both the workflowPath and paramsPath. Any other combination will error.

type TestInput

type TestInput struct {
	Dir          string
	BundlePath   string
	ParamsPath   string
	WorkflowPath string
	Params       *execute.RawParams
	Workflow     *workflow.Desc
	Expected     workflowtest.TestOpt
}

A TestInput is a workflow, its iputs and expected output

func FindTestInputs

func FindTestInputs(basePath string) ([]*TestInput, error)

FindTestInputs finds any test inputs under basePath.

func (TestInput) Paths

func (a TestInput) Paths() (rs []string)

Paths returns the filepaths that this TestInput was created from

Jump to

Keyboard shortcuts

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