package tests

import "github.com/ClickHouse/clickhouse-go/v2/tests"

Index

Functions

func CheckMinServerServerVersion

func CheckMinServerServerVersion(conn driver.Conn, major, minor, patch uint64) bool

func CreateDatabase

func CreateDatabase(testSet string) error

func GetClickHouseTestVersion

func GetClickHouseTestVersion() string

func GetConnection

func GetConnection(testSet string, settings clickhouse.Settings, tlsConfig *tls.Config, compression *clickhouse.Compression) (driver.Conn, error)

func GetConnectionWithOptions

func GetConnectionWithOptions(options *clickhouse.Options) (driver.Conn, error)

func GetEnv

func GetEnv(key, fallback string) string

func IsSetInEnv

func IsSetInEnv(key string) bool

func PrintMemUsage

func PrintMemUsage()

PrintMemUsage outputs the current, total and OS memory being used. As well as the number of garage collection cycles completed. thanks to https://golangcode.com/print-the-current-memory-usage/

func RandAsciiString

func RandAsciiString(n int) string

func RandIPv4

func RandIPv4() net.IP

func RandIPv6

func RandIPv6() net.IP

func RandIntString

func RandIntString(n int) string

func SetTestEnvironment

func SetTestEnvironment(testSet string, environment ClickHouseTestEnvironment)

Types

type ClickHouseTestEnvironment

type ClickHouseTestEnvironment struct {
	Port        int
	HttpPort    int
	SslPort     int
	HttpsPort   int
	Host        string
	Username    string
	Password    string
	Database    string
	Version     proto.Version
	ContainerIP string
	Container   testcontainers.Container `json:"-"`
}

func CreateClickHouseTestEnvironment

func CreateClickHouseTestEnvironment(testSet string) (ClickHouseTestEnvironment, error)

func GetExternalTestEnvironment

func GetExternalTestEnvironment(testSet string) (ClickHouseTestEnvironment, error)

func GetTestEnvironment

func GetTestEnvironment(testSet string) (ClickHouseTestEnvironment, error)

type NginxReverseHTTPProxyTestEnvironment

type NginxReverseHTTPProxyTestEnvironment struct {
	HttpPort       int
	NginxContainer testcontainers.Container `json:"-"`
}

func CreateNginxReverseProxyTestEnvironment

func CreateNginxReverseProxyTestEnvironment(clickhouseEnv ClickHouseTestEnvironment) (NginxReverseHTTPProxyTestEnvironment, error)

type TinyProxyTestEnvironment

type TinyProxyTestEnvironment struct {
	HttpPort  int
	Container testcontainers.Container `json:"-"`
}

func CreateTinyProxyTestEnvironment

func CreateTinyProxyTestEnvironment(t *testing.T) (TinyProxyTestEnvironment, error)

func (TinyProxyTestEnvironment) ProxyUrl

func (e TinyProxyTestEnvironment) ProxyUrl(t *testing.T) string

Source Files

utils.go

Directories

PathSynopsis
tests/issues
tests/issues/209
tests/issues/360
tests/issues/470
tests/issues/476
tests/issues/484
tests/issues/485
tests/std
tests/stress
Version
v2.9.3
Published
May 12, 2023
Platform
js/wasm
Imports
25 packages
Last checked
2 seconds ago

Tools for package owners.