Documentation
¶
Overview ¶
Package environments contains the definitions of the different environments that can be used in a test.
Package environments contains the definitions of the different environments that can be used in a test.
Index ¶
- func BuildEnvFromResources(ctx common.Context, resources provisioners.RawResources, ...) error
- func CreateEnv[Env any]() (*Env, []reflect.StructField, []reflect.Value, error)
- type CoverageBase
- type CoverageTargetSpec
- type DockerHost
- func (e *DockerHost) Coverage(outputDir string) (string, error)
- func (e *DockerHost) Diagnose(outputDir string) (string, error)
- func (e *DockerHost) DisableAgent()
- func (e *DockerHost) DisableFakeIntake()
- func (e *DockerHost) DockerAgentOutput() *agent.DockerAgentOutput
- func (e *DockerHost) DockerOutput() *docker.ManagerOutput
- func (e *DockerHost) FakeIntakeOutput() *fakeintake.FakeintakeOutput
- func (e *DockerHost) Init(_ common.Context) error
- func (e *DockerHost) RemoteHostOutput() *remote.HostOutput
- type ECS
- type Host
- func (e *Host) AgentOutput() *agent.HostAgentOutput
- func (e *Host) Coverage(outputDir string) (string, error)
- func (e *Host) Diagnose(outputDir string) (string, error)
- func (e *Host) DisableAgent()
- func (e *Host) DisableFakeIntake()
- func (e *Host) DisableUpdater()
- func (e *Host) FakeIntakeOutput() *fakeintake.FakeintakeOutput
- func (e *Host) Init(_ common.Context) error
- func (e *Host) RemoteHostOutput() *remote.HostOutput
- func (e *Host) SetAgentClientOptions(options ...agentclientparams.Option)
- func (e *Host) UpdaterOutput() *updater.HostUpdaterOutput
- type Kubernetes
- func (e *Kubernetes) Coverage(outputDir string) (string, error)
- func (e *Kubernetes) Diagnose(outputDir string) (string, error)
- func (e *Kubernetes) DisableAgent()
- func (e *Kubernetes) DisableFakeIntake()
- func (e *Kubernetes) FakeIntakeOutput() *fakeintake.FakeintakeOutput
- func (e *Kubernetes) KubernetesAgentOutput() *agent.KubernetesAgentOutput
- func (e *Kubernetes) KubernetesClusterOutput() *kubernetes.ClusterOutput
- func (e *Kubernetes) WaitForAgentReady(ctx context.Context, options ...KubernetesAgentReadinessOption) error
- type KubernetesAgentReadinessOption
- func WithAgentReadinessStableFor(duration time.Duration) KubernetesAgentReadinessOption
- func WithAgentReadinessTimeout(timeout time.Duration) KubernetesAgentReadinessOption
- func WithClusterAgentReady() KubernetesAgentReadinessOption
- func WithClusterChecksReady() KubernetesAgentReadinessOption
- func WithLinuxNodeAgentReady() KubernetesAgentReadinessOption
- func WithPodsReadyForNodes(name, namespace, labelSelector, nodeSelector string) KubernetesAgentReadinessOption
- func WithWindowsNodeAgentReady() KubernetesAgentReadinessOption
- type WindowsHost
- func (e *WindowsHost) ActiveDirectoryOutput() *activedirectory.Output
- func (e *WindowsHost) AgentOutput() *agent.HostAgentOutput
- func (e *WindowsHost) Diagnose(outputDir string) (string, error)
- func (e *WindowsHost) DisableActiveDirectory()
- func (e *WindowsHost) DisableAgent()
- func (e *WindowsHost) DisableFakeIntake()
- func (e *WindowsHost) FakeIntakeOutput() *fakeintake.FakeintakeOutput
- func (e *WindowsHost) Init(_ common.Context) error
- func (e *WindowsHost) RemoteHostOutput() *remote.HostOutput
- func (e *WindowsHost) SetAgentClientOptions(options ...agentclientparams.Option)
- func (e *WindowsHost) SetEnvironment(env config.Env)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildEnvFromResources ¶ added in v0.82.0
func BuildEnvFromResources(ctx common.Context, resources provisioners.RawResources, fields []reflect.StructField, values []reflect.Value) error
BuildEnvFromResources imports the raw resources returned by a provisioner into the importable fields of an environment, and initializes each imported component.
fields and values are the importable fields/values returned by CreateEnv; resources is the provisioners.RawResources map returned by the provisioner. ctx is passed to every component implementing common.Initializable. It is decoupled from *testing.T so non-test callers (e.g. a standalone binary) can drive provisioning.
Types ¶
type CoverageBase ¶ added in v0.80.0
type CoverageBase struct {
// contains filtered or unexported fields
}
CoverageBase provides shared coverage override logic. Embed it in any environment that implements Coverageable so the override setter and application come for free.
func (*CoverageBase) SetCoverageRequiredOverride ¶ added in v0.80.0
func (c *CoverageBase) SetCoverageRequiredOverride(overrides map[string]bool)
SetCoverageRequiredOverride records per-agent overrides for the Required field. Each key must match a CoverageTargetSpec.AgentName. Passing a nil map clears all overrides.
type CoverageTargetSpec ¶
CoverageTargetSpec defines the name of the agent, the command to run to generate the coverage and if the coverage is required
type DockerHost ¶
type DockerHost struct {
CoverageBase
// Components
RemoteHost *components.RemoteHost
FakeIntake *components.FakeIntake
Agent *components.DockerAgent
Docker *components.RemoteHostDocker
}
DockerHost is an environment that contains a Docker VM, FakeIntake and Agent configured to talk to each other.
func (*DockerHost) Coverage ¶
func (e *DockerHost) Coverage(outputDir string) (string, error)
Coverage generates a coverage report for the Docker agent
func (*DockerHost) Diagnose ¶
func (e *DockerHost) Diagnose(outputDir string) (string, error)
Diagnose returns a string containing the diagnosis of the environment
func (*DockerHost) DisableAgent ¶ added in v0.77.0
func (e *DockerHost) DisableAgent()
DisableAgent implements outputs.DockerHostOutputs
func (*DockerHost) DisableFakeIntake ¶ added in v0.77.0
func (e *DockerHost) DisableFakeIntake()
DisableFakeIntake implements outputs.DockerHostOutputs
func (*DockerHost) DockerAgentOutput ¶ added in v0.77.0
func (e *DockerHost) DockerAgentOutput() *agent.DockerAgentOutput
DockerAgentOutput implements outputs.DockerHostOutputs
func (*DockerHost) DockerOutput ¶ added in v0.77.0
func (e *DockerHost) DockerOutput() *docker.ManagerOutput
DockerOutput implements outputs.DockerHostOutputs
func (*DockerHost) FakeIntakeOutput ¶ added in v0.77.0
func (e *DockerHost) FakeIntakeOutput() *fakeintake.FakeintakeOutput
FakeIntakeOutput implements outputs.DockerHostOutputs
func (*DockerHost) Init ¶
func (e *DockerHost) Init(_ common.Context) error
Init initializes the environment
func (*DockerHost) RemoteHostOutput ¶ added in v0.77.0
func (e *DockerHost) RemoteHostOutput() *remote.HostOutput
RemoteHostOutput implements outputs.DockerHostOutputs
type ECS ¶
type ECS struct {
// Components
ECSCluster *components.ECSCluster
FakeIntake *components.FakeIntake
}
ECS is an environment that contains a ECS deployed in a cluster, FakeIntake and Agent configured to talk to each other.
func (*ECS) DisableFakeIntake ¶ added in v0.77.0
func (e *ECS) DisableFakeIntake()
DisableFakeIntake implements outputs.ECSOutputs
func (*ECS) ECSClusterOutput ¶ added in v0.77.0
func (e *ECS) ECSClusterOutput() *ecs.ClusterOutput
ECSClusterOutput implements outputs.ECSOutputs
func (*ECS) FakeIntakeOutput ¶ added in v0.77.0
func (e *ECS) FakeIntakeOutput() *fakeintake.FakeintakeOutput
FakeIntakeOutput implements outputs.ECSOutputs
type Host ¶
type Host struct {
CoverageBase
RemoteHost *components.RemoteHost
FakeIntake *components.FakeIntake
Agent *components.RemoteHostAgent
Updater *components.RemoteHostUpdater
}
Host is an environment that contains a Host, FakeIntake and Agent configured to talk to each other.
func (*Host) AgentOutput ¶ added in v0.77.0
func (e *Host) AgentOutput() *agent.HostAgentOutput
AgentOutput implements outputs.HostOutputs
func (*Host) Coverage ¶
Coverage runs the coverage command for each agent and downloads the coverage folders to the output directory
func (*Host) DisableAgent ¶ added in v0.77.0
func (e *Host) DisableAgent()
DisableAgent implements outputs.HostOutputs
func (*Host) DisableFakeIntake ¶ added in v0.77.0
func (e *Host) DisableFakeIntake()
DisableFakeIntake implements outputs.HostOutputs
func (*Host) DisableUpdater ¶ added in v0.77.0
func (e *Host) DisableUpdater()
DisableUpdater implements outputs.HostOutputs
func (*Host) FakeIntakeOutput ¶ added in v0.77.0
func (e *Host) FakeIntakeOutput() *fakeintake.FakeintakeOutput
FakeIntakeOutput implements outputs.HostOutputs
func (*Host) RemoteHostOutput ¶ added in v0.77.0
func (e *Host) RemoteHostOutput() *remote.HostOutput
RemoteHostOutput implements outputs.HostOutputs
func (*Host) SetAgentClientOptions ¶ added in v0.77.0
func (e *Host) SetAgentClientOptions(options ...agentclientparams.Option)
SetAgentClientOptions implements outputs.HostOutputs
func (*Host) UpdaterOutput ¶ added in v0.77.0
func (e *Host) UpdaterOutput() *updater.HostUpdaterOutput
UpdaterOutput implements outputs.HostOutputs
type Kubernetes ¶
type Kubernetes struct {
CoverageBase
// Components
KubernetesCluster *components.KubernetesCluster
FakeIntake *components.FakeIntake
Agent *components.KubernetesAgent
}
Kubernetes is an environment that contains a Kubernetes cluster, the Agent and a FakeIntake.
func (*Kubernetes) Coverage ¶
func (e *Kubernetes) Coverage(outputDir string) (string, error)
Coverage generates a coverage report for each pod and container
func (*Kubernetes) Diagnose ¶
func (e *Kubernetes) Diagnose(outputDir string) (string, error)
Diagnose generates a diagnose for the Kubernetes environment, creating a flare for each agent and cluster-agent pod.
func (*Kubernetes) DisableAgent ¶ added in v0.77.0
func (e *Kubernetes) DisableAgent()
DisableAgent implements eks.KubernetesOutputs
func (*Kubernetes) DisableFakeIntake ¶ added in v0.77.0
func (e *Kubernetes) DisableFakeIntake()
DisableFakeIntake implements eks.KubernetesOutputs
func (*Kubernetes) FakeIntakeOutput ¶ added in v0.77.0
func (e *Kubernetes) FakeIntakeOutput() *fakeintake.FakeintakeOutput
FakeIntakeOutput implements eks.KubernetesOutputs
func (*Kubernetes) KubernetesAgentOutput ¶ added in v0.77.0
func (e *Kubernetes) KubernetesAgentOutput() *agent.KubernetesAgentOutput
KubernetesAgentOutput implements eks.KubernetesOutputs
func (*Kubernetes) KubernetesClusterOutput ¶ added in v0.77.0
func (e *Kubernetes) KubernetesClusterOutput() *kubernetes.ClusterOutput
KubernetesClusterOutput implements eks.KubernetesOutputs
func (*Kubernetes) WaitForAgentReady ¶ added in v0.85.0
func (e *Kubernetes) WaitForAgentReady(ctx context.Context, options ...KubernetesAgentReadinessOption) error
WaitForAgentReady waits for the selected Agent workloads to have their expected pod count, with every init and regular container ready and never restarted. At least one workload option such as WithLinuxNodeAgentReady or WithClusterAgentReady must be provided.
type KubernetesAgentReadinessOption ¶ added in v0.85.0
type KubernetesAgentReadinessOption func(*kubernetesAgentReadinessParams)
KubernetesAgentReadinessOption configures WaitForAgentReady.
func WithAgentReadinessStableFor ¶ added in v0.85.0
func WithAgentReadinessStableFor(duration time.Duration) KubernetesAgentReadinessOption
WithAgentReadinessStableFor requires all selected pods to remain ready for the given duration. This is useful for suites that need the Agent's asynchronous subsystems to finish warming up.
func WithAgentReadinessTimeout ¶ added in v0.85.0
func WithAgentReadinessTimeout(timeout time.Duration) KubernetesAgentReadinessOption
WithAgentReadinessTimeout sets the maximum time WaitForAgentReady waits.
func WithClusterAgentReady ¶ added in v0.85.0
func WithClusterAgentReady() KubernetesAgentReadinessOption
WithClusterAgentReady waits for at least one ready Cluster Agent pod.
func WithClusterChecksReady ¶ added in v0.85.0
func WithClusterChecksReady() KubernetesAgentReadinessOption
WithClusterChecksReady waits for at least one ready Cluster Checks Runner pod.
func WithLinuxNodeAgentReady ¶ added in v0.85.0
func WithLinuxNodeAgentReady() KubernetesAgentReadinessOption
WithLinuxNodeAgentReady waits for one ready Linux Node Agent pod per non-Fargate Linux node.
func WithPodsReadyForNodes ¶ added in v0.85.0
func WithPodsReadyForNodes(name, namespace, labelSelector, nodeSelector string) KubernetesAgentReadinessOption
WithPodsReadyForNodes waits for one ready pod matching labelSelector per node matching nodeSelector. It is intended for auxiliary DaemonSets that should be ready alongside the Agent.
func WithWindowsNodeAgentReady ¶ added in v0.85.0
func WithWindowsNodeAgentReady() KubernetesAgentReadinessOption
WithWindowsNodeAgentReady waits for one ready Windows Node Agent pod per Windows node.
type WindowsHost ¶
type WindowsHost struct {
Environment config.Env
// Components
RemoteHost *components.RemoteHost
FakeIntake *components.FakeIntake
Agent *components.RemoteHostAgent
ActiveDirectory *components.RemoteActiveDirectory
}
WindowsHost is an environment based on environments.Host but that is specific to Windows.
func (*WindowsHost) ActiveDirectoryOutput ¶ added in v0.77.0
func (e *WindowsHost) ActiveDirectoryOutput() *activedirectory.Output
ActiveDirectoryOutput implements outputs.WindowsHostOutputs
func (*WindowsHost) AgentOutput ¶ added in v0.77.0
func (e *WindowsHost) AgentOutput() *agent.HostAgentOutput
AgentOutput implements outputs.WindowsHostOutputs
func (*WindowsHost) Diagnose ¶
func (e *WindowsHost) Diagnose(outputDir string) (string, error)
Diagnose returns a string containing the diagnosis of the environment
func (*WindowsHost) DisableActiveDirectory ¶ added in v0.77.0
func (e *WindowsHost) DisableActiveDirectory()
DisableActiveDirectory implements outputs.WindowsHostOutputs
func (*WindowsHost) DisableAgent ¶ added in v0.77.0
func (e *WindowsHost) DisableAgent()
DisableAgent implements outputs.WindowsHostOutputs
func (*WindowsHost) DisableFakeIntake ¶ added in v0.77.0
func (e *WindowsHost) DisableFakeIntake()
DisableFakeIntake implements outputs.WindowsHostOutputs
func (*WindowsHost) FakeIntakeOutput ¶ added in v0.77.0
func (e *WindowsHost) FakeIntakeOutput() *fakeintake.FakeintakeOutput
FakeIntakeOutput implements outputs.WindowsHostOutputs
func (*WindowsHost) Init ¶
func (e *WindowsHost) Init(_ common.Context) error
Init initializes the environment
func (*WindowsHost) RemoteHostOutput ¶ added in v0.77.0
func (e *WindowsHost) RemoteHostOutput() *remote.HostOutput
RemoteHostOutput implements outputs.WindowsHostOutputs
func (*WindowsHost) SetAgentClientOptions ¶ added in v0.77.0
func (e *WindowsHost) SetAgentClientOptions(options ...agentclientparams.Option)
func (*WindowsHost) SetEnvironment ¶ added in v0.77.0
func (e *WindowsHost) SetEnvironment(env config.Env)
SetEnvironment implements outputs.WindowsHostOutputs