Documentation ¶
Index ¶
- type Probe
- type Scenario
- type SummaryState
- func (s *SummaryState) GetProbeLog(name string) *Probe
- func (s *SummaryState) LogPodName(n string)
- func (s *SummaryState) LogProbeMeta(name string, key string, value interface{})
- func (s *SummaryState) PrintSummary()
- func (s *SummaryState) ProbeComplete(name string)
- func (s *SummaryState) SetProbrStatus()
- func (s *SummaryState) WriteSummary()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Probe ¶
type Probe struct { Meta map[string]interface{} Path string ScenariosAttempted int ScenariosSucceeded int ScenariosFailed int Result string Scenarios map[int]*Scenario // contains filtered or unexported fields }
Probe is passed through various functions to audit the probe's progress
func (*Probe) InitializeAuditor ¶
InitializeAuditor creates a new audit entry for the specified scenario
type Scenario ¶ added in v0.0.21
type Scenario struct { Name string Result string // Passed / Failed / Given Not Met Tags []string Steps map[int]*step }
Scenario is used by scenario states to audit progress through each step
func (*Scenario) AuditScenarioStep ¶ added in v0.0.21
AuditScenarioStep sets description, payload, and pass/fail based on err parameter. This function should be deferred to catch panic behavior, otherwise the audit will not be logged on panic
type SummaryState ¶ added in v0.0.21
type SummaryState struct { Meta map[string]interface{} Status string ProbesPassed int ProbesFailed int ProbesSkipped int Probes map[string]*Probe WriteDirectory string }
SummaryState is a stateful object intended to hold all the high-level info about a probe execution
func NewSummaryState ¶ added in v0.0.21
func NewSummaryState(packName string) (state SummaryState)
NewSummaryState creates a new SummaryState with default values
func (*SummaryState) GetProbeLog ¶ added in v0.0.21
func (s *SummaryState) GetProbeLog(name string) *Probe
GetProbeLog initializes or returns existing log probe for the provided test name
func (*SummaryState) LogPodName ¶ added in v0.0.21
func (s *SummaryState) LogPodName(n string)
LogPodName adds pod names to a list for user's debugging purposes
func (*SummaryState) LogProbeMeta ¶ added in v0.0.21
func (s *SummaryState) LogProbeMeta(name string, key string, value interface{})
LogProbeMeta accepts a test name with a key and value to insert to the meta logs for that test. Overwrites key if already present.
func (*SummaryState) PrintSummary ¶ added in v0.0.21
func (s *SummaryState) PrintSummary()
PrintSummary will print the current object state, formatted to JSON
func (*SummaryState) ProbeComplete ¶ added in v0.0.21
func (s *SummaryState) ProbeComplete(name string)
ProbeComplete takes an probe name and status then updates the summary & probe meta information
func (*SummaryState) SetProbrStatus ¶ added in v0.0.21
func (s *SummaryState) SetProbrStatus()
SetProbrStatus evaluates the current SummaryState state to set the Status
func (*SummaryState) WriteSummary ¶ added in v0.0.21
func (s *SummaryState) WriteSummary()
WriteSummary will write the summary to the audit directory