Documentation
¶
Index ¶
- Constants
- func CheckDockerAvailable() error
- func CheckPortsAvailable() error
- func RegisterCommonSteps(ctx *godog.ScenarioContext, state *TestState)
- func RegisterHealthSteps(ctx *godog.ScenarioContext, state *TestState)
- func RegisterWebBrokerSteps(ctx *godog.ScenarioContext, state *TestState)
- func RegisterWebSubSteps(ctx *godog.ScenarioContext, state *TestState)
- func RegisterWebhookSecretSteps(ctx *godog.ScenarioContext, state *TestState, ws *WebhookSecretSteps)
- type AuthUser
- type ComposeManager
- type Config
- type TestState
- type WebhookSecretSteps
Constants ¶
const ( // DefaultStartupTimeout is the maximum time to wait for all services to become healthy. DefaultStartupTimeout = 120 * time.Second // HealthCheckInterval is how often to poll service health endpoints. HealthCheckInterval = 2 * time.Second )
const ( // GatewayControllerPort is the management REST API port. GatewayControllerPort = "9090" // EventGatewayAdminPort is the admin/health port of the event-gateway runtime. EventGatewayAdminPort = "9002" // WebSubPort is the HTTP WebSub listener port. WebSubPort = "8080" // WebSocketPort is the WebSocket listener port. WebSocketPort = "8081" // WebhookListenerPort is the port of the wh-listener test service. WebhookListenerPort = "8090" // GatewayManagementAPIBasePath is the base path for the management REST API. GatewayManagementAPIBasePath = "/api/management/v1" )
Port constants for event gateway services.
Variables ¶
This section is empty.
Functions ¶
func CheckDockerAvailable ¶
func CheckDockerAvailable() error
CheckDockerAvailable verifies that Docker is running.
func CheckPortsAvailable ¶
func CheckPortsAvailable() error
CheckPortsAvailable verifies that the ports used by the test stack are free.
func RegisterCommonSteps ¶
func RegisterCommonSteps(ctx *godog.ScenarioContext, state *TestState)
RegisterCommonSteps registers generic HTTP assertion and utility steps.
func RegisterHealthSteps ¶
func RegisterHealthSteps(ctx *godog.ScenarioContext, state *TestState)
RegisterHealthSteps registers health / readiness step definitions.
func RegisterWebBrokerSteps ¶
func RegisterWebBrokerSteps(ctx *godog.ScenarioContext, state *TestState)
RegisterWebBrokerSteps registers all WebBroker API management and end-to-end step definitions.
func RegisterWebSubSteps ¶
func RegisterWebSubSteps(ctx *godog.ScenarioContext, state *TestState)
RegisterWebSubSteps registers all WebSub API management and end-to-end step definitions.
func RegisterWebhookSecretSteps ¶
func RegisterWebhookSecretSteps(ctx *godog.ScenarioContext, state *TestState, ws *WebhookSecretSteps)
RegisterWebhookSecretSteps registers all webhook secret management step definitions.
Types ¶
type ComposeManager ¶
type ComposeManager struct {
// contains filtered or unexported fields
}
ComposeManager manages the Docker Compose lifecycle for integration tests.
func NewComposeManager ¶
func NewComposeManager(composeFile string) (*ComposeManager, error)
NewComposeManager creates a new ComposeManager from the given docker-compose file path.
func (*ComposeManager) Cleanup ¶
func (cm *ComposeManager) Cleanup()
Cleanup stops and removes all Docker Compose services. Safe to call multiple times and from concurrent goroutines.
func (*ComposeManager) DumpLogs ¶
func (cm *ComposeManager) DumpLogs(outputFile string) error
DumpLogs writes docker compose logs to the given file.
func (*ComposeManager) Start ¶
func (cm *ComposeManager) Start() error
Start brings up all Docker Compose services and waits for them to be healthy.
func (*ComposeManager) WaitForHealthy ¶
func (cm *ComposeManager) WaitForHealthy(ctx context.Context) error
WaitForHealthy polls the health endpoints of each service until all pass.
type Config ¶
type Config struct {
GatewayControllerURL string
EventGatewayAdminURL string
WebSubURL string
WebSocketURL string
WebhookListenerURL string
KafkaBrokers []string
KafkaUsername string
KafkaPassword string
HTTPTimeout time.Duration
Users map[string]AuthUser
}
Config holds the addresses and settings used across all test scenarios.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default test configuration assuming services are mapped to localhost ports via docker-compose.dev.yaml.
type TestState ¶
type TestState struct {
Config *Config
HTTPClient *http.Client
// contains filtered or unexported fields
}
TestState is the global state shared across step definitions within a scenario.
func NewTestState ¶
NewTestState creates and returns an initialised TestState.
func (*TestState) LastResponse ¶
LastResponse returns the most recent HTTP response.
type WebhookSecretSteps ¶
type WebhookSecretSteps struct {
// contains filtered or unexported fields
}
WebhookSecretSteps holds per-scenario state for webhook secret step definitions.
func (*WebhookSecretSteps) Reset ¶
func (w *WebhookSecretSteps) Reset()
Reset clears per-scenario webhook secret state.