engine

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &Config{
	Env:         nil,
	Interpreter: "/bin/bash",
	Timeout:     3 * time.Second,
}

Functions

This section is empty.

Types

type Collection

type Collection []*Test

func (Collection) Blacklist

func (c Collection) Blacklist(blacklist []string) Collection

func (Collection) Whitelist

func (c Collection) Whitelist(whitelist []string) Collection

type Command

type Command string

type CommandResult

type CommandResult struct {
	Command Command `yaml:"command"`
	Checks  []checks.Result
}

type Config

type Config struct {
	WorkDir     string
	Env         []string
	Interpreter string
	Timeout     time.Duration
}

func (*Config) Clone

func (c *Config) Clone() *Config

type DefaultRunner

type DefaultRunner struct{ Hooks RunHooks }

func (DefaultRunner) Command

func (r DefaultRunner) Command(t *Test, c Command) (result CommandResult, err error)

func (DefaultRunner) Test

func (r DefaultRunner) Test(t *Test) (result TestResult, err error)

type RunHooks

type RunHooks interface {
	BeforeTest(t *Test)
	BeforeCommand(t *Test, cmd Command)
	BeforeCheck(t *Test, cmd Command, chk checks.Interface)
	AfterCheck(t *Test, cmd Command, chk checks.Interface, result checks.Result, err error)
	AfterCommand(t *Test, cmd Command, result CommandResult, err error)
	AfterTest(t *Test, result TestResult, err error)
}

type Runner

type Runner interface {
	Test(t *Test) (TestResult, error)
	Command(t *Test, cmd Command) (CommandResult, error)
}

type Test

type Test struct {
	Name      string
	RunConfig *Config

	Commands []Command
	Checks   []checks.Interface
}

type TestResult

type TestResult struct {
	Test     *Test `yaml:"test"`
	Commands []CommandResult
}

Jump to

Keyboard shortcuts

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