Documentation
¶
Overview ¶
Package phasetest provides fake phase CLI binaries for testing phasekit integrations without network access.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeBinary ¶
type FakeBinary struct {
// Path is the absolute path to the fake phase binary.
Path string
// contains filtered or unexported fields
}
FakeBinary describes a fake phase binary installed on PATH for a test.
func WithFakeBinary ¶
func WithFakeBinary(t testing.TB, opts FakeOptions) *FakeBinary
WithFakeBinary writes a fake phase binary, prepends it to PATH, and returns an object that can read the recorded argv and environment after invocation.
type FakeOptions ¶
type FakeOptions struct {
// Secrets is marshaled to JSON and written to stdout when RawStdout is empty.
Secrets map[string]string
// RawStdout is written to stdout verbatim when non-empty.
RawStdout string
// Stderr is written to stderr verbatim.
Stderr string
// ExitCode is the process exit code. Defaults to 0.
ExitCode int
// Delay sleeps before emitting output. Useful for timeout tests.
Delay time.Duration
// RecordEnv names environment variables the fake binary should record.
RecordEnv []string
}
FakeOptions controls the behavior of WithFakeBinary.
Click to show internal directories.
Click to hide internal directories.