Documentation
¶
Index ¶
- func AssertCompletedTurnResult(t testing.TB, label string, result *codex.TurnResult)
- func AssertJSONContains(t testing.TB, label string, value any, want string)
- func AssertNoSecretLeak(t testing.TB, stderr *LockedBuffer, secrets ...string)
- func CollectTurnStream(ctx context.Context, stream *codex.TurnStream) (*codex.TurnResult, error)
- func IsExpectedTurnControlStateError(err error) bool
- func IsExpectedUnmaterializedArchiveError(err error) bool
- func IsExpectedUnmaterializedThreadError(err error) bool
- func LiveTurnOptions(t testing.TB) *codex.TurnOptions
- func RequireLoginParams(t testing.TB) (any, string)
- func StartThread(t testing.TB, client *codex.Codex, ctx context.Context, stderr *LockedBuffer, ...) *codex.Thread
- func WaitForKnownTurnID(ctx context.Context, handle *codex.TurnHandle) error
- type LockedBuffer
- type RealClientOptions
- type RequestRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertCompletedTurnResult ¶
func AssertCompletedTurnResult(t testing.TB, label string, result *codex.TurnResult)
AssertCompletedTurnResult checks the stable public effects of a completed turn.
func AssertJSONContains ¶
AssertJSONContains marshals value and checks that it contains want.
func AssertNoSecretLeak ¶
func AssertNoSecretLeak(t testing.TB, stderr *LockedBuffer, secrets ...string)
AssertNoSecretLeak fails if captured output contains any provided secret.
func CollectTurnStream ¶
func CollectTurnStream(ctx context.Context, stream *codex.TurnStream) (*codex.TurnResult, error)
CollectTurnStream consumes a turn stream and returns a public TurnResult.
func IsExpectedTurnControlStateError ¶
IsExpectedTurnControlStateError reports whether a control call raced turn completion.
func IsExpectedUnmaterializedArchiveError ¶
IsExpectedUnmaterializedArchiveError identifies expected empty archive state errors.
func IsExpectedUnmaterializedThreadError ¶
IsExpectedUnmaterializedThreadError identifies expected empty-thread state errors.
func LiveTurnOptions ¶
func LiveTurnOptions(t testing.TB) *codex.TurnOptions
LiveTurnOptions returns conservative defaults for credential-backed live turns.
func RequireLoginParams ¶
RequireLoginParams reads CODEX_E2E_LOGIN_PARAMS_JSON or skips the test.
func StartThread ¶
func StartThread(t testing.TB, client *codex.Codex, ctx context.Context, stderr *LockedBuffer, cwd string) *codex.Thread
StartThread starts a real Codex thread and fails the test if no id is returned.
func WaitForKnownTurnID ¶
func WaitForKnownTurnID(ctx context.Context, handle *codex.TurnHandle) error
WaitForKnownTurnID advances a handle until the SDK has observed a turn id.
Types ¶
type LockedBuffer ¶
type LockedBuffer struct {
// contains filtered or unexported fields
}
LockedBuffer is a concurrency-safe buffer for app-server stderr capture.
func NewRealClient ¶
func NewRealClient(t testing.TB, opts RealClientOptions) (*codex.Codex, context.Context, *LockedBuffer)
NewRealClient starts a real codex app-server with an isolated CODEX_HOME.
func (*LockedBuffer) String ¶
func (b *LockedBuffer) String() string
type RealClientOptions ¶
type RealClientOptions struct {
Timeout time.Duration
DisableAutoClose bool
Secrets []string
RequestRecorder *RequestRecorder
}
RealClientOptions configures a real codex app-server test client.
type RequestRecorder ¶ added in v0.145.0
type RequestRecorder struct {
// contains filtered or unexported fields
}
RequestRecorder captures outbound JSON-RPC requests without changing them.
func (*RequestRecorder) Request ¶ added in v0.145.0
func (r *RequestRecorder) Request(method string) (rpc.JSONRPCRequest, bool)
Request returns the first captured request with method.