Documentation ¶
Overview ¶
nolint
nolint
nolint
Index ¶
- Constants
- Variables
- func GenerateShim(variantBin, dir string) error
- func Getenv(name string)
- func IsExpressionEmpty(ex hcl2.Expression) bool
- func Open(name string)
- func SetLogger(impl Interface)
- func Stat(name string)
- type App
- func (app *App) ExitWithError(err error)
- func (app *App) ExportBinary(srcDir, dstFile string) error
- func (app *App) ExportGo(srcDir, dstDir string) error
- func (app *App) ExportShim(srcDir, dstDir string) error
- func (app *App) Job(l *EventLogger, cmd string, args map[string]interface{}, ...) (func() (*Result, error), error)
- func (app *App) PrintError(err error)
- func (app *App) Run(cmd string, args map[string]interface{}, opts map[string]interface{}, ...) (*Result, error)
- func (app *App) RunTests(pat string) (*Result, error)
- func (app *App) WriteDiags(diagnostics hcl2.Diagnostics)
- type Assert
- type Case
- type Collect
- type Config
- type EnvSource
- type Event
- type EventLogger
- type Exec
- type ExecEvent
- type Forward
- type HCL2Config
- type Interface
- type JobSpec
- type Log
- type LogCollector
- type LogSpec
- type OptionSpec
- type Parameter
- type PendingOption
- type Result
- type RunEvent
- type RunJob
- type Source
- type SourceFile
- type SourceJob
- type Step
- type Test
- type TestDeps
- func (TestDeps) ImportPath() string
- func (TestDeps) MatchString(pat, str string) (result bool, err error)
- func (TestDeps) StartCPUProfile(w io.Writer) error
- func (TestDeps) StartTestLog(w io.Writer)
- func (TestDeps) StopCPUProfile()
- func (TestDeps) StopTestLog() error
- func (TestDeps) WriteProfileTo(name string, w io.Writer, debug int) error
- type Variable
Constants ¶
View Source
const NoRunMessage = "nothing to run"
Variables ¶
View Source
var ImportPath string
ImportPath is the import path of the testing binary, set by the generated main function.
Functions ¶
func GenerateShim ¶
func IsExpressionEmpty ¶
func IsExpressionEmpty(ex hcl2.Expression) bool
Types ¶
type App ¶
type App struct { BinName string Files map[string]*hcl2.File Config *HCL2Config JobByName map[string]JobSpec Stdout, Stderr io.Writer }
func NewFromFile ¶
func (*App) ExitWithError ¶
func (*App) ExportBinary ¶
func (*App) ExportShim ¶
func (*App) PrintError ¶
func (*App) WriteDiags ¶
func (app *App) WriteDiags(diagnostics hcl2.Diagnostics)
type Assert ¶
type Assert struct { Name string `hcl:"name,label"` Condition hcl2.Expression `hcl:"condition,attr"` }
type Case ¶
type Case struct { Name string `hcl:"name,label"` Args map[string]hcl2.Expression `hcl:",remain"` }
type Collect ¶
type Collect struct { Condition hcl2.Expression `hcl:"condition,attr"` Format hcl2.Expression `hcl:"format,attr"` }
type EventLogger ¶
type EventLogger struct { Command string Args, Opts map[string]interface{} Stream string Stderr io.Writer Events []Event // contains filtered or unexported fields }
func NewEventLogger ¶
func NewEventLogger(cmd string, args map[string]interface{}, opts map[string]interface{}) *EventLogger
func (*EventLogger) LogRun ¶
func (l *EventLogger) LogRun(job string, args map[string]interface{}) error
func (*EventLogger) Register ¶
func (l *EventLogger) Register(logCollector LogCollector) func() error
type Exec ¶
type Exec struct { Command hcl2.Expression `hcl:"command,attr"` Args hcl2.Expression `hcl:"args,attr"` Env hcl2.Expression `hcl:"env,attr"` }
type HCL2Config ¶
type Interface ¶
type Interface interface { Getenv(key string) Stat(file string) Open(file string) Chdir(dir string) }
Interface is the interface required of test loggers. The os package will invoke the interface's methods to indicate that it is inspecting the given environment variables or files. Multiple goroutines may call these methods simultaneously.
type JobSpec ¶
type JobSpec struct { //Type string `hcl:"type,label"` Name string `hcl:"name,label"` Version *string `hcl:"version,attr"` Module hcl2.Expression `hcl:"module,attr"` Description *string `hcl:"description,attr"` Parameters []Parameter `hcl:"parameter,block"` Options []OptionSpec `hcl:"option,block"` Configs []Config `hcl:"config,block"` Secrets []Config `hcl:"secret,block"` Variables []Variable `hcl:"variable,block"` Concurrency hcl2.Expression `hcl:"concurrency,attr"` SourceLocator hcl2.Expression `hcl:"__source_locator,attr"` Exec *Exec `hcl:"exec,block"` Assert []Assert `hcl:"assert,block"` Fail hcl2.Expression `hcl:"fail,attr"` Run *RunJob `hcl:"run,block"` Import *string `hcl:"import,attr"` Log *LogSpec `hcl:"log,block"` Steps []Step `hcl:"step,block"` }
type LogCollector ¶
type LogSpec ¶
type LogSpec struct { File hcl2.Expression `hcl:"file,attr"` Stream hcl2.Expression `hcl:"stream,attr"` Collects []Collect `hcl:"collect,block"` Forwards []Forward `hcl:"forward,block"` }
type OptionSpec ¶
type OptionSpec struct { Name string `hcl:"name,label"` Type hcl2.Expression `hcl:"type,attr"` Default hcl2.Expression `hcl:"default,attr"` Description *string `hcl:"description,attr"` Short *string `hcl:"short,attr"` }
type Parameter ¶
type Parameter struct { Name string `hcl:"name,label"` Type hcl2.Expression `hcl:"type,attr"` Default hcl2.Expression `hcl:"default,attr"` Envs []EnvSource `hcl:"env,block"` Description *string `hcl:"description,attr"` }
type PendingOption ¶
type PendingOption struct { Spec OptionSpec Type cty.Type }
type RunJob ¶
type RunJob struct { Name string `hcl:"name,label"` Args map[string]hcl2.Expression `hcl:",remain"` }
type SourceFile ¶
type SourceJob ¶
type SourceJob struct { Name string `hcl:"name,attr"` // This results in "no cty.Type for hcl.Expression" error //Arguments map[string]hcl2.Expression `hcl:"args,attr"` Args hcl2.Expression `hcl:"args,attr"` Format *string `hcl:"format,attr"` }
type TestDeps ¶
type TestDeps struct{}
TestDeps is an implementation of the testing.testDeps interface, suitable for passing to testing.MainStart.
func (TestDeps) ImportPath ¶
func (TestDeps) StartTestLog ¶
func (TestDeps) StopCPUProfile ¶
func (TestDeps) StopCPUProfile()
func (TestDeps) StopTestLog ¶
type Variable ¶
type Variable struct { Name string `hcl:"name,label"` Type hcl2.Expression `hcl:"type,attr"` Value hcl2.Expression `hcl:"value,attr"` }
Click to show internal directories.
Click to hide internal directories.