Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Infrastructure defines the infrastructure services configuration.
Infrastructure Infrastructure `yaml:"infrastructure"`
// Tools defines the tools configuration.
Tools Tools `yaml:"tools"`
// Metrics defines the metrics collectors configuration.
Metrics map[string]MetricsCollector `yaml:"metrics"`
// Tests defines the test configurations.
Tests []Test `yaml:"tests"`
}
Config represents the overall configuration for the application.
type Infrastructure ¶
type Infrastructure map[string]ServiceConfig
Infrastructure represents a map of service configurations for the infrastructure.
type MetricsCollector ¶
type MetricsCollector struct {
// Collector is the name of the metrics collector.
Collector string `yaml:"collector"`
// Settings defines additional settings for the metrics collector. The
// specific settings depend on the collector.
Settings map[string]any `yaml:"settings"`
// Tools is a list of tools for which the collector is applicable. If empty,\
// the collector will be applied to all tools.
Tools StringList `yaml:"tools"`
}
MetricsCollector represents the configuration for a metrics collector.
type ServiceConfig ¶
type ServiceConfig struct {
// DockerCompose is the path to the Docker Compose file for the service. If
// it's a relative path, it will be resolved relative to the configuration
// file.
DockerCompose StringList `yaml:"compose"`
}
ServiceConfig represents the configuration for a service.
type StringList ¶ added in v0.4.0
type StringList []string
StringList represents a YAML field that can be either a string or a slice of strings.
func (*StringList) UnmarshalYAML ¶ added in v0.4.0
func (s *StringList) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML implements the yaml.Unmarshaler interface.
type Test ¶
type Test struct {
// Infrastructure defines the infrastructure services configuration for the
// test. This configuration will be merged with the global infrastructure
// configuration.
Infrastructure map[string]ServiceConfig `yaml:"infrastructure"`
// Tools defines the tools configuration for the test. This configuration will
// be merged with the global tools configuration.
Tools map[string]ServiceConfig `yaml:"tools"`
// Name is the name of the test.
Name string `yaml:"name"`
// Duration is the duration of the test. The test will be stopped after this
// duration.
Duration time.Duration `yaml:"duration"`
// Steps defines the hooks to be executed during the test.
Steps TestHooks `yaml:"steps"`
}
Test represents the configuration for a test.
type TestHook ¶
type TestHook struct {
// Name is the name of the hook.
Name string `yaml:"name"`
// Container is the name of the container to run the command in. If empty, the
// command will be run on a temporary container using the image specified in
// the `image` field.
Container string `yaml:"container"`
// Image is the image to use for the temporary container. If `container` is
// specified, this field is ignored. If both `container` and `image` are empty,
// the command will be run in a temporary container using the alpine image.
Image string `yaml:"image"`
// Run is the command to be executed.
Run string `yaml:"run"`
// Tools is a list of tools for which the hook is applicable. If empty, the
// hook will be applied to all tools.
Tools StringList `yaml:"tools"`
}
type TestHooks ¶
type TestHooks struct {
// PreInfrastructure defines the hooks to be executed before setting up the
// infrastructure.
PreInfrastructure []TestHook `yaml:"pre-infrastructure"`
// PostInfrastructure defines the hooks to be executed after setting up the
// infrastructure.
PostInfrastructure []TestHook `yaml:"post-infrastructure"`
// PreTool defines the hooks to be executed before setting up the tools.
PreTool []TestHook `yaml:"pre-tool"`
// PostTool defines the hooks to be executed after setting up the tools.
PostTool []TestHook `yaml:"post-tool"`
// PreTest defines the hooks to be executed before starting the test.
PreTest []TestHook `yaml:"pre-test"`
// During defines the hooks to be executed during the test.
During []TestHook `yaml:"during"`
// PostTest defines the hooks to be executed after the test.
PostTest []TestHook `yaml:"post-test"`
// PreCleanup defines the hooks to be executed before cleaning up the test
// environment.
PreCleanup []TestHook `yaml:"pre-cleanup"`
// PostCleanup defines the hooks to be executed after cleaning up the test
// environment.
PostCleanup []TestHook `yaml:"post-cleanup"`
}
TestHooks represents the hooks to be executed during different steps of the test.
type Tools ¶
type Tools map[string]ServiceConfig
Tools represents a map of service configurations for the tools.
Click to show internal directories.
Click to hide internal directories.