Documentation
¶
Index ¶
- Constants
- Variables
- func AssertLoki(r *runner, l ExpectedLogs)
- func AssertLokiResponse(b []byte, l ExpectedLogs, r *runner)
- func AssertProm(r *runner, promQL string, value string)
- func AssertTempo(r *runner, t ExpectedTraces)
- func AssumeNoYamlTest(t *testing.T)
- func GetFreePorts(count int) ([]int, error)
- func RunTestCase(c *TestCase)
- func TestCaseBasePath() string
- type CustomCheck
- type DashboardAssert
- type DockerCompose
- type Expected
- type ExpectedDashboard
- type ExpectedDashboardPanel
- type ExpectedLogs
- type ExpectedMetrics
- type ExpectedSpan
- type ExpectedTraces
- type Input
- type PortAllocator
- type PortConfig
- type QueryLogger
- type QueryResponse
- type TestCase
- type TestCaseDefinition
- type TestDashboard
Constants ¶
View Source
const DefaultTestCaseInterval = 100 * time.Millisecond
Variables ¶
View Source
var VerboseLogging bool
Functions ¶
func AssertLoki ¶
func AssertLoki(r *runner, l ExpectedLogs)
func AssertLokiResponse ¶ added in v0.1.0
func AssertLokiResponse(b []byte, l ExpectedLogs, r *runner)
func AssertProm ¶
func AssertTempo ¶
func AssertTempo(r *runner, t ExpectedTraces)
func AssumeNoYamlTest ¶
func GetFreePorts ¶
func RunTestCase ¶
func RunTestCase(c *TestCase)
func TestCaseBasePath ¶ added in v0.1.0
func TestCaseBasePath() string
Types ¶
type CustomCheck ¶ added in v0.1.0
type CustomCheck struct {
Script string `yaml:"script"`
}
type DashboardAssert ¶
type DashboardAssert struct {
// contains filtered or unexported fields
}
func NewDashboardAssert ¶
func NewDashboardAssert(d ExpectedDashboard) *DashboardAssert
func (*DashboardAssert) AssertDashboard ¶
func (a *DashboardAssert) AssertDashboard(r *runner, panelIndex int)
type DockerCompose ¶
type Expected ¶
type Expected struct { Logs []ExpectedLogs `yaml:"logs"` Traces []ExpectedTraces `yaml:"traces"` Metrics []ExpectedMetrics `yaml:"metrics"` Dashboards []ExpectedDashboard `yaml:"dashboards"` CustomChecks []CustomCheck `yaml:"custom-checks"` }
type ExpectedDashboard ¶
type ExpectedDashboard struct { Path string `yaml:"path"` Panels []ExpectedDashboardPanel `yaml:"panels"` }
type ExpectedDashboardPanel ¶
type ExpectedLogs ¶
type ExpectedLogs struct { LogQL string `yaml:"logql"` Equals string `yaml:"equals"` Contains []string `yaml:"contains"` Regexp string `yaml:"regexp"` Attributes map[string]string `yaml:"attributes"` AttributeRegexp map[string]string `yaml:"attribute-regexp"` NoExtraAttributes bool `yaml:"no-extra-attributes"` }
type ExpectedMetrics ¶
type ExpectedSpan ¶
type ExpectedTraces ¶
type ExpectedTraces struct { TraceQL string `yaml:"traceql"` Spans []ExpectedSpan `yaml:"spans"` }
type PortAllocator ¶
type PortAllocator struct {
// contains filtered or unexported fields
}
func NewPortAllocator ¶
func NewPortAllocator(needed int) *PortAllocator
func (*PortAllocator) Allocate ¶
func (p *PortAllocator) Allocate() int
func (*PortAllocator) AllocatePorts ¶
func (p *PortAllocator) AllocatePorts() *PortConfig
type PortConfig ¶
type QueryLogger ¶
type QueryLogger struct { Verbose bool Logger io.WriteCloser // contains filtered or unexported fields }
func NewQueryLogger ¶
func NewQueryLogger(endpoint observability.Endpoint, logger io.WriteCloser) QueryLogger
func (*QueryLogger) LogQueryResult ¶
func (q *QueryLogger) LogQueryResult(format string, a ...any)
type QueryResponse ¶ added in v0.1.0
type TestCase ¶
type TestCase struct { Name string Dir string OutputDir string Definition TestCaseDefinition PortConfig *PortConfig Dashboard *TestDashboard Timeout time.Duration }
func ReadTestCases ¶
func (*TestCase) CreateDockerComposeFile ¶
type TestCaseDefinition ¶
type TestCaseDefinition struct { Include []string `yaml:"include"` DockerCompose *DockerCompose `yaml:"docker-compose"` Kubernetes *kubernetes.Kubernetes `yaml:"kubernetes"` Input []Input `yaml:"input"` Interval time.Duration `yaml:"interval"` Expected Expected `yaml:"expected"` }
func (*TestCaseDefinition) Merge ¶
func (d *TestCaseDefinition) Merge(other TestCaseDefinition)
type TestDashboard ¶
Click to show internal directories.
Click to hide internal directories.