Documentation ¶
Index ¶
- type AlertMessage
- 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) ImportTestSteps(newTSteps map[uint64]*TestStep)
- func (tc *TestCase) RemoveTestStep(ID uint64)
- 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.ProbeAnswer) (assertResults []assertion.AssertResult, success bool)
- func (tStep *TestStep) GetLastPositiveResult() (vrs *[]VigieResult)
- func (tStep *TestStep) GetReSyncro() (syncroDelay time.Duration)
- 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 TestStepComparaison
- type TestSuite
- func (ts *TestSuite) Failures() (count int)
- func (ts *TestSuite) GetTestcaseByID(TCid uint64) (tc *TestCase)
- func (ts *TestSuite) ImportAllTestCases(newTCs map[uint64]*TestCase)
- 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
- type VigieValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertMessage ¶
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 int
const ( Success StepStatus = 1 NotDefined StepStatus = 0 AssertFailure StepStatus = -1 Failure StepStatus = -2 Timeout StepStatus = -3 Error StepStatus = -4 )
func (StepStatus) Int ¶ added in v0.6.0
func (ss StepStatus) Int() int
func (StepStatus) IsSucess ¶
func (ss StepStatus) IsSucess() bool
func (StepStatus) IsTimeMesureable ¶ added in v0.5.0
func (ss StepStatus) IsTimeMesureable() bool
func (StepStatus) String ¶
func (ss StepStatus) String() string
type TCAlertShort ¶
type TCAlertShort struct { TCHeader TestSteps map[uint64]TStepAlertShort `json:"teststeps"` }
type TCDescribe ¶
type TCDescribe struct { ID uint64 `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[uint64]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 uint64 `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 { Name string ID uint64 `hash:"ignore"` Mutex sync.RWMutex `hash:"ignore"` Config configTestStruct `hash:"ignore"` Status StepStatus `hash:"ignore"` LastChange time.Time `hash:"ignore"` TestSteps map[uint64]*TestStep }
toTestCase is a single test case with its result.
func (*TestCase) FailureCount ¶
FailureCount returns the numbers of non success teststep
func (*TestCase) GetStatus ¶ added in v0.4.0
func (tc *TestCase) GetStatus() (ss StepStatus)
GetStatus returns this TestCase Status
func (*TestCase) ImportTestSteps ¶ added in v0.7.0
ImportTestSteps will add new TSteps to an empty or already populated TestCase, Import Rules : remove oldTSteps that are absent from the new TSteps, keep common TSteps, add new ones
func (*TestCase) RemoveTestStep ¶ added in v0.7.0
remobeTestStep simply removes a TestStep from this TestCase, concurency safe
func (*TestCase) SetStatus ¶ added in v0.4.0
func (tc *TestCase) SetStatus(newStatus StepStatus)
SetStatus set this TestCase Status
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
Returns this Testcase without Teststeps
type TestStep ¶
type TestStep struct { Mutex sync.RWMutex `hash:"ignore"` Name string ID uint64 `hash:"ignore"` Assertions []assertion.Assert ProbeWrap ProbeWrap Failures []string `hash:"ignore"` LastAttempt time.Time `hash:"ignore"` LastChange time.Time `hash:"ignore"` LastPositiveTimeResult time.Time `hash:"ignore"` VigieResults []VigieResult `hash:"ignore"` LastPositiveVigieResults *[]VigieResult `hash:"ignore"` Status StepStatus `hash:"ignore"` }
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.ProbeAnswer) (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) GetReSyncro ¶ added in v0.7.0
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 TestStepComparaison ¶ added in v0.7.0
TestStepComparaison is use to compare a teststep, it only contains fixed values.
type TestSuite ¶
type TestSuite struct { Mutex sync.RWMutex `hash:"ignore"` Name string ID uint64 `hash:"ignore"` Status StepStatus `hash:"ignore"` TestCases map[uint64]*TestCase LastChange time.Time `hash:"ignore"` SourceFile string `hash:"ignore"` // Public }
func (*TestSuite) GetTestcaseByID ¶
GetTestcaseByID get a TestCase by is ID in the current TestSuite.
func (*TestSuite) ImportAllTestCases ¶ added in v0.7.0
ImportAllTestCases will add new TCs, remove oldTC that are absent from the new TCs, keep common TCs
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[uint64]TSAlertShort }
type UIDTest ¶
type UIDTest struct { TestSuite TSHeader `json:"testsuite"` TestCase TCHeader `json:"testcase"` TestStep TStepDescribe `json:"teststep"` }
type VigieResult ¶
type VigieResult struct { ProbeAnswer map[string]interface{} `json:"probe_answer"` ProbeInfo probe.ProbeInfo `json:"probe_info"` AssertionResult []assertion.AssertResult `json:"assertion_result"` Status StepStatus `json:"status"` StatusDescription string `json:"status_description"` }
func (*VigieResult) GetValues ¶ added in v0.6.0
func (vr *VigieResult) GetValues() (vv VigieValue)