drivertest

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package drivertest provides a conformance test suite for tenantstore drivers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunConformanceTests

func RunConformanceTests(t *testing.T, newHarness HarnessMaker)

RunConformanceTests executes the core conformance test suite for a tenantstore driver. The suite is organized into four parts:

  • CRUD: tenant and destination create/read/update/delete
  • List: destination listing and filtering operations
  • Match: event matching operations
  • Misc: max destinations, deployment isolation

func RunListTenantTests

func RunListTenantTests(t *testing.T, newHarness HarnessMaker)

RunListTenantTests executes the ListTenant test suite, which requires RediSearch. Run this only on backends that support RediSearch (Redis Stack, Dragonfly Stack). The suite covers:

  • Enrichment: tenant list includes destinations count and topics
  • ExcludesDeleted: deleted tenants are excluded from results
  • InputValidation: limit, order direction, cursor validation
  • KeysetPagination: cursor-based pagination edge cases
  • PaginationSuite: comprehensive forward/backward/round-trip pagination

Types

type Harness

type Harness interface {
	// MakeDriver creates a driver with default settings.
	MakeDriver(ctx context.Context) (driver.TenantStore, error)
	// MakeDriverWithMaxDest creates a driver with a specific max destinations limit.
	MakeDriverWithMaxDest(ctx context.Context, maxDest int) (driver.TenantStore, error)
	// MakeIsolatedDrivers creates two drivers that share the same backend
	// but are isolated from each other (e.g., different deployment IDs).
	MakeIsolatedDrivers(ctx context.Context) (store1, store2 driver.TenantStore, err error)
	Close()
}

Harness provides the test infrastructure for a tenantstore driver implementation.

type HarnessMaker

type HarnessMaker func(ctx context.Context, t *testing.T) (Harness, error)

HarnessMaker creates a new Harness for each test.

Jump to

Keyboard shortcuts

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