Documentation
¶
Index ¶
Constants ¶
const BehaviourScriptRepoPath = "behaviour/current-scenario.yaml"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RepoPool ¶ added in v0.33.0
type RepoPool struct {
// contains filtered or unexported fields
}
RepoPool is an in-process lease pool for logical test-repo names. Scenarios acquire a unique name for their duration and release it afterward, ensuring no two concurrent scenarios use the same repo.
func NewRepoPool ¶ added in v0.33.0
NewRepoPool creates a pool pre-filled with size names in the form "test-repo-01" … "test-repo-NN". Returns an error if size is not positive.
func (*RepoPool) Acquire ¶ added in v0.33.0
Acquire blocks until a repo name is available or ctx is cancelled.
type World ¶
type World struct {
Config env.RunnerConfig
SCM scm.Driver
CI ci.Driver
Install install.State
Org string
RepoFull string
RepoOwner string
RepoName string
Token string
Logf func(string, ...any)
// FixturesRoot is module-relative (e.g. "e2e/behaviour" or "behaviour").
FixturesRoot string
ScenarioStart time.Time
DummyOps []runtime.BehaviourOperation
ArtifactDir string
TriageTriggerEvent string // GitHub event for triage dispatch (issues for label path)
IssueNumber int
IssueTitle string
WorkflowRun *forge.WorkflowRun
TriageWorkflow string
DispatchAgent string
PRNumber int
// Fork context — set by fork step definitions.
ForkOwner string
ForkRepo string
ForkPRNumber int
ForkPRBranch string
// URL harness hosting repo — set by URL dispatch step definitions.
URLHarnessRepoOwner string
URLHarnessRepoName string
// LeasedRepoName is the logical test-repo name acquired from a RepoPool
// for this scenario's duration. Empty when no pool is configured.
LeasedRepoName string
// Ensurer lazily creates and installs repos on demand. Shared across
// scenarios (like other driver fields) and safe for concurrent use.
// Nil when lazy ensure is not configured.
Ensurer install.RepoEnsurer
// KillSwitchActivated records whether this scenario activated the
// repo-level kill switch. CleanupScenario uses this to deactivate
// the switch so the next scenario on this slot is not affected.
KillSwitchActivated bool
// Jira mock state — set by the "Given a mock Jira server" step.
JiraMockServer *httptest.Server
JiraMockState *jiramock.State
JiraConfigDir string // temp dir holding .fullsend/ layout for the poller
}
World holds scenario state and injected drivers.
func FromContext ¶ added in v0.33.0
FromContext extracts the per-scenario World stored by WithWorld. Returns nil if no World is present.
func (*World) BehaviourScriptPath ¶
BehaviourScriptPath returns the repo-relative path for the dummy agent script.
func (*World) Clone ¶ added in v0.33.0
Clone creates a shallow copy of w. Drivers and shared state (SCM, CI, Install as install.State) are shared by reference — this is safe because the production implementations are immutable wrappers:
- scm/github.Driver holds only a forge.Client (concurrent-safe).
- ci/githubactions.Driver holds a forge.Client and an immutable Token.
- install.perRepoState holds only immutable string fields.
Race tests in each driver package (TestConcurrentAccess, TestConcurrentStateAccess) verify the real types under -race with forge.FakeClient. See scm.Driver, ci.Driver, and install.State doc comments for the concurrency contract.
Scenario-level fields are copied verbatim; callers should call resetScenarioWorld (in package suite) to zero them for each new scenario.