Documentation
¶
Overview ¶
Package support contains the BDD world / step definitions for agentsync.
Hermeticity contract:
- Every Scenario runs against a fresh tmpdir.
- HOME and AGENTSYNC_TARGET_ROOT both point at that tmpdir.
- No real $HOME path is ever read or written.
- The agentsync binary is the System Under Test; the suite shells out to it instead of importing internal packages, so we exercise the same entrypoint the engineer ships.
Index ¶
- func BuildBinary(t *testing.T) string
- func RegisterSteps(sc *godog.ScenarioContext, w *World)
- type World
- func (w *World) AppendFile(rel, content string) error
- func (w *World) Cleanup()
- func (w *World) Env() []string
- func (w *World) MustRun(args ...string) string
- func (w *World) ReadFile(rel string) (string, error)
- func (w *World) Reset(t *testing.T, bin string) error
- func (w *World) Resolve(rel string) string
- func (w *World) Run(args ...string) (string, error)
- func (w *World) WriteFile(rel, content string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildBinary ¶
BuildBinary compiles the agentsync binary once per test process and returns its absolute path. The binary lives in a stable temp dir so subsequent scenarios don't pay the build cost.
func RegisterSteps ¶
func RegisterSteps(sc *godog.ScenarioContext, w *World)
RegisterSteps wires every Gherkin phrase used by the .feature files to a concrete Go implementation.
Types ¶
type World ¶
type World struct {
Bin string
Home string
WorkDir string
ExtraEnv map[string]string
LastOut string
LastErr error
LastCode int
StartedAt time.Time
// contains filtered or unexported fields
}
World is the per-scenario state.
func (*World) AppendFile ¶
AppendFile appends content to a path inside Home.
func (*World) Env ¶
Env returns the env slice passed to every binary invocation. It does NOT inherit the host $HOME or XDG vars; AGENTSYNC_TARGET_ROOT is the redirect guarantee documented in the design spec.
func (*World) Resolve ¶
Resolve turns a path into an absolute path under Home if it is not already absolute. This keeps every scenario rooted in its tmpdir without surprises.