Documentation
¶
Index ¶
- type AlertMessage
- type AlertMessage2
- type JSONStep
- type JSONTestCase
- type JSONTestSuite
- type ProbeConfigJsonRaw
- type ProbeWrap
- type ProbeWrapAPI
- type Processing
- type Step
- type StepAssertionDescribe
- type StepAssertions
- type StepParam
- type StepResultDescribe
- type StepStatus
- type TCAlertShort
- type TCDescribe
- type TCHeader
- type TSAlertShort
- type TSDescribe
- type TSHeader
- type TStepAlertShort
- type TStepDescribe
- type Task
- type TestCase
- func (tc *TestCase) FailureCount() (failCount int)
- func (tc *TestCase) GetStatus() (ss StepStatus)
- func (tc *TestCase) SetStatus(newStatus StepStatus)
- func (tc *TestCase) ToAlertShortTC() TCAlertShort
- func (tc *TestCase) ToHeader() TCHeader
- func (tc *TestCase) ToJSON() TCDescribe
- func (tc *TestCase) UpdateStatus() bool
- func (tc *TestCase) WithoutTStep() *TestCase
- type TestStep
- func (tStep *TestStep) AssertProbeResult(probeResult *probe.ProbeResult) (assertResults []assertion.AssertResult, success bool)
- func (tStep *TestStep) GetLastPositiveResult() (vrs *[]VigieResult)
- func (tStep *TestStep) GetStatus() (ss StepStatus)
- func (tStep *TestStep) ResponseTimeInflux() float64
- func (tStep *TestStep) ToStepAlertShort() TStepAlertShort
- func (tStep *TestStep) ToTestStepDescribe() TStepDescribe
- func (tStep *TestStep) WriteResult(pData *Processing) (stateChanged, alertEvent bool)
- type TestSuite
- func (ts *TestSuite) Failures() (count int)
- func (ts *TestSuite) SetStatus(status StepStatus)
- func (ts *TestSuite) ToAlertShortTS() TSAlertShort
- func (ts *TestSuite) ToAlertShortTSRec() TSAlertShort
- func (ts *TestSuite) ToHeader() TSHeader
- func (ts *TestSuite) ToJSON() TSDescribe
- func (ts *TestSuite) UnmarshalJSON(data []byte) error
- func (ts *TestSuite) UpdateStatus()
- func (ts *TestSuite) WithoutTC() TestSuite
- type TotalAlertMessage
- type UIDTest
- type VigieResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertMessage ¶
type AlertMessage2 ¶
type AlertMessage2 struct { TSname TSHeader `json:"ts"` TC []TCHeader `json:"tc"` TStepRecap []TStepAlertShort `json:"TStepAlertShort"` }
type JSONTestCase ¶
type JSONTestSuite ¶
type JSONTestSuite struct { Config configTestStructJson `json:"config"` Name string `json:"name"` JsonTestCases []JSONTestCase `json:"testcases"` Vars map[string][]string `json:"vars"` }
type ProbeConfigJsonRaw ¶
type ProbeWrap ¶
type ProbeWrap struct { Probe probe.Probe `json:"probe"` Frequency time.Duration `json:"frequency"` // time interval between two tests Retry int `json:"retry"` // nb retry a test case if it is in failure. Retrydelay time.Duration `json:"retrydelay"` // delay between two retries Timeout time.Duration `json:"timeout"` // timeout on executor }
func (ProbeWrap) Export ¶
func (pw ProbeWrap) Export() ProbeWrapAPI
func (ProbeWrap) Run ¶
func (pw ProbeWrap) Run() []probe.ProbeReturn
type ProbeWrapAPI ¶
type ProbeWrapAPI struct { Probe probe.Probe `json:"probe"` Frequency string `json:"frequency"` // time interval between two tests Retry int `json:"retry"` // nb retry a test case if it is in failure. Retrydelay string `json:"retrydelay"` // delay between two retries Timeout string `json:"timeout"` // timeout on executor }
type Processing ¶
type Processing struct { LastAttempt time.Time Status StepStatus VigieResults []VigieResult Issue string }
type StepAssertionDescribe ¶
type StepAssertionDescribe struct {
Assertions []string
}
type StepAssertions ¶
type StepAssertions struct {
Assertions []string `json:"assertions,omitempty"`
}
StepAssertions contains step assertions
type StepResultDescribe ¶
type StepResultDescribe struct { StatusStr string `json:"status"` LastAttempt time.Time `json:"lastattempt"` // UnixTimeNano si Freq <1sec LastPositiveTimeResult time.Time `json:"lastpositivetimeresult"` // UnixTimeNano si Freq <1sec LastPositiveVigieResults *[]VigieResult `json:"lastpositivevigieresults"` VigieResults []VigieResult `json:"vigieresults"` Details []string `json:"details"` LastChange time.Time `json:"lastchange"` }
type StepStatus ¶
type StepStatus uint8
const ( NotDefined StepStatus = iota Success Failure AssertFailure Timeout Error )
func (StepStatus) IsSucess ¶
func (ss StepStatus) IsSucess() bool
func (StepStatus) String ¶
func (ss StepStatus) String() string
type TCAlertShort ¶
type TCAlertShort struct { TCHeader TestSteps map[int64]TStepAlertShort `json:"teststeps"` }
type TCDescribe ¶
type TCDescribe struct { ID int `json:"id"` // Errors int `json:"errors"` Status string `json:"status"` // Failures int `json:"failures"` Name *string `json:"name"` TestSteps []TStepDescribe `json:"teststeps"` }
type TSAlertShort ¶
type TSAlertShort struct { TSHeader TestCases map[int64]TCAlertShort `json:"testcases"` }
type TSDescribe ¶
type TSDescribe struct { // Errors int `json:"errors"` Status string `json:"status"` // Failures int `json:"failures"` Name string `json:"name"` ID int64 `json:"id"` // TestCaseCount int `json:"testcasescount"` // TestStepsCount int `json:"teststepscount"` TestCases []TCDescribe `json:"testcases"` }
type TStepAlertShort ¶
type TStepDescribe ¶
type Task ¶
func (*Task) RUnlockAll ¶
func (t *Task) RUnlockAll()
func (*Task) WriteMetadataChanges ¶
type TestCase ¶
type TestCase struct { Mutex sync.RWMutex Config configTestStruct ID int64 Name string Status StepStatus CountChange uint LastChange time.Time TestSteps map[int64]*TestStep }
toTestCase is a single test case with its result.
func (*TestCase) FailureCount ¶
func (*TestCase) GetStatus ¶ added in v0.4.0
func (tc *TestCase) GetStatus() (ss StepStatus)
func (*TestCase) SetStatus ¶ added in v0.4.0
func (tc *TestCase) SetStatus(newStatus StepStatus)
func (*TestCase) ToAlertShortTC ¶
func (tc *TestCase) ToAlertShortTC() TCAlertShort
func (*TestCase) ToJSON ¶
func (tc *TestCase) ToJSON() TCDescribe
func (*TestCase) UpdateStatus ¶
UpdateStatus change and return the TC ResultStatus Loop on each TSteps If one of the TSteps is KO => Set TC status to False
func (*TestCase) WithoutTStep ¶ added in v0.4.0
type TestStep ¶
type TestStep struct { Mutex sync.RWMutex Name string ID int64 Assertions []assertion.Assert ProbeWrap ProbeWrap Failures []string LastAttempt time.Time LastPositiveTimeResult time.Time VigieResults []VigieResult LastPositiveVigieResults *[]VigieResult LastChange time.Time ChangeCount uint Status StepStatus }
TestStep est constitué d'une Step ainsi que d'autres objets permettant l'exec et la traçabilité
func (*TestStep) AssertProbeResult ¶
func (tStep *TestStep) AssertProbeResult(probeResult *probe.ProbeResult) (assertResults []assertion.AssertResult, success bool)
applyChecks apply checks on result, return true if all assertions are Success, false otherwise
func (*TestStep) GetLastPositiveResult ¶
func (tStep *TestStep) GetLastPositiveResult() (vrs *[]VigieResult)
func (*TestStep) GetStatus ¶
func (tStep *TestStep) GetStatus() (ss StepStatus)
func (*TestStep) ResponseTimeInflux ¶
responsetime return the duration time between the last call and the received response time is in second
func (*TestStep) ToStepAlertShort ¶
func (tStep *TestStep) ToStepAlertShort() TStepAlertShort
func (*TestStep) ToTestStepDescribe ¶
func (tStep *TestStep) ToTestStepDescribe() TStepDescribe
ToTestStepDescribe return a JSON API response
func (*TestStep) WriteResult ¶
func (tStep *TestStep) WriteResult(pData *Processing) (stateChanged, alertEvent bool)
WriteResult Write all temp processing data during RunTestStep in a teststep
type TestSuite ¶
type TestSuite struct { Mutex sync.RWMutex Name string ID int64 Status StepStatus TestCases map[int64]*TestCase LastChange time.Time CountChange uint SourceFile string // Public }
func (*TestSuite) SetStatus ¶
func (ts *TestSuite) SetStatus(status StepStatus)
func (*TestSuite) ToAlertShortTS ¶
func (ts *TestSuite) ToAlertShortTS() TSAlertShort
func (*TestSuite) ToAlertShortTSRec ¶
func (ts *TestSuite) ToAlertShortTSRec() TSAlertShort
func (*TestSuite) ToJSON ¶
func (ts *TestSuite) ToJSON() TSDescribe
func (*TestSuite) UnmarshalJSON ¶
func (*TestSuite) UpdateStatus ¶
func (ts *TestSuite) UpdateStatus()
type TotalAlertMessage ¶
type TotalAlertMessage struct { Date time.Time TestSuites map[int64]TSAlertShort }
type UIDTest ¶
type UIDTest struct { TestSuite TSHeader `json:"testsuite"` TestCase TCHeader `json:"testcase"` TestStep TStepDescribe `json:"teststep"` }
type VigieResult ¶
type VigieResult struct { ProbeResult map[string]interface{} `json:"probe_result"` AssertionResult []assertion.AssertResult `json:"assertion_result"` Status StepStatus `json:"status"` StatusDescription string `json:"status_description"` }