Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupPurgeJob ¶
CleanupPurgeJob is a cleanup func to purge the TestCase job from Nomad
Types ¶
type DeployTestStepRunner ¶
type DeployTestStepRunner struct {
FixtureName string
Vars map[string]interface{}
Canary int
ForceBatch bool
ForceCount bool
}
DeployTestStepRunner implements TestStepRunner to execute a levant deployment
func (DeployTestStepRunner) Run ¶
func (c DeployTestStepRunner) Run(s *TestState) error
Run renders the job fixture and triggers a deployment
type TestCase ¶
type TestCase struct {
// Steps are ran in order stopping on failure
Steps []TestStep
// SetupFunc is called at before the steps
SetupFunc TestStateFunc
// CleanupFunc is called at the end of the TestCase
CleanupFunc TestStateFunc
}
TestCase is a single test of levant
type TestStateFunc ¶
TestStateFunc is used to verify acceptance test criteria
func CheckDeploymentStatus ¶
func CheckDeploymentStatus(status string) TestStateFunc
CheckDeploymentStatus is a TestStateFunc to check if the latest deployment of the TestCase job matches the desired status
func CheckTaskGroupCount ¶
func CheckTaskGroupCount(groupName string, count int) TestStateFunc
CheckTaskGroupCount is a TestStateFunc to check a TaskGroup count
type TestStep ¶
type TestStep struct {
// Runner is used to execute the step, can be nil for a check only step
Runner TestStepRunner
// Check is called after Runner if it does not fail
Check TestStateFunc
// ExpectErr allows Runner to fail, use CheckErr to confirm error is correct
ExpectErr bool
// CheckErr is called if Runner fails and ExpectErr is true
CheckErr func(error) bool
}
TestStep is a single step within a TestCase
type TestStepRunner ¶
type TestStepRunner interface {
// Run executes the levant feature under testing
Run(*TestState) error
}
TestStepRunner models a runner for a TestStep
Click to show internal directories.
Click to hide internal directories.