audit

package
v0.0.33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2021 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

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

func (e *Probe) InitializeAuditor(name string, tags []*messages.Pickle_PickleTag) *Scenario

InitializeAuditor creates a new audit entry for the specified scenario

func (*Probe) Write added in v0.0.21

func (e *Probe) Write()

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

func (p *Scenario) AuditScenarioStep(stepName, description string, payload interface{}, err error)

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, defaultLogger ...bool) (state SummaryState)

NewSummaryState creates a new SummaryState with default values. Optional second parameter allows default logger to be disabled

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL