Documentation
¶
Index ¶
- func TestRun(ctx context.Context, t *testing.T, factory FuncEFactory)
- func TestRun_CtrlCs(ctx context.Context, t *testing.T, factory FuncEFactory)
- func TestRun_InvalidConfig(ctx context.Context, t *testing.T, factory FuncEFactory)
- func TestRun_RunDirectory(ctx context.Context, t *testing.T, factory FuncEFactory)
- func TestRun_StaticFile(ctx context.Context, t *testing.T, factory FuncEFactory)
- type AdminClient
- type FuncE
- type FuncEFactory
- type RunTestFunc
- type RunTestOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestRun ¶
func TestRun(ctx context.Context, t *testing.T, factory FuncEFactory)
TestRun tests the basic "func-e run" command with a minimal configuration.
func TestRun_CtrlCs ¶
func TestRun_CtrlCs(ctx context.Context, t *testing.T, factory FuncEFactory)
TestRun_CtrlCs tests the "Ctrl+C twice" behavior where multiple interrupts are handled gracefully without causing issues.
func TestRun_InvalidConfig ¶
func TestRun_InvalidConfig(ctx context.Context, t *testing.T, factory FuncEFactory)
TestRun_InvalidConfig tests "func-e run" with an invalid configuration.
func TestRun_RunDirectory ¶
func TestRun_RunDirectory(ctx context.Context, t *testing.T, factory FuncEFactory)
TestRun_RunDirectory tests that the run directory is properly created with expected files.
func TestRun_StaticFile ¶
func TestRun_StaticFile(ctx context.Context, t *testing.T, factory FuncEFactory)
TestRun_StaticFile tests "func-e run" runs envoy in the right directory, and can read files in it.
Types ¶
type AdminClient ¶
type AdminClient struct {
// contains filtered or unexported fields
}
AdminClient represents a client for Envoy's Admin API. See: https://github.com/envoyproxy/envoy/blob/main/source/server/admin/admin.cc
func (*AdminClient) GetListenerBaseURL ¶
GetListenerBaseURL returns the base URL for a specific listener by name. See: https://github.com/envoyproxy/envoy/blob/main/source/server/admin/admin.cc#L75
func (*AdminClient) IsReady ¶
func (c *AdminClient) IsReady(ctx context.Context) bool
IsReady checks if Envoy is ready to serve traffic by calling the /ready endpoint. See: https://github.com/envoyproxy/envoy/blob/main/source/server/admin/admin.cc#L65
type FuncE ¶
type FuncE interface { // Run starts func-e with the given arguments and block until completion // The implementation should stop func-e if the context is canceled. // The returned error might be a process exit or context cancellation. Run(ctx context.Context, args []string) error // Interrupt signals the running func-e process to terminate gracefully Interrupt(context.Context) error // OnStart is called when Envoy starts (after "starting main dispatch loop" is detected) OnStart(ctx context.Context) (runDir string, envoyPid int32, err error) }
FuncE abstracts func-e, so that the same tests can run for library calls and a compiled func-e binary.
type FuncEFactory ¶
type RunTestFunc ¶
type RunTestFunc func(ctx context.Context, runDir string, envoyPid int32, interruptFuncE func(context.Context) error, adminClient *AdminClient)
RunTestFunc is a test function called once Envoy is started.
type RunTestOptions ¶
type RunTestOptions struct { ExpectFail bool TestFunc RunTestFunc Args []string }