Documentation
¶
Index ¶
- func BuildAccount() *app.Account
- func BuildApp() *app.App
- func BuildAppConfig(appID string) *app.AppConfig
- func BuildCompletedUserJourney() app.UserJourney
- func BuildComponent(appID string) *app.Component
- func BuildInstall(a *app.App) *app.Install
- func BuildOrg() *app.Org
- func BuildUserJourney() app.UserJourney
- type Params
- type Seeder
- func (s *Seeder) CreateAccount(ctx context.Context, t *testing.T) *app.Account
- func (s *Seeder) CreateActionWorkflow(ctx context.Context, t *testing.T, appID string) *app.ActionWorkflow
- func (s *Seeder) CreateActionWorkflowConfig(ctx context.Context, t *testing.T, appID, appConfigID, actionWorkflowID string) *app.ActionWorkflowConfig
- func (s *Seeder) CreateApp(ctx context.Context, t *testing.T) *app.App
- func (s *Seeder) CreateAppBreakGlassConfig(ctx context.Context, t *testing.T, appID, appConfigID string) *app.AppBreakGlassConfig
- func (s *Seeder) CreateAppConfig(ctx context.Context, t *testing.T, appID string) *app.AppConfig
- func (s *Seeder) CreateAppInputConfig(ctx context.Context, t *testing.T, appID, appConfigID string) *app.AppInputConfig
- func (s *Seeder) CreateAppPermissionsConfig(ctx context.Context, t *testing.T, appID, appConfigID string) *app.AppPermissionsConfig
- func (s *Seeder) CreateAppPoliciesConfig(ctx context.Context, t *testing.T, appID, appConfigID string) *app.AppPoliciesConfig
- func (s *Seeder) CreateAppRunnerConfig(ctx context.Context, t *testing.T, appID, appConfigID string) *app.AppRunnerConfig
- func (s *Seeder) CreateAppSandboxConfig(ctx context.Context, t *testing.T, appID, appConfigID string) *app.AppSandboxConfig
- func (s *Seeder) CreateAppSecretsConfig(ctx context.Context, t *testing.T, appID, appConfigID string) *app.AppSecretsConfig
- func (s *Seeder) CreateAppStackConfig(ctx context.Context, t *testing.T, appID, appConfigID string) *app.AppStackConfig
- func (s *Seeder) CreateBareAppConfig(ctx context.Context, t *testing.T, appID string) *app.AppConfig
- func (s *Seeder) CreateComponent(ctx context.Context, t *testing.T, appID string, ...) *app.Component
- func (s *Seeder) CreateComponentBuild(ctx context.Context, t *testing.T, configConnectionID string) *app.ComponentBuild
- func (s *Seeder) CreateDockerBuildComponentConfigConnection(ctx context.Context, t *testing.T, componentID, appConfigID string) *app.ComponentConfigConnection
- func (s *Seeder) CreateExternalImageComponentConfigConnection(ctx context.Context, t *testing.T, componentID, appConfigID string) *app.ComponentConfigConnection
- func (s *Seeder) CreateHelmComponentConfigConnection(ctx context.Context, t *testing.T, componentID, appConfigID string) *app.ComponentConfigConnection
- func (s *Seeder) CreateInstall(ctx context.Context, t *testing.T, a *app.App) *app.Install
- func (s *Seeder) CreateInstallComponent(ctx context.Context, t *testing.T, installID, componentID string) *app.InstallComponent
- func (s *Seeder) CreateInstallDeploy(ctx context.Context, t *testing.T, installComponentID, componentBuildID string) *app.InstallDeploy
- func (s *Seeder) CreateInstallInputs(ctx context.Context, t *testing.T, installID, appInputConfigID string, ...) *app.InstallInputs
- func (s *Seeder) CreateInstallStackVersion(ctx context.Context, t *testing.T, ...) *app.InstallStackVersion
- func (s *Seeder) CreateJobComponentConfigConnection(ctx context.Context, t *testing.T, componentID, appConfigID string) *app.ComponentConfigConnection
- func (s *Seeder) CreateKubernetesManifestComponentConfigConnection(ctx context.Context, t *testing.T, componentID, appConfigID string) *app.ComponentConfigConnection
- func (s *Seeder) CreateOrg(ctx context.Context, t *testing.T) *app.Org
- func (s *Seeder) CreateRunnerJob(ctx context.Context, t *testing.T, ownerID, ownerType string) *app.RunnerJob
- func (s *Seeder) CreateTerraformComponentConfigConnection(ctx context.Context, t *testing.T, componentID, appConfigID string) *app.ComponentConfigConnection
- func (s *Seeder) CreateWorkflow(ctx context.Context, t *testing.T, installID string, ...) *app.Workflow
- func (s *Seeder) CreateWorkflowStep(ctx context.Context, t *testing.T, workflowID string, ...) *app.WorkflowStep
- func (s *Seeder) CreateWorkflowStepApproval(ctx context.Context, t *testing.T, stepID string, ...) *app.WorkflowStepApproval
- func (s *Seeder) EnsureAccount(ctx context.Context, t *testing.T) (context.Context, *app.Account)
- func (s *Seeder) EnsureOrg(ctx context.Context, t *testing.T) (context.Context, *app.Org)
- type WorkflowStepOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildAccount ¶
BuildAccount creates an app.Account with fake defaults.
func BuildAppConfig ¶ added in v0.19.807
BuildAppConfig creates an app.AppConfig with fake defaults for the given app.
func BuildCompletedUserJourney ¶ added in v0.19.800
func BuildCompletedUserJourney() app.UserJourney
BuildCompletedUserJourney creates an app.UserJourney with the default onboarding steps, all marked complete. Override fields directly when you need custom values.
func BuildComponent ¶ added in v0.19.807
BuildComponent creates an app.Component with fake defaults for the given app.
func BuildInstall ¶
BuildInstall creates an app.Install with fake defaults for the given app. The returned install is in-memory only and does not set config FK fields (those require DB queries — use CreateInstall for a fully-populated install).
func BuildUserJourney ¶ added in v0.19.800
func BuildUserJourney() app.UserJourney
BuildUserJourney creates an app.UserJourney with the default onboarding steps, all marked incomplete. Override fields directly when you need custom values.
Types ¶
type Seeder ¶
type Seeder struct {
// contains filtered or unexported fields
}
func (*Seeder) CreateAccount ¶
CreateAccount builds and persists an account to the database.
func (*Seeder) CreateActionWorkflow ¶ added in v0.19.807
func (s *Seeder) CreateActionWorkflow(ctx context.Context, t *testing.T, appID string) *app.ActionWorkflow
CreateActionWorkflow persists an ActionWorkflow definition scoped to the given app.
func (*Seeder) CreateActionWorkflowConfig ¶ added in v0.19.807
func (s *Seeder) CreateActionWorkflowConfig(ctx context.Context, t *testing.T, appID, appConfigID, actionWorkflowID string) *app.ActionWorkflowConfig
CreateActionWorkflowConfig persists an ActionWorkflowConfig with one manual trigger and one step. Three sequential creates are required: ActionWorkflowConfig -> ActionWorkflowTriggerConfig -> ActionWorkflowStepConfig.
func (*Seeder) CreateApp ¶
CreateApp builds and persists an app to the database. Uses org/account from context if available.
func (*Seeder) CreateAppBreakGlassConfig ¶ added in v0.19.807
func (s *Seeder) CreateAppBreakGlassConfig(ctx context.Context, t *testing.T, appID, appConfigID string) *app.AppBreakGlassConfig
CreateAppBreakGlassConfig persists an empty AppBreakGlassConfig.
func (*Seeder) CreateAppConfig ¶ added in v0.19.807
CreateAppConfig creates a fully-populated AppConfig mirroring what a real CLI sync produces: all required configs, all optional configs, one component of each type, and one action workflow.
func (*Seeder) CreateAppInputConfig ¶ added in v0.19.807
func (s *Seeder) CreateAppInputConfig(ctx context.Context, t *testing.T, appID, appConfigID string) *app.AppInputConfig
CreateAppInputConfig persists an AppInputConfig with one AppInputGroup and one AppInput. Three sequential creates are required due to the FK chain: AppInputConfig -> AppInputGroup -> AppInput.
func (*Seeder) CreateAppPermissionsConfig ¶ added in v0.19.807
func (s *Seeder) CreateAppPermissionsConfig(ctx context.Context, t *testing.T, appID, appConfigID string) *app.AppPermissionsConfig
CreateAppPermissionsConfig persists an empty AppPermissionsConfig.
func (*Seeder) CreateAppPoliciesConfig ¶ added in v0.19.807
func (s *Seeder) CreateAppPoliciesConfig(ctx context.Context, t *testing.T, appID, appConfigID string) *app.AppPoliciesConfig
CreateAppPoliciesConfig persists an empty AppPoliciesConfig.
func (*Seeder) CreateAppRunnerConfig ¶ added in v0.19.807
func (s *Seeder) CreateAppRunnerConfig(ctx context.Context, t *testing.T, appID, appConfigID string) *app.AppRunnerConfig
CreateAppRunnerConfig persists an AppRunnerConfig with type aws.
func (*Seeder) CreateAppSandboxConfig ¶ added in v0.19.807
func (s *Seeder) CreateAppSandboxConfig(ctx context.Context, t *testing.T, appID, appConfigID string) *app.AppSandboxConfig
CreateAppSandboxConfig persists an AppSandboxConfig with a nested PublicGitVCSConfig.
func (*Seeder) CreateAppSecretsConfig ¶ added in v0.19.807
func (s *Seeder) CreateAppSecretsConfig(ctx context.Context, t *testing.T, appID, appConfigID string) *app.AppSecretsConfig
CreateAppSecretsConfig persists an empty AppSecretsConfig.
func (*Seeder) CreateAppStackConfig ¶ added in v0.19.807
func (s *Seeder) CreateAppStackConfig(ctx context.Context, t *testing.T, appID, appConfigID string) *app.AppStackConfig
CreateAppStackConfig persists an AppStackConfig of type aws-cloudformation.
func (*Seeder) CreateBareAppConfig ¶ added in v0.19.807
func (s *Seeder) CreateBareAppConfig(ctx context.Context, t *testing.T, appID string) *app.AppConfig
CreateBareAppConfig persists a minimal AppConfig shell for the given app to the database. OrgID and CreatedByID are populated by the BeforeCreate hook from context. Use CreateAppConfig for a fully-populated config.
func (*Seeder) CreateComponent ¶ added in v0.19.807
func (s *Seeder) CreateComponent(ctx context.Context, t *testing.T, appID string, componentType app.ComponentType) *app.Component
CreateComponent persists a Component for the given app to the database. OrgID and CreatedByID are populated by the BeforeCreate hook from context. Pass a componentType to set the type column (in production this is done by create-config handlers).
func (*Seeder) CreateComponentBuild ¶ added in v0.19.807
func (s *Seeder) CreateComponentBuild(ctx context.Context, t *testing.T, configConnectionID string) *app.ComponentBuild
CreateComponentBuild persists a ComponentBuild linked to the given ComponentConfigConnection.
func (*Seeder) CreateDockerBuildComponentConfigConnection ¶ added in v0.19.807
func (s *Seeder) CreateDockerBuildComponentConfigConnection(ctx context.Context, t *testing.T, componentID, appConfigID string) *app.ComponentConfigConnection
CreateDockerBuildComponentConfigConnection persists a ComponentConfigConnection with a DockerBuildComponentConfig.
func (*Seeder) CreateExternalImageComponentConfigConnection ¶ added in v0.19.807
func (s *Seeder) CreateExternalImageComponentConfigConnection(ctx context.Context, t *testing.T, componentID, appConfigID string) *app.ComponentConfigConnection
CreateExternalImageComponentConfigConnection persists a ComponentConfigConnection with an ExternalImageComponentConfig.
func (*Seeder) CreateHelmComponentConfigConnection ¶ added in v0.19.807
func (s *Seeder) CreateHelmComponentConfigConnection(ctx context.Context, t *testing.T, componentID, appConfigID string) *app.ComponentConfigConnection
CreateHelmComponentConfigConnection persists a ComponentConfigConnection with a HelmComponentConfig.
func (*Seeder) CreateInstall ¶
CreateInstall builds and persists an install to the database for the given app. Requires that CreateAppConfig has already been called for the app — it queries for the latest AppSandboxConfig, AppRunnerConfig, and AppConfig to set FK fields. Creates associated AWSAccount, InstallSandbox, and InstallStack inline. Uses org/account from context if available.
func (*Seeder) CreateInstallComponent ¶ added in v0.19.807
func (s *Seeder) CreateInstallComponent(ctx context.Context, t *testing.T, installID, componentID string) *app.InstallComponent
CreateInstallComponent persists an InstallComponent linking an install to a component. OrgID and CreatedByID are populated by the BeforeCreate hook from context.
func (*Seeder) CreateInstallDeploy ¶ added in v0.19.807
func (s *Seeder) CreateInstallDeploy(ctx context.Context, t *testing.T, installComponentID, componentBuildID string) *app.InstallDeploy
CreateInstallDeploy persists an InstallDeploy linked to an InstallComponent and ComponentBuild.
func (*Seeder) CreateInstallInputs ¶ added in v0.19.807
func (s *Seeder) CreateInstallInputs(ctx context.Context, t *testing.T, installID, appInputConfigID string, values map[string]*string) *app.InstallInputs
CreateInstallInputs persists an InstallInputs record for the given install.
func (*Seeder) CreateInstallStackVersion ¶ added in v0.19.807
func (s *Seeder) CreateInstallStackVersion(ctx context.Context, t *testing.T, installID, installStackID, appConfigID string) *app.InstallStackVersion
CreateInstallStackVersion persists an InstallStackVersion with a generated PhoneHomeID.
func (*Seeder) CreateJobComponentConfigConnection ¶ added in v0.19.807
func (s *Seeder) CreateJobComponentConfigConnection(ctx context.Context, t *testing.T, componentID, appConfigID string) *app.ComponentConfigConnection
CreateJobComponentConfigConnection persists a ComponentConfigConnection with a JobComponentConfig.
func (*Seeder) CreateKubernetesManifestComponentConfigConnection ¶ added in v0.19.807
func (s *Seeder) CreateKubernetesManifestComponentConfigConnection(ctx context.Context, t *testing.T, componentID, appConfigID string) *app.ComponentConfigConnection
CreateKubernetesManifestComponentConfigConnection persists a ComponentConfigConnection with a KubernetesManifestComponentConfig.
func (*Seeder) CreateOrg ¶
CreateOrg builds and persists an org to the database. Uses account from context if available for CreatedByID.
func (*Seeder) CreateRunnerJob ¶ added in v0.19.807
func (s *Seeder) CreateRunnerJob(ctx context.Context, t *testing.T, ownerID, ownerType string) *app.RunnerJob
CreateRunnerJob persists a RunnerJob with the given polymorphic owner. Creates a LogStream, RunnerGroup, and Runner inline to satisfy FK constraints.
func (*Seeder) CreateTerraformComponentConfigConnection ¶ added in v0.19.807
func (s *Seeder) CreateTerraformComponentConfigConnection(ctx context.Context, t *testing.T, componentID, appConfigID string) *app.ComponentConfigConnection
CreateTerraformComponentConfigConnection persists a ComponentConfigConnection with a TerraformModuleComponentConfig.
func (*Seeder) CreateWorkflow ¶ added in v0.19.807
func (s *Seeder) CreateWorkflow(ctx context.Context, t *testing.T, installID string, workflowType app.WorkflowType) *app.Workflow
CreateWorkflow persists a Workflow owned by the given install.
func (*Seeder) CreateWorkflowStep ¶ added in v0.19.807
func (s *Seeder) CreateWorkflowStep(ctx context.Context, t *testing.T, workflowID string, opts ...WorkflowStepOption) *app.WorkflowStep
CreateWorkflowStep persists a WorkflowStep for the given workflow.
func (*Seeder) CreateWorkflowStepApproval ¶ added in v0.19.807
func (s *Seeder) CreateWorkflowStepApproval(ctx context.Context, t *testing.T, stepID string, approvalType app.WorkflowStepApprovalType, contents string) *app.WorkflowStepApproval
CreateWorkflowStepApproval persists a WorkflowStepApproval for the given step.
func (*Seeder) EnsureAccount ¶
EnsureAccount creates a test account and sets its ID in the context via cctx.SetAccountIDContext.
type WorkflowStepOption ¶ added in v0.19.807
type WorkflowStepOption func(*app.WorkflowStep)
WorkflowStepOption allows overriding defaults when creating a WorkflowStep.
func WithStepRetryable ¶ added in v0.19.807
func WithStepRetryable(retryable bool) WorkflowStepOption
func WithStepSignal ¶ added in v0.19.807
func WithStepSignal(signal *app.Signal) WorkflowStepOption
func WithStepSkippable ¶ added in v0.19.807
func WithStepSkippable(skippable bool) WorkflowStepOption
func WithStepStatus ¶ added in v0.19.807
func WithStepStatus(status app.CompositeStatus) WorkflowStepOption