testutils

package
v0.0.0-...-e5ee784 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const TEST_DSN = "postgres://postgres:xmtp@localhost:25432/postgres?sslmode=disable"

Variables

This section is empty.

Functions

func CreateEmptyTestDb

func CreateEmptyTestDb(t *testing.T) *sql.DB

func CreateTestDb

func CreateTestDb(t *testing.T) *sql.DB

func GetSendRequests

func GetSendRequests(m *mocks.Delivery) []interfaces.SendRequest

GetSendRequests extracts all SendRequest arguments from a mock Delivery's Send calls.

func MockDeliveryAcceptAll

func MockDeliveryAcceptAll(t *testing.T) *mocks.Delivery

MockDeliveryAcceptAll creates a mock Delivery that accepts and succeeds on all sends.

func MockDeliveryWithSendCounter

func MockDeliveryWithSendCounter(t *testing.T) (*mocks.Delivery, *atomic.Int32)

MockDeliveryWithSendCounter creates a mock Delivery that accepts all sends, increments the counter on each Send call, and returns nil.

func MustParseTopic

func MustParseTopic(t *testing.T, topicStr string) *topicpkg.Topic

MustParseTopic parses a V3 topic string or fails the test.

func MustParseTopicBytes

func MustParseTopicBytes(t *testing.T, topicStr string) []byte

MustParseTopicBytes parses a V3 topic string and returns raw bytes, or fails.

func RequireEventuallySendCount

func RequireEventuallySendCount(t *testing.T, counter *atomic.Int32, want int32)

RequireEventuallySendCount asserts that the counter reaches want within 1 second.

func RequireSendRequestForInstallation

func RequireSendRequestForInstallation(t *testing.T, reqs []interfaces.SendRequest, installationID string) interfaces.SendRequest

RequireSendRequestForInstallation finds the SendRequest for a given installation ID or fails.

func TestLogger

func TestLogger(t *testing.T) *zap.Logger

TestLogger returns a zap.Logger bound to the test lifecycle. Output is captured by testing.T and only shown on failure.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL