Documentation
¶
Index ¶
- Constants
- Variables
- type Ctx
- type IncludeDirList
- type Plugin
- type PluginDef
- func (pd PluginDef) GetPluginDefDir() (string, error)
- func (pd PluginDef) GetPluginDefEmitJSON() (bool, error)
- func (pd PluginDef) GetPluginDefFilename() (string, error)
- func (pd PluginDef) GetPluginDefIncludeDirsKey() ([]string, error)
- func (pd PluginDef) GetPluginDefLabels() (string, error)
- func (pd PluginDef) GetPluginDefList() (bool, error)
- func (pd PluginDef) GetPluginDefLogLevel() (string, error)
- func (pd PluginDef) GetPluginDefName() (string, error)
- func (pd PluginDef) GetPluginDefNonzeroOnAnyErrorKey() (bool, error)
- func (pd PluginDef) GetPluginDefParams() (map[string]interface{}, error)
- func (pd PluginDef) GetPluginDefPriority() (int, error)
- func (pd PluginDef) GetPluginDefRetry() (string, error)
- func (pd PluginDef) GetPluginDefSeed() (int64, error)
- func (pd PluginDef) GetPluginDefTests() ([]string, error)
- func (pd PluginDef) GetPluginDefVerbose() (bool, error)
- type PluginMaker
- type PluginModule
- type PluginOpts
- type PluginRegistry
- type TestConstraints
- type TestDef
- type TestDefMap
- type TestDefRef
- type TestDefRefList
- type TestGroup
- type TestGroupList
- type TestGroupMap
- type TestGroupRef
- type TestGroupRefList
- type TestGuard
- type TestIterate
- type TestIterateBindings
- type TestIterateBindingsList
- type TestList
- type TestParamBinding
- type TestParamBindingMap
- type TestParamDependency
- type TestParamDependencyList
- type TestParamEnvMap
- type TestParamMap
- type TestRun
- type TestRunParams
- type TestSuiteRef
Constants ¶
const ( // PluginDefNameKey of the PluginDef map PluginDefNameKey = "Name" // PluginDefDirKey of the PluginDef map PluginDefDirKey = "Dir" // PluginDefFilenameKey of the PluginDef map PluginDefFilenameKey = "Filename" // PluginDefParamsKey of the PluginDef map PluginDefParamsKey = "Params" // PluginDefSeedKey of the PluginDef map PluginDefSeedKey = "Seed" // PluginDefVerboseKey of the PluginDef map PluginDefVerboseKey = "Verbose" // PluginDefPriorityKey of the PluginDef map PluginDefPriorityKey = "Priority" // PluginDefLabelsKey of the PluginDef map PluginDefLabelsKey = "Labels" // PluginDefTestsKey of the PluginDef map PluginDefTestsKey = "Tests" // PluginDefLogLevelKey of the PluginDef map PluginDefLogLevelKey = "LogLevels" // PluginDefListKey of the PluginDef map PluginDefListKey = "List" // PluginDefEmitJSONKey of the PluginDef map PluginDefEmitJSONKey = "EmitJSON" // PluginDefNonzeroOnAnyErrorKey of the PluginDef map PluginDefNonzeroOnAnyErrorKey = "NonzeroOnAnyErrorKey" // PluginDefRetryKey of the PluginDef map PluginDefRetryKey = "Retry" // PluginDefIncludeDirsKey of the PluginDef map PluginDefIncludeDirsKey = "IncludeDirs" )
Variables ¶
var ThePluginRegistry = make(PluginRegistry)
ThePluginRegistry is the global, well-know registry of supported plax Plugin types
Functions ¶
This section is empty.
Types ¶
type IncludeDirList ¶
type IncludeDirList []string
IncludeDirList are the directories to search when YAML-including.
We make an explicit type to enable flag.Var to parse multiple parameters.
func (*IncludeDirList) Set ¶
func (idl *IncludeDirList) Set(value string) error
Set the include directories
type Plugin ¶
Plugin interface of invoking plax
func MakePlugin ¶
func MakePlugin(module PluginModule, def PluginDef) (Plugin, error)
MakePlugin create the plugin
type PluginDef ¶
type PluginDef map[string]interface{}
PluginDef map
func (PluginDef) GetPluginDefDir ¶
GetPluginDefDir returns the Dir
func (PluginDef) GetPluginDefEmitJSON ¶
GetPluginDefEmitJSON returns the EmitJSON flag
func (PluginDef) GetPluginDefFilename ¶
GetPluginDefFilename returns the Filename
func (PluginDef) GetPluginDefIncludeDirsKey ¶ added in v0.5.3
GetPluginDefIncludeDirsKey returns the Includes list
func (PluginDef) GetPluginDefLabels ¶
GetPluginDefLabels returns the Labels
func (PluginDef) GetPluginDefList ¶
GetPluginDefList returns the List flag
func (PluginDef) GetPluginDefLogLevel ¶
GetPluginDefLogLevel returns the Filename
func (PluginDef) GetPluginDefName ¶
GetPluginDefName returns the Name
func (PluginDef) GetPluginDefNonzeroOnAnyErrorKey ¶
GetPluginDefNonzeroOnAnyErrorKey returns the EmitJSON flag
func (PluginDef) GetPluginDefParams ¶
GetPluginDefParams returns the Params
func (PluginDef) GetPluginDefPriority ¶
GetPluginDefPriority returns the Priority
func (PluginDef) GetPluginDefRetry ¶
GetPluginDefRetry returns the Retry
func (PluginDef) GetPluginDefSeed ¶
GetPluginDefSeed returns the Seed
func (PluginDef) GetPluginDefTests ¶
GetPluginDefTests returns the list of test to run
func (PluginDef) GetPluginDefVerbose ¶
GetPluginDefVerbose returns the Filename
type PluginMaker ¶
PluginMaker is the signature for a Plugin constructor
type PluginModule ¶
type PluginModule string
PluginModule identifies the plax plugin by module name
var ( // DefaultPluginModule to load; "There can be only one!" DefaultPluginModule PluginModule = "github.com/Comcast/plax" )
type PluginOpts ¶
type PluginOpts interface{}
PluginOpts represents generic data that is given to a plugin
type PluginRegistry ¶
type PluginRegistry map[PluginModule]PluginMaker
PluginRegistry maps a PluginModule to a constructor for that type of Plugin
func (PluginRegistry) Register ¶
func (pr PluginRegistry) Register(module PluginModule, maker PluginMaker)
Register registers a plugin
type TestConstraints ¶
type TestConstraints struct {
Labels *string `yaml:"labels,omitempty"`
Priority *int `yaml:"priority,omitempty"`
Retry int `yaml:"retry"`
Seed int64 `yaml:"seed"`
Iterate *TestIterate `yaml:"iterate,omitempty"`
}
TestConstraints used to constrain the tests run
type TestDef ¶
type TestDef struct {
Path string `yaml:"path"`
Module PluginModule `yaml:"version"`
Params TestParamDependencyList `yaml:"params"`
}
TestDef is a test file or suite (directory)
type TestDefRef ¶
type TestDefRef struct {
TestConstraints `yaml:",inline"`
Name string `yaml:"name"`
Params TestParamMap `yaml:"params"`
Guard *TestGuard `yaml:"guard,omitempty"`
// contains filtered or unexported fields
}
TestDefRef references a TestDef with its constraints
type TestGroup ¶
type TestGroup struct {
Iterate *TestIterate `yaml:"iterate,omitempty"`
Params TestParamMap `yaml:"params"`
Tests TestDefRefList `yaml:"tests"`
Groups TestGroupRefList `yaml:"groups"`
}
TestGroup is a set of grouped tests or nested groups
type TestGroupList ¶
type TestGroupList []string
TestGroupList are the test groups to execute
We make an explicit type to enable flag.Var to parse multiple parameters.
type TestGroupRef ¶
type TestGroupRef struct {
Name string `yaml:"name"`
Params TestParamMap `yaml:"params"`
Guard *TestGuard `yaml:"guard,omitempty"`
}
TestGroupRef references a group by name
type TestGroupRefList ¶
type TestGroupRefList []TestGroupRef
TestGroupRefList is a list of TestGroupRefs
type TestGuard ¶
type TestGuard struct {
// Libraries is a list of filenames that should contain
// Javascript. This source is loaded into each Javascript
// environment.
DependsOn TestParamDependencyList `yaml:"dependsOn"`
Libraries []string `yaml:"libraries"`
Source string `yaml:"src"`
}
TestGuard for guarding tests, groups, or iterations
type TestIterate ¶
type TestIterate struct {
DependsOn TestParamDependencyList `yaml:"dependsOn"`
Param *string `yaml:"param"`
Params string `yaml:"params"`
Guard *TestGuard `yaml:"guard,omitempty"`
}
TestIterate is used to iterate over a collection and invoke the test suite or test file multiple times
type TestIterateBindings ¶
type TestIterateBindings struct {
// contains filtered or unexported fields
}
TestIterateBindings is the bindings for an iteration
type TestIterateBindingsList ¶
type TestIterateBindingsList []TestIterateBindings
TestIterateBindingsList is a list of test iteration bindings
type TestList ¶
type TestList []string
TestList are the individual tests to execute
We make an explicit type to enable flag.Var to parse multiple parameters.
type TestParamBinding ¶
type TestParamBinding struct {
// DependsOn is a list of dependent parameters
DependsOn TestParamDependencyList `json:"dependsOn" yaml:"dependsOn"`
// Cmd is the command name of the program.
//
// Subject to expansion.
Cmd string `json:"cmd" yaml:"cmd"`
// Args is the list of command-line arguments for the program.
//
// Subject to expansion.
Args []string `json:"args" yaml:"args"`
// tpem is the map of environment variables to pass into the Run script
Envs TestParamEnvMap `json:"envs" yaml:"envs"`
// contains filtered or unexported fields
}
TestParamBinding binds a value to a parameter via a command
type TestParamBindingMap ¶
type TestParamBindingMap map[string]TestParamBinding
TestParamBindingMap is a map of TestParamBinding
type TestParamDependencyList ¶
type TestParamDependencyList []TestParamDependency
TestParamDependencyList parameter dependency list
type TestParamMap ¶
TestParamMap of parameter keys to non substituted parameter values
type TestRun ¶
type TestRun struct {
Name string `yaml:"name"`
Version string `yaml:"version"`
Tests TestDefMap `yaml:"tests"`
Groups TestGroupMap `yaml:"groups"`
Params TestParamBindingMap `yaml:"params"`
// contains filtered or unexported fields
}
TestRun is the top-level type for a test run.
func NewTestRun ¶
func NewTestRun(ctx *Ctx, trps *TestRunParams) (*TestRun, error)
NewTestRun makes a new TestRun with the given TestRunParams
type TestRunParams ¶
type TestRunParams struct {
Bindings plaxDsl.Bindings
Groups TestGroupList
Tests TestList
SuiteName *string
IncludeDirs IncludeDirList
Filename *string
Dir *string
EmitJSON *bool
Verbose *bool
LogLevel *string
Labels *string
Priority *int
}
TestRunParams used to exec a TestRun
type TestSuiteRef ¶
type TestSuiteRef struct {
// contains filtered or unexported fields
}
TestSuiteRef reference