Documentation
¶
Index ¶
- func LoadTestBlueprint(t *testing.T, yamlContent string) *schema.Blueprint
- func RequireEnv(t *testing.T, envVar string) string
- type ExecSQLCall
- type MockDeployEngine
- func (m *MockDeployEngine) CleanupBlueprintValidations(_ context.Context) error
- func (m *MockDeployEngine) CleanupChangesets(_ context.Context) error
- func (m *MockDeployEngine) CleanupEvents(_ context.Context) error
- func (m *MockDeployEngine) CreateBlueprintInstance(_ context.Context, _ *types.BlueprintInstancePayload) (*state.InstanceState, error)
- func (m *MockDeployEngine) CreateBlueprintValidation(_ context.Context, _ *types.CreateBlueprintValidationPayload, ...) (*manage.BlueprintValidation, error)
- func (m *MockDeployEngine) CreateChangeset(_ context.Context, _ *types.CreateChangesetPayload) (*manage.Changeset, error)
- func (m *MockDeployEngine) DestroyBlueprintInstance(_ context.Context, _ string, _ *types.DestroyBlueprintInstancePayload) (*state.InstanceState, error)
- func (m *MockDeployEngine) GetBlueprintInstance(_ context.Context, _ string) (*state.InstanceState, error)
- func (m *MockDeployEngine) GetBlueprintInstanceExports(_ context.Context, _ string) (map[string]*state.ExportState, error)
- func (m *MockDeployEngine) GetBlueprintValidation(_ context.Context, _ string) (*manage.BlueprintValidation, error)
- func (m *MockDeployEngine) GetChangeset(_ context.Context, _ string) (*manage.Changeset, error)
- func (m *MockDeployEngine) StreamBlueprintInstanceEvents(ctx context.Context, instanceID string, ...) error
- func (m *MockDeployEngine) StreamBlueprintValidationEvents(ctx context.Context, validationID string, ...) error
- func (m *MockDeployEngine) StreamChangeStagingEvents(ctx context.Context, changesetID string, ...) error
- func (m *MockDeployEngine) UpdateBlueprintInstance(_ context.Context, _ string, _ *types.BlueprintInstancePayload) (*state.InstanceState, error)
- type MockDockerManager
- func (m *MockDockerManager) CheckAvailability(ctx context.Context) error
- func (m *MockDockerManager) CleanupStale(ctx context.Context, containerName string) error
- func (m *MockDockerManager) CreateAndStart(ctx context.Context, config *docker.ContainerConfig) (string, error)
- func (m *MockDockerManager) EnsureImage(ctx context.Context, image string, progress chan<- docker.ImagePullProgress) error
- func (m *MockDockerManager) IsRunning(ctx context.Context, containerID string) (bool, error)
- func (m *MockDockerManager) RestartContainer(ctx context.Context, containerID string) error
- func (m *MockDockerManager) Stop(ctx context.Context, containerID string) error
- func (m *MockDockerManager) StreamLogs(ctx context.Context, containerID string) (io.ReadCloser, error)
- func (m *MockDockerManager) StreamLogsWithOptions(ctx context.Context, containerID string, opts docker.LogStreamOptions) (io.ReadCloser, error)
- type MockNoSQLSeeder
- type MockSQLSeeder
- type MockStorageUploader
- type PutItemCall
- type UploadCall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadTestBlueprint ¶
LoadTestBlueprint loads a blueprint from a YAML string, failing the test on error.
Types ¶
type ExecSQLCall ¶
ExecSQLCall records a single ExecSQL invocation.
type MockDeployEngine ¶
type MockDeployEngine struct {
CreateBlueprintValidationResult *manage.BlueprintValidation
CreateBlueprintValidationErr error
GetBlueprintValidationResult *manage.BlueprintValidation
GetBlueprintValidationErr error
// StreamBlueprintValidationEventsFn allows full control over the streaming behaviour.
// If set, it is called directly; otherwise the default implementation
// sends StubValidationEvents to the streamTo channel and then closes it.
StreamBlueprintValidationEventsFn func(ctx context.Context, validationID string, streamTo chan<- types.BlueprintValidationEvent, errChan chan<- error) error
StreamBlueprintValidationErr error
StubValidationEvents []types.BlueprintValidationEvent
CreateChangesetResult *manage.Changeset
CreateChangesetErr error
GetChangesetResult *manage.Changeset
GetChangesetErr error
StreamChangeStagingEventsFn func(ctx context.Context, changesetID string, streamTo chan<- types.ChangeStagingEvent, errChan chan<- error) error
StreamChangeStagingErr error
CreateBlueprintInstanceResult *state.InstanceState
CreateBlueprintInstanceErr error
UpdateBlueprintInstanceResult *state.InstanceState
UpdateBlueprintInstanceErr error
GetBlueprintInstanceResult *state.InstanceState
GetBlueprintInstanceErr error
GetBlueprintInstanceExportsResult map[string]*state.ExportState
GetBlueprintInstanceExportsErr error
DestroyBlueprintInstanceResult *state.InstanceState
DestroyBlueprintInstanceErr error
StreamBlueprintInstanceEventsFn func(ctx context.Context, instanceID string, streamTo chan<- types.BlueprintInstanceEvent, errChan chan<- error) error
StreamBlueprintInstanceErr error
}
MockDeployEngine is a test double for engine.DeployEngine. Set the fields to control return values and inject errors.
func (*MockDeployEngine) CleanupBlueprintValidations ¶
func (m *MockDeployEngine) CleanupBlueprintValidations(_ context.Context) error
func (*MockDeployEngine) CleanupChangesets ¶
func (m *MockDeployEngine) CleanupChangesets(_ context.Context) error
func (*MockDeployEngine) CleanupEvents ¶
func (m *MockDeployEngine) CleanupEvents(_ context.Context) error
func (*MockDeployEngine) CreateBlueprintInstance ¶
func (m *MockDeployEngine) CreateBlueprintInstance(_ context.Context, _ *types.BlueprintInstancePayload) (*state.InstanceState, error)
func (*MockDeployEngine) CreateBlueprintValidation ¶
func (m *MockDeployEngine) CreateBlueprintValidation( _ context.Context, _ *types.CreateBlueprintValidationPayload, _ *types.CreateBlueprintValidationQuery, ) (*manage.BlueprintValidation, error)
func (*MockDeployEngine) CreateChangeset ¶
func (m *MockDeployEngine) CreateChangeset(_ context.Context, _ *types.CreateChangesetPayload) (*manage.Changeset, error)
func (*MockDeployEngine) DestroyBlueprintInstance ¶
func (m *MockDeployEngine) DestroyBlueprintInstance(_ context.Context, _ string, _ *types.DestroyBlueprintInstancePayload) (*state.InstanceState, error)
func (*MockDeployEngine) GetBlueprintInstance ¶
func (m *MockDeployEngine) GetBlueprintInstance(_ context.Context, _ string) (*state.InstanceState, error)
func (*MockDeployEngine) GetBlueprintInstanceExports ¶
func (m *MockDeployEngine) GetBlueprintInstanceExports(_ context.Context, _ string) (map[string]*state.ExportState, error)
func (*MockDeployEngine) GetBlueprintValidation ¶
func (m *MockDeployEngine) GetBlueprintValidation(_ context.Context, _ string) (*manage.BlueprintValidation, error)
func (*MockDeployEngine) GetChangeset ¶
func (*MockDeployEngine) StreamBlueprintInstanceEvents ¶
func (m *MockDeployEngine) StreamBlueprintInstanceEvents( ctx context.Context, instanceID string, streamTo chan<- types.BlueprintInstanceEvent, errChan chan<- error, ) error
func (*MockDeployEngine) StreamBlueprintValidationEvents ¶
func (m *MockDeployEngine) StreamBlueprintValidationEvents( ctx context.Context, validationID string, streamTo chan<- types.BlueprintValidationEvent, errChan chan<- error, ) error
func (*MockDeployEngine) StreamChangeStagingEvents ¶
func (m *MockDeployEngine) StreamChangeStagingEvents( ctx context.Context, changesetID string, streamTo chan<- types.ChangeStagingEvent, errChan chan<- error, ) error
func (*MockDeployEngine) UpdateBlueprintInstance ¶
func (m *MockDeployEngine) UpdateBlueprintInstance(_ context.Context, _ string, _ *types.BlueprintInstancePayload) (*state.InstanceState, error)
type MockDockerManager ¶
type MockDockerManager struct {
CheckAvailabilityFn func(ctx context.Context) error
EnsureImageFn func(ctx context.Context, image string, progress chan<- docker.ImagePullProgress) error
CreateAndStartFn func(ctx context.Context, config *docker.ContainerConfig) (string, error)
StreamLogsFn func(ctx context.Context, containerID string) (io.ReadCloser, error)
StreamLogsOptsFn func(ctx context.Context, containerID string, opts docker.LogStreamOptions) (io.ReadCloser, error)
RestartContainerFn func(ctx context.Context, containerID string) error
StopFn func(ctx context.Context, containerID string) error
IsRunningFn func(ctx context.Context, containerID string) (bool, error)
CleanupStaleFn func(ctx context.Context, containerName string) error
// Call records for assertions.
StopCalls []string
CleanupStaleCalls []string
}
MockDockerManager is a test double for docker.RuntimeContainerManager. Set the function fields to control behaviour; unset fields return nil/zero.
func (*MockDockerManager) CheckAvailability ¶
func (m *MockDockerManager) CheckAvailability(ctx context.Context) error
func (*MockDockerManager) CleanupStale ¶
func (m *MockDockerManager) CleanupStale(ctx context.Context, containerName string) error
func (*MockDockerManager) CreateAndStart ¶
func (m *MockDockerManager) CreateAndStart(ctx context.Context, config *docker.ContainerConfig) (string, error)
func (*MockDockerManager) EnsureImage ¶
func (m *MockDockerManager) EnsureImage(ctx context.Context, image string, progress chan<- docker.ImagePullProgress) error
func (*MockDockerManager) RestartContainer ¶
func (m *MockDockerManager) RestartContainer(ctx context.Context, containerID string) error
func (*MockDockerManager) Stop ¶
func (m *MockDockerManager) Stop(ctx context.Context, containerID string) error
func (*MockDockerManager) StreamLogs ¶
func (m *MockDockerManager) StreamLogs(ctx context.Context, containerID string) (io.ReadCloser, error)
func (*MockDockerManager) StreamLogsWithOptions ¶
func (m *MockDockerManager) StreamLogsWithOptions(ctx context.Context, containerID string, opts docker.LogStreamOptions) (io.ReadCloser, error)
type MockNoSQLSeeder ¶
type MockNoSQLSeeder struct {
PutItemCalls []PutItemCall
PutItemErr error
}
MockNoSQLSeeder records all PutItem calls for assertion.
type MockSQLSeeder ¶
type MockSQLSeeder struct {
ExecSQLCalls []ExecSQLCall
ExecSQLErr error
}
MockSQLSeeder records all ExecSQL calls for assertion.
type MockStorageUploader ¶
type MockStorageUploader struct {
UploadCalls []UploadCall
UploadErr error
}
MockStorageUploader records all Upload calls for assertion.
type PutItemCall ¶
PutItemCall records a single PutItem invocation.
type UploadCall ¶
UploadCall records a single Upload invocation.