Documentation
¶
Index ¶
- Constants
- func IsAcc() bool
- type FixtureFunc
- type Retries
- type Scenario
- type ScenarioExecution
- type ScenarioReport
- type Specification
- type SpecificationExecution
- type SpecificationReport
- type Step
- func (step *Step) AppendError(err error)
- func (step *Step) AppendRetriesRows(row []interface{})
- func (step *Step) LoadFixture(name string) (interface{}, error)
- func (step *Step) Must(v interface{}, err error) interface{}
- func (step *Step) Report() StepReport
- func (step *Step) SetRetriesHeaders(headers []string)
- type StepExecution
- type StepReport
- type TestValidator
Constants ¶
View Source
const ACC_ENV_KEY = "USDKACC"
View Source
const ACC_SKIP_REASON = "skip test for non-acc environment"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FixtureFunc ¶
func SetupClientFixture ¶
func SetupClientFixture(factory func() (ucloud.ServiceClient, error)) FixtureFunc
SetupClientFixture is a help function for setup client fixture
type Retries ¶
type Retries struct {
Headers []string `json:"headers"`
Rows [][]interface{} `json:"rows"`
}
type Scenario ¶
type Scenario struct {
PreCheck func()
Id string
Title string
Steps []*Step
Owners []string
Vars func(*Scenario) map[string]interface{}
Spec *Specification
// contains filtered or unexported fields
}
func (*Scenario) Report ¶
func (scenario *Scenario) Report() ScenarioReport
type ScenarioExecution ¶
type ScenarioReport ¶
type ScenarioReport struct {
Title string `json:"title"`
Id string `json:"id"`
Steps []StepReport `json:"steps"`
Status string `json:"status"`
Execution ScenarioExecution `json:"execution"`
Owners []string `json:"owners"`
PassedCount int `json:"passed_count"`
FailedCount int `json:"failed_count"`
SkippedCount int `json:"skipped_count"`
Errors executionErrors `json:"errors,omitempty"`
}
type Specification ¶
type Specification struct {
Scenarios []*Scenario
// contains filtered or unexported fields
}
func (*Specification) AddFixture ¶
func (spec *Specification) AddFixture(name string, fixture FixtureFunc)
AddFixture is a help function for dependency injection
func (*Specification) AddScenario ¶
func (spec *Specification) AddScenario(scenario *Scenario)
func (*Specification) ParallelTest ¶
func (spec *Specification) ParallelTest(t *testing.T, sce *Scenario)
ParallelTest is a help function for parallel testing
func (*Specification) Report ¶
func (spec *Specification) Report() SpecificationReport
type SpecificationExecution ¶
type SpecificationReport ¶
type SpecificationReport struct {
Status string `json:"status"`
Execution SpecificationExecution `json:"execution"`
Scenarios []ScenarioReport `json:"scenarios"`
PassedCount int `json:"passed_count"`
FailedCount int `json:"failed_count"`
SkippedCount int `json:"skipped_count"`
}
type Step ¶
type Step struct {
T *testing.T
MaxRetries int
RetryInterval time.Duration
StartupDelay time.Duration
FastFail bool
Title string
Scenario *Scenario
Invoker func(*Step) (interface{}, error)
Validators func(*Step) []TestValidator
// contains filtered or unexported fields
}
func (*Step) AppendError ¶
func (*Step) AppendRetriesRows ¶
func (step *Step) AppendRetriesRows(row []interface{})
func (*Step) LoadFixture ¶
LoadFixture is a function for load fixture by the name from map fixture function
func (*Step) Report ¶
func (step *Step) Report() StepReport
func (*Step) SetRetriesHeaders ¶
type StepExecution ¶
type StepReport ¶
type StepReport struct {
Title string `json:"title"`
Status string `json:"status"`
Execution StepExecution `json:"execution"`
Retries Retries `json:"retries"`
Errors executionErrors `json:"errors,omitempty"`
}
type TestValidator ¶
type TestValidator func(interface{}) error
Click to show internal directories.
Click to hide internal directories.