Documentation
¶
Overview ¶
Package utils provides utilities supporting the smoke tests.
Package utils contains higher-level (e.g., integration) tests.
Index ¶
- func ContainerExternalHost(ctx context.Context, container testcontainers.Container, port string) (*url.URL, error)
- func ContainerWaitForLog(ctx context.Context, input *WaitForLogInput) error
- func WaitForCondition(ctx context.Context, timeout time.Duration, poll time.Duration, ...) error
- type LogCapture
- type MockRoundTripper
- type WaitForLogInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerExternalHost ¶
func ContainerExternalHost(ctx context.Context, container testcontainers.Container, port string) (*url.URL, error)
ContainerExternalHost gets the external host of for a specific container based on what port testcontainers forwarded to on the host machine.
This is only needed for external communications between application and the container. This is NOT needed for container to container interactions on the same network
func ContainerWaitForLog ¶
func ContainerWaitForLog(ctx context.Context, input *WaitForLogInput) error
ContainerWaitForLog polls the logs of the container to see if a `log` message exists. If the timeout is exceeded, an error returns.
Types ¶
type LogCapture ¶
type LogCapture struct {
Lines []string
// contains filtered or unexported fields
}
func NewLogCapture ¶
func NewLogCapture(logger *logrus.Logger) *LogCapture
NewLogCapture sets up plain text logging to be captured for testing purposes
func NewLogCaptureWithCurrentFormatter ¶
func NewLogCaptureWithCurrentFormatter(logger *logrus.Logger) *LogCapture
NewLogCaptureWithCurrentFormatter sets up capture with current formatter
type MockRoundTripper ¶
func NewHTTPMock ¶
func NewHTTPMock() *MockRoundTripper
func (*MockRoundTripper) Expect ¶
func (m *MockRoundTripper) Expect(method string, body string, status int, err error)
func (*MockRoundTripper) HTTPClient ¶
func (m *MockRoundTripper) HTTPClient() *http.Client