Documentation
¶
Index ¶
Constants ¶
const ( APIVersionV1 = "v1" KindHarness = "Harness" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Expectation ¶
type Expectation struct {
RunStatus string `yaml:"runStatus,omitempty"`
ErrorContains string `yaml:"errorContains,omitempty"`
Tasks []TaskExpectation `yaml:"tasks,omitempty"`
Metrics []MetricExpectation `yaml:"metrics,omitempty"`
Lineage *LineageExpectation `yaml:"lineage,omitempty"`
}
Expectation describes the asserted outcome of a scenario run.
type File ¶
type File struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Scenarios []Scenario `yaml:"scenarios"`
}
File models a harness scenario manifest consumed by `caesium test --scenario`.
type ImpactExpectation ¶
type ImpactExpectation struct {
// Dataset is the root dataset name whose downstream impact is queried
// (e.g. "<job-alias>.<step>.output").
Dataset string `yaml:"dataset"`
// Namespace overrides the dataset namespace; defaults to the harness
// namespace when empty.
Namespace string `yaml:"namespace,omitempty"`
// MaxDepth bounds the downstream BFS (0 = unbounded).
MaxDepth int `yaml:"maxDepth,omitempty"`
// Downstream lists dataset names that must appear in the impact result.
Downstream []string `yaml:"downstream"`
}
ImpactExpectation asserts the persisted lineage graph (the data the /lineage/impact query reads), not just the emitted events: that a root dataset reaches the expected downstream consumers. This catches regressions where datasets are emitted but never persisted, so impact comes back empty.
type LineageExpectation ¶
type LineageExpectation struct {
TotalEvents *int `yaml:"totalEvents,omitempty"`
EventTypes map[string]int `yaml:"eventTypes,omitempty"`
JobNames []string `yaml:"jobNames,omitempty"`
Impact []ImpactExpectation `yaml:"impact,omitempty"`
}
LineageExpectation describes emitted OpenLineage assertions.
type MetricExpectation ¶
type MetricExpectation struct {
Name string `yaml:"name"`
Labels map[string]string `yaml:"labels,omitempty"`
Value *float64 `yaml:"value,omitempty"`
Delta *float64 `yaml:"delta,omitempty"`
}
MetricExpectation describes one Prometheus metric assertion.
type MetricObservation ¶
MetricObservation is the measured value for one asserted metric.
type ResolvedScenario ¶
ResolvedScenario is a validated scenario with its source location.
func CollectScenarios ¶
func CollectScenarios(paths []string) ([]ResolvedScenario, error)
CollectScenarios loads harness scenarios from files or directories.
func (ResolvedScenario) Definition ¶
func (r ResolvedScenario) Definition() (*jobdef.Definition, error)
Definition loads and selects the job definition targeted by the scenario.
type Result ¶
type Result struct {
Scenario ResolvedScenario
Run *localrun.RunResult
ExecutionError error
MetricObservations []MetricObservation
LineageEvents []lineage.RunEvent
Failures []string
}
Result is the evaluated outcome of one scenario execution.
type Scenario ¶
type Scenario struct {
Name string `yaml:"name"`
Path string `yaml:"path"`
Alias string `yaml:"alias,omitempty"`
MaxParallel int `yaml:"maxParallel,omitempty"`
TaskTimeout time.Duration `yaml:"taskTimeout,omitempty"`
RunTimeout time.Duration `yaml:"runTimeout,omitempty"`
Expect Expectation `yaml:"expect"`
}
Scenario defines one executable harness case.
type TaskExpectation ¶
type TaskExpectation struct {
Name string `yaml:"name"`
Status string `yaml:"status,omitempty"`
Output map[string]string `yaml:"output,omitempty"`
LogContains []string `yaml:"logContains,omitempty"`
SchemaViolationCount *int `yaml:"schemaViolationCount,omitempty"`
CacheHit *bool `yaml:"cacheHit,omitempty"`
ErrorContains string `yaml:"errorContains,omitempty"`
}
TaskExpectation describes assertions for one task.