Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLIRunnerFunc ¶ added in v0.33.0
CLIRunnerFunc is the signature for running a fullsend CLI command. The default implementation is e2etest.TryRunCLI. Inject a custom function in tests to avoid shelling out.
type Driver ¶
type Driver interface {
Install(ctx context.Context, org string) (State, error)
Teardown(ctx context.Context, org string, state State) error
}
Driver provisions and tears down fullsend in an acquired pool org. Driver is used only during suite setup (single-threaded) and is not shared across concurrent scenarios.
type RepoEnsurer ¶ added in v0.33.0
type RepoEnsurer interface {
// EnsureRepo guarantees org/repoName exists and has fullsend installed.
// If the repo does not exist it is created (the forge's auto_init
// provides the initial commit). If fullsend is not installed (per
// post-install validation) it runs the per-repo install flow
// (inference provision + github setup).
EnsureRepo(ctx context.Context, org, repoName string) (State, error)
}
RepoEnsurer lazily creates and installs repos on demand for behaviour scenarios. Results are cached by org/repo key so that a second scenario leasing the same name within a suite run skips redundant work.
Thread safety: EnsureRepo is safe for concurrent callers. A singleflight.Group serializes in-flight ensures per key so that concurrent first-calls for the same repo only perform create+install once; other callers wait and share the result.
func NewRepoEnsurer ¶ added in v0.33.0
func NewRepoEnsurer( e2eCfg e2etest.EnvConfig, client forge.Client, token, binary string, logf func(string, ...any), ) RepoEnsurer
NewRepoEnsurer returns a RepoEnsurer backed by the given forge client and CLI binary. The ensurer shares the same credentials and configuration as the per-repo install driver.
type SettleFunc ¶ added in v0.33.0
type SettleFunc func(ctx context.Context, client forge.Client, org, repo, workflowFile string, logf func(string, ...any)) error
SettleFunc is called after a repo is freshly created or installed to wait until GitHub Actions recognises the workflow file. The default implementation polls GetWorkflow; tests inject a no-op.
type State ¶
type State interface {
Mode() string
TestRepo() string
// ConfigOwner and ConfigRepo locate commits for behaviour scripts and config reads.
ConfigOwner() string
ConfigRepo() string
// ConfigPathPrefix is "" for per-org (.fullsend repo root) or ".fullsend" for per-repo.
ConfigPathPrefix() string
// TriageWorkflowRepo is the repository polled for triage workflow runs.
TriageWorkflowRepo() string
// TriageWorkflowFile is the workflow path passed to ListWorkflowRuns.
TriageWorkflowFile() string
// AgentWorkflowFile is the reusable workflow that runs the agent and uploads artifacts.
AgentWorkflowFile() string
// AgentArtifactName is the upload-artifact name for triage agent output.
AgentArtifactName() string
}
State describes where behaviour tests find fullsend configuration after install.
Concurrency: the perRepoState implementation is a read-only snapshot whose fields (org, repo) are set at construction and never modified. All accessor methods return derived constants. Sharing a single State across goroutines via World.Clone is safe by design for GODOG_CONCURRENCY>1. TestConcurrentStateAccess in this package exercises concurrent reads under -race.
If a future implementation adds mutable state, it must synchronize access or be deep-copied per scenario in World.Clone.