Documentation
¶
Index ¶
- Constants
- type StormTestManager
- type TestCase
- func (t *TestCase) ArtifactBroker() stormartifacts.ArtifactBroker
- func (t *TestCase) BackgroundWaitGroup() *sync.WaitGroup
- func (t *TestCase) CollectedOutput() []string
- func (t *TestCase) Context() context.Context
- func (t *TestCase) Error(err error)
- func (t *TestCase) Execute() error
- func (t *TestCase) Fail(reason string)
- func (t *TestCase) FailFromError(err error)
- func (t *TestCase) GetError() error
- func (t *TestCase) IsBailCondition() bool
- func (t *TestCase) MarkError(err error)
- func (t *TestCase) MarkNotRun(reason string)
- func (t *TestCase) Name() string
- func (t *TestCase) Pass()
- func (t *TestCase) Reason() string
- func (t *TestCase) Registrant() core.TestRegistrantMetadata
- func (t *TestCase) RunTime() time.Duration
- func (t *TestCase) SetCollectedOutput(val []string)
- func (t *TestCase) Skip(reason string)
- func (t *TestCase) Status() TestCaseStatus
- func (t *TestCase) SuiteCleanup(f func())
- func (t *TestCase) SuiteCleanupList() []func()
- type TestCaseStatus
- func (tcs TestCaseStatus) ColorString() string
- func (tcs TestCaseStatus) Errored() bool
- func (tcs TestCaseStatus) Failed() bool
- func (tcs TestCaseStatus) IsBad() bool
- func (tcs TestCaseStatus) IsFinal() bool
- func (tcs TestCaseStatus) IsPending() bool
- func (tcs TestCaseStatus) IsRunning() bool
- func (tcs TestCaseStatus) NotRun() bool
- func (tcs TestCaseStatus) Passed() bool
- func (tcs TestCaseStatus) Ran() bool
- func (tcs TestCaseStatus) Skipped() bool
- func (tcs TestCaseStatus) String() string
Constants ¶
const ( // TODO(#10): Make this configurable DEFAULT_TEST_CLEANUP_TIMEOUT = 20 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StormTestManager ¶
type StormTestManager struct {
// contains filtered or unexported fields
}
func NewStormTestManager ¶
func NewStormTestManager( suite core.SuiteContext, registrant interface { core.TestRegistrant core.TestRegistrantMetadata }, logDir *string, ) (*StormTestManager, error)
func (*StormTestManager) Duration ¶ added in v0.2.0
func (tm *StormTestManager) Duration() time.Duration
func (*StormTestManager) Registrant ¶
func (tm *StormTestManager) Registrant() core.TestRegistrantMetadata
func (*StormTestManager) StopTimer ¶ added in v0.2.0
func (tm *StormTestManager) StopTimer()
func (*StormTestManager) Suite ¶
func (tm *StormTestManager) Suite() core.SuiteContext
func (*StormTestManager) TestCases ¶
func (tm *StormTestManager) TestCases() []*TestCase
type TestCase ¶
type TestCase struct {
// contains filtered or unexported fields
}
TestCase represents a single test case within a test suite. It implements the core.TestCase interface. This is the concrete implementation of a test case that is managed by the StormTestManager.
func (*TestCase) ArtifactBroker ¶ added in v0.2.0
func (t *TestCase) ArtifactBroker() stormartifacts.ArtifactBroker
ArtifactBroker implements core.TestCase.
func (*TestCase) BackgroundWaitGroup ¶
BackgroundWaitGroup implements core.TestCase.
func (*TestCase) CollectedOutput ¶
Returns the collected output of the test case.
func (*TestCase) Execute ¶
Executes the test case function. The returned error is guaranteed to be the return of the test case function.
func (*TestCase) FailFromError ¶
FailFromError implements core.TestCase.
func (*TestCase) GetError ¶
Returns the error that caused the test case to fail. This is nil if the test case did not fail because of an error.
func (*TestCase) IsBailCondition ¶
Returns whether this test caused a bail condition, which means that the test suite should stop. This is true if the test failed or errored out in a way that does not allow for recovery.
func (*TestCase) MarkError ¶
Mark a test as errored. This is used when the test case panics or returns an error.
func (*TestCase) MarkNotRun ¶
Mark a pending test as skipped because of a dependency failure.
func (*TestCase) Registrant ¶
func (t *TestCase) Registrant() core.TestRegistrantMetadata
Registrant implements core.TestCase.
func (*TestCase) RunTime ¶
RunTime implements core.TestCase. Returns the duration of the test case. If the test case is still running, it returns the duration since the start time.
func (*TestCase) SetCollectedOutput ¶
func (*TestCase) Status ¶
func (t *TestCase) Status() TestCaseStatus
Retrieves the status of the test case.
func (*TestCase) SuiteCleanup ¶
func (t *TestCase) SuiteCleanup(f func())
SuiteCleanup implements core.TestCase.
func (*TestCase) SuiteCleanupList ¶
func (t *TestCase) SuiteCleanupList() []func()
Return the suite-level cleanup functions registered in this test case.
type TestCaseStatus ¶
type TestCaseStatus int
const ( TestCaseStatusPending TestCaseStatus = iota TestCaseStatusRunning TestCaseStatusPassed TestCaseStatusFailed TestCaseStatusSkipped TestCaseStatusNotRun TestCaseStatusError )
func (TestCaseStatus) ColorString ¶
func (tcs TestCaseStatus) ColorString() string
func (TestCaseStatus) Errored ¶
func (tcs TestCaseStatus) Errored() bool
func (TestCaseStatus) Failed ¶
func (tcs TestCaseStatus) Failed() bool
func (TestCaseStatus) IsBad ¶
func (tcs TestCaseStatus) IsBad() bool
IsBad returns true if the test case status is either Failed or Error.
func (TestCaseStatus) IsFinal ¶
func (tcs TestCaseStatus) IsFinal() bool
IsFinal returns true for all test case statuses that are considered final states. This includes Passed, Failed, Skipped, and Error statuses. It does not include Pending or Running statuses.
func (TestCaseStatus) IsPending ¶
func (tcs TestCaseStatus) IsPending() bool
func (TestCaseStatus) IsRunning ¶
func (tcs TestCaseStatus) IsRunning() bool
func (TestCaseStatus) NotRun ¶
func (tcs TestCaseStatus) NotRun() bool
func (TestCaseStatus) Passed ¶
func (tcs TestCaseStatus) Passed() bool
func (TestCaseStatus) Ran ¶ added in v0.2.0
func (tcs TestCaseStatus) Ran() bool
Ran returns whether the test case was actually executed. This is true for Passed, Failed, and Error statuses. It is false for Pending, Running, Skipped, and NotRun statuses.
func (TestCaseStatus) Skipped ¶
func (tcs TestCaseStatus) Skipped() bool
func (TestCaseStatus) String ¶
func (tcs TestCaseStatus) String() string