Documentation ¶
Index ¶
- func Register(suites []TestSuite, schedules []ScheduledRun)
- type AsyncHookCallback
- type AsyncTestFinishedListener
- type AsyncTestSuiteFinishedListener
- type Hook
- type Option
- type ScheduledRun
- type Server
- type T
- func (t *T) Attempt() int
- func (t *T) Cleanup(c func())
- func (t *T) Context() context.Context
- func (t *T) Error(args ...any)
- func (t *T) Errorf(format string, args ...any)
- func (t *T) Fail()
- func (t *T) FailNow()
- func (t *T) Failed() bool
- func (t *T) Fatal(args ...any)
- func (t *T) Fatalf(format string, args ...any)
- func (t *T) Helper()
- func (t *T) Log(args ...any)
- func (t *T) Logf(format string, args ...any)
- func (t *T) Name() string
- func (t *T) Result() model.Result
- func (t *T) SetTimeout(timeout time.Duration)
- func (t *T) SetValue(key string, value any)
- func (t *T) Setenv(key, value string)
- func (t *T) Skip(args ...any)
- func (t *T) SkipNow()
- func (t *T) Skipf(format string, args ...any)
- func (t *T) Skipped() bool
- func (t *T) SoftFailure()
- func (t *T) TempDir() string
- func (t *T) Value(key string) any
- type TB
- type TestContext
- type TestFinishedListener
- type TestFunc
- type TestSuite
- type TestSuiteFinishedListener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(suites []TestSuite, schedules []ScheduledRun)
Register registers test suites and schedules to be loaded when `*server.New()` is called.
Types ¶
type AsyncHookCallback ¶
AsyncHookCallback allows async hooks to add additional context to a testsuite or testrun.
type AsyncTestFinishedListener ¶
type AsyncTestFinishedListener interface { Hook TestFinishedAsync(suite model.TestSuite, run model.TestSuiteRun, testName string, context map[string]any, callback AsyncHookCallback) }
type AsyncTestSuiteFinishedListener ¶
type AsyncTestSuiteFinishedListener interface { Hook TestSuiteFinishedAsync(suite model.TestSuite, run model.TestSuiteRun, callback AsyncHookCallback) }
type Option ¶
type Option func(s *Server)
func WithScheduledRun ¶
func WithScheduledRun(sr ScheduledRun) Option
WithScheduledRun schedules a TestSuite to run at certain intervals.
func WithTestSuite ¶
type ScheduledRun ¶
type ScheduledRun struct { // TestSuiteName is the name of the test suite to be run. TestSuiteName string // Schedule defines how often a run is scheduled. For the format see // https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format Schedule string // TestFilter allows enabling/filtering only certain tests of a testsuite to be run TestFilter *regexp.Regexp // EntryID identifies the cronjob EntryID cron.EntryID }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ServerPort ¶
ServerPort returns the port that the server is using. This is useful when the port is randomly allocated on startup.
func (*Server) WaitForStartup ¶
func (s *Server) WaitForStartup()
WaitForStartup blocks until the server has started up.
type T ¶
type T struct {
// contains filtered or unexported fields
}
func (*T) SetTimeout ¶
func (*T) SoftFailure ¶
func (t *T) SoftFailure()
type TestContext ¶
type TestContext = model.TestContext
type TestFinishedListener ¶
type TestFinishedListener interface { Hook TestFinished(suite model.TestSuite, run model.TestSuiteRun, testName string, context model.TestContext) }
type TestSuite ¶
type TestSuite struct { // Name of the testsuite Name string `json:"name"` // Namespace allows grouping of test suites, e.g. by team name. Namespace string MaxTestAttempts int Setup func() error Teardown func() error Timeout time.Duration Tests []TestFunc }
TestSuite represents the external view of the Testsuite to allow users of the library to omit passing in redundant information like the name of the test which can be retrieved via reflection.. It is only used by the caller of the library and then mapped internally to enrich the struct with e.g. test function names.
type TestSuiteFinishedListener ¶
type TestSuiteFinishedListener interface { Hook TestSuiteFinished(suite model.TestSuite, run model.TestSuiteRun) }
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
transformcli
handoff transform is a planned tool that automatically transforms handoff tests via go:generate into tests that can be run by the go standard toolchain but includes support for plugins and test suite setup/teardown.
|
handoff transform is a planned tool that automatically transforms handoff tests via go:generate into tests that can be run by the go standard toolchain but includes support for plugins and test suite setup/teardown. |
internal
|
|
model
The `model`s package is very atypical for projects written in go, but unfortunately cannot be avoided as it helps to avoid cyclic dependencies.
|
The `model`s package is very atypical for projects written in go, but unfortunately cannot be avoided as it helps to avoid cyclic dependencies. |