Documentation
¶
Index ¶
- Constants
- Variables
- func NewTracetestRootSpan(run Run) traces.Span
- type Assertion
- type AssertionExpression
- type AssertionResult
- type Cache
- type CacheConfig
- type CacheOption
- type LastRun
- type LiteralValue
- type Output
- type Outputs
- type Repository
- type Run
- func (r Run) AssertionFailed(err error) Run
- func (r Run) ConfigureRequiredGates(gates []testrunner.RequiredGate) Run
- func (r Run) Copy() Run
- func (r Run) ExecutionTime() int
- func (r Run) Finish() Run
- func (r Run) GenerateRequiredGateResult(gates []testrunner.RequiredGate) testrunner.RequiredGatesResult
- func (r Run) LinterError(err error) Run
- func (r Run) RequiredGateFailed(gate testrunner.RequiredGate) Run
- func (r Run) ResourceID() string
- func (r Run) ResultsCount() (pass, fail int)
- func (r Run) Start() Run
- func (r Run) Stopped() Run
- func (r Run) SuccessfulLinterExecution(linter analyzer.LinterResult) Run
- func (r Run) SuccessfullyAsserted(outputs maps.Ordered[string, RunOutput], variableSet variableset.VariableSet, ...) Run
- func (r Run) SuccessfullyPolledTraces(t *traces.Trace) Run
- func (r Run) SuccessfullyTriggered() Run
- func (r Run) TraceFailed(err error) Run
- func (r Run) TransactionStepResourceID() string
- func (r Run) TriggerCompleted(tr trigger.TriggerResult) Run
- func (r Run) TriggerFailed(err error) Run
- func (r Run) TriggerTime() int
- type RunMetadata
- type RunOutput
- type RunRepository
- type RunResults
- type RunState
- type SelectorFilter
- type SelectorPseudoClass
- type SpanAssertionResult
- type SpanQuery
- type SpanSelector
- type Specs
- type Summary
- type Test
- type TestSpec
Constants ¶
View Source
const ( ResourceName string = "Test" ResourceNamePlural string = "Tests" )
Variables ¶
View Source
var (
IDGen = id.NewRandGenerator()
)
Functions ¶
func NewTracetestRootSpan ¶
Types ¶
type AssertionExpression ¶
type AssertionExpression struct {
LiteralValue LiteralValue
Operation string
Expression *AssertionExpression
}
func (*AssertionExpression) String ¶
func (e *AssertionExpression) String() string
func (*AssertionExpression) Type ¶
func (e *AssertionExpression) Type() string
type AssertionResult ¶
type AssertionResult struct {
Assertion Assertion
AllPassed bool
Results []SpanAssertionResult
}
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func NewCache ¶
func NewCache(instanceID string, opts ...CacheOption) *Cache
type CacheConfig ¶
type CacheConfig struct {
// contains filtered or unexported fields
}
type CacheOption ¶
type CacheOption func(*CacheConfig)
func WithMetricMeter ¶
func WithMetricMeter(meter metric.Meter) CacheOption
type LiteralValue ¶
type Repository ¶
type Repository interface {
List(_ context.Context, take, skip int, query, sortBy, sortDirection string) ([]Test, error)
ListAugmented(_ context.Context, take, skip int, query, sortBy, sortDirection string) ([]Test, error)
Count(context.Context, string) (int, error)
SortingFields() []string
Provision(context.Context, Test) error
SetID(test Test, id id.ID) Test
Get(context.Context, id.ID) (Test, error)
GetAugmented(ctx context.Context, id id.ID) (Test, error)
Exists(context.Context, id.ID) (bool, error)
GetVersion(_ context.Context, _ id.ID, version int) (Test, error)
Create(context.Context, Test) (Test, error)
Update(context.Context, Test) (Test, error)
Delete(context.Context, id.ID) error
GetTestSuiteSteps(_ context.Context, _ id.ID, version int) ([]Test, error)
DB() *sql.DB
}
func NewRepository ¶
func NewRepository(db *sql.DB) Repository
type Run ¶
type Run struct {
ID int
TestID id.ID
TestVersion int
// Timestamps
CreatedAt time.Time
ServiceTriggeredAt time.Time
ServiceTriggerCompletedAt time.Time
ObtainedTraceAt time.Time
CompletedAt time.Time
// trigger params
State RunState
TraceID trace.TraceID
SpanID trace.SpanID
// result info
ResolvedTrigger trigger.Trigger
TriggerResult trigger.TriggerResult
Results *RunResults
Trace *traces.Trace
Outputs maps.Ordered[string, RunOutput]
LastError error
Pass int
Fail int
Metadata RunMetadata
// variable set
VariableSet variableset.VariableSet
TestSuiteID string
TestSuiteRunID string
Linter analyzer.LinterResult
RequiredGatesResult testrunner.RequiredGatesResult
}
func (Run) AssertionFailed ¶
func (Run) ConfigureRequiredGates ¶
func (r Run) ConfigureRequiredGates(gates []testrunner.RequiredGate) Run
func (Run) ExecutionTime ¶
func (Run) GenerateRequiredGateResult ¶
func (r Run) GenerateRequiredGateResult(gates []testrunner.RequiredGate) testrunner.RequiredGatesResult
func (Run) LinterError ¶
func (Run) RequiredGateFailed ¶
func (r Run) RequiredGateFailed(gate testrunner.RequiredGate) Run
func (Run) ResourceID ¶
func (Run) ResultsCount ¶
func (Run) SuccessfulLinterExecution ¶
func (r Run) SuccessfulLinterExecution(linter analyzer.LinterResult) Run
func (Run) SuccessfullyAsserted ¶
func (r Run) SuccessfullyAsserted( outputs maps.Ordered[string, RunOutput], variableSet variableset.VariableSet, res maps.Ordered[SpanQuery, []AssertionResult], allPassed bool, ) Run
func (Run) SuccessfullyTriggered ¶
func (Run) TraceFailed ¶
func (Run) TransactionStepResourceID ¶
func (Run) TriggerCompleted ¶
func (r Run) TriggerCompleted(tr trigger.TriggerResult) Run
func (Run) TriggerFailed ¶
func (Run) TriggerTime ¶
type RunMetadata ¶
type RunOutput ¶
func (*RunOutput) UnmarshalJSON ¶
type RunRepository ¶
type RunRepository interface {
CreateRun(context.Context, Test, Run) (Run, error)
UpdateRun(context.Context, Run) error
DeleteRun(context.Context, Run) error
GetRun(_ context.Context, testID id.ID, runID int) (Run, error)
GetTestRuns(_ context.Context, _ Test, take, skip int32) ([]Run, error)
Count(context.Context, Test) (int, error)
GetRunByTraceID(context.Context, trace.TraceID) (Run, error)
GetLatestRunByTestVersion(context.Context, id.ID, int) (Run, error)
GetTestSuiteRunSteps(_ context.Context, _ id.ID, runID int) ([]Run, error)
}
func NewRunRepository ¶
func NewRunRepository(db *sql.DB, cache *Cache) RunRepository
type RunResults ¶
type RunResults struct {
AllPassed bool
Results maps.Ordered[SpanQuery, []AssertionResult]
}
type RunState ¶
type RunState string
const ( RunStateCreated RunState = "CREATED" RunStateExecuting RunState = "EXECUTING" RunStateAwaitingTrace RunState = "AWAITING_TRACE" RunStateTriggerFailed RunState = "TRIGGER_FAILED" RunStateTraceFailed RunState = "TRACE_FAILED" RunStateAssertionFailed RunState = "ASSERTION_FAILED" RunStateAnalyzingTrace RunState = "ANALYZING_TRACE" RunStateAnalyzingError RunState = "ANALYZING_ERROR" RunStateFinished RunState = "FINISHED" RunStateStopped RunState = "STOPPED" RunStateAwaitingTestResults RunState = "AWAITING_TEST_RESULTS" )
type SelectorFilter ¶
type SelectorPseudoClass ¶
type SpanAssertionResult ¶
func (SpanAssertionResult) MarshalJSON ¶
func (sar SpanAssertionResult) MarshalJSON() ([]byte, error)
func (SpanAssertionResult) SpanIDString ¶
func (sar SpanAssertionResult) SpanIDString() string
func (*SpanAssertionResult) UnmarshalJSON ¶
func (sar *SpanAssertionResult) UnmarshalJSON(data []byte) error
type SpanSelector ¶
type SpanSelector struct {
Filters []SelectorFilter `json:"filters,omitempty"`
PseudoClass *SelectorPseudoClass `json:"pseudoClass,omitempty"`
ChildSelector *SpanSelector `json:"childSelector,omitempty"`
}
type Test ¶
type Test struct {
ID id.ID `json:"id,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Version *int `json:"version,omitempty"`
Trigger trigger.Trigger `json:"trigger,omitempty"`
Specs Specs `json:"specs,omitempty"`
Outputs Outputs `json:"outputs,omitempty"`
Summary *Summary `json:"summary,omitempty"`
}
this struct yaml/json encoding is handled at ./test_json.go for custom encodings
func (Test) SafeVersion ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.