testutil

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package testutil provides test helper utilities for unit and integration tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMiniredis

func NewMiniredis(t *testing.T) *miniredis.Miniredis

NewMiniredis creates an in-memory Redis server for unit tests. The server is automatically cleaned up when the test completes.

func NewMiniredisClient

func NewMiniredisClient(t *testing.T) (*redis.Client, *miniredis.Miniredis)

NewMiniredisClient creates a Redis client connected to an in-memory miniredis server. Both the server and client are automatically cleaned up when the test completes.

func NewRedisContainer

func NewRedisContainer(t *testing.T) (*redis.Client, string)

NewRedisContainer creates a real Redis container for integration tests. The container is automatically cleaned up when the test completes.

Types

type ClickHouseConnection

type ClickHouseConnection struct {
	Host     string
	Port     int
	Database string
	Username string
	Password string //nolint:gosec // G117: test config, not a real secret
}

ClickHouseConnection holds ClickHouse connection details.

func NewClickHouseContainer

func NewClickHouseContainer(t *testing.T) ClickHouseConnection

NewClickHouseContainer creates a real ClickHouse container for integration tests. The container is automatically cleaned up when the test completes.

func (ClickHouseConnection) Addr

func (c ClickHouseConnection) Addr() string

Addr returns the ClickHouse address in host:port format.

Jump to

Keyboard shortcuts

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