parser

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_CHECKER = "contains"
	DEFAULT_ORDERED = true

	DEFAULT_TIMEOUT           = time.Duration(60) * time.Second
	DEFAULT_RETRYDELAY        = time.Duration(1) * time.Second
	DEFAULT_WAIT_BEFORE_FETCH = time.Duration(5) * time.Second

	DEFAULT_ASSERTION_TYPE = "cel"

	DEFAULT_SETUP_COMMAND_TYPE   = "shell"
	DEFAULT_POST_EXEC_CHECK_TYPE = "shell"

	DEFAULT_TRIGGER_TYPE = "http"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssertionDTO

type AssertionDTO struct {
	Name    string         `yaml:"name"`
	Type    string         `yaml:"type"`
	Queries map[string]any `yaml:"queries"`
}

func (*AssertionDTO) Validate

func (a *AssertionDTO) Validate() error

type CleanupCommandDTO

type CleanupCommandDTO struct {
	Cmd  string         `yaml:"cmd"`
	Args map[string]any `yaml:"args"`
}

type ExpectedSpanDTO

type ExpectedSpanDTO struct {
	SpanDTO     `yaml:",inline"`
	MaxDuration *domain.Duration `yaml:"maxDuration"`
	MinDuration *domain.Duration `yaml:"minDuration"`
}

func (*ExpectedSpanDTO) Validate

func (s *ExpectedSpanDTO) Validate() error

type ExpectedTraceDTO

type ExpectedTraceDTO struct {
	Spans   []*ExpectedSpanDTO `yaml:"spans"`
	Ordered *bool              `yaml:"ordered"`
	Checker *string            `yaml:"checker"`
}

func (*ExpectedTraceDTO) Validate

func (t *ExpectedTraceDTO) Validate() error

type ExpectedTracePropertiesDTO

type ExpectedTracePropertiesDTO struct {
	MaxDuration *domain.Duration `yaml:"maxDuration"`
	MinDuration *domain.Duration `yaml:"minDuration"`
	SpanCount   *int             `yaml:"spanCount"`
	ErrorCount  *int             `yaml:"errorCount"`
}

func (*ExpectedTracePropertiesDTO) Validate

func (p *ExpectedTracePropertiesDTO) Validate() error

type PostExecCheckDTO

type PostExecCheckDTO struct {
	Name string         `yaml:"name"`
	Type string         `yaml:"type"`
	Args map[string]any `yaml:"args"`
}

func (*PostExecCheckDTO) Validate

func (p *PostExecCheckDTO) Validate() error

type SetupCommandDTO

type SetupCommandDTO struct {
	Type       string             `yaml:"type"`
	Cmd        string             `yaml:"cmd"`
	Args       map[string]any     `yaml:"args"`
	CleanupCmd *CleanupCommandDTO `yaml:"cleanupCmd"`
}

func (*SetupCommandDTO) Validate

func (s *SetupCommandDTO) Validate() error

type SpanDTO

type SpanDTO struct {
	ServiceName   string  `yaml:"serviceName"`
	OperationName *string `yaml:"operationName"`
	SpanKind      *string `yaml:"spanKind"`
	SpanStatus    *string `yaml:"spanStatus"`
}

func (*SpanDTO) Validate

func (s *SpanDTO) Validate() error

type TestDTO

type TestDTO struct {
	Name          string             `yaml:"name"`
	Description   string             `yaml:"description"`
	SetupCommands []*SetupCommandDTO `yaml:"setupCommands"`
	Trigger       *TriggerDTO        `yaml:"trigger"`

	WaitBeforeFetch *domain.Duration `yaml:"waitBeforeFetch"`
	Timeout         *domain.Duration `yaml:"timeout"`
	RetryDelay      *domain.Duration `yaml:"retryDelay"`
	LastSpan        *ExpectedSpanDTO `yaml:"lastSpan"`

	ExpectedTraces     []*ExpectedTraceDTO         `yaml:"expectedTraces"`
	ExpectedProperties *ExpectedTracePropertiesDTO `yaml:"expectedProperties"`

	Assertions []*AssertionDTO `yaml:"assertions"`

	PostExecChecks []*PostExecCheckDTO `yaml:"postExecChecks"`
	FilePath       string              `yaml:"-"`
}

func ParseTests

func ParseTests(filePaths []string) ([]*TestDTO, error)

func (*TestDTO) Validate

func (t *TestDTO) Validate() error

type TraceDTO

type TraceDTO struct {
	Spans []*SpanDTO `yaml:"spans"`
}

type TriggerDTO

type TriggerDTO struct {
	Type string         `yaml:"type"`
	Args map[string]any `yaml:"args"`
}

func (*TriggerDTO) Validate

func (t *TriggerDTO) Validate() error

Jump to

Keyboard shortcuts

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