e2e

package
v0.76.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package e2e implements end to end testing utilities.

Index

Constants

View Source
const (
	EnvHost     = "CH_HOST"     // host:port of the native protocol endpoint
	EnvUser     = "CH_USER"     // defaults to "default"
	EnvPassword = "CH_PASSWORD" // blank by default
	EnvTLS      = "CH_TLS"      // "true" to connect with TLS
)

Environment variables that select an already running ClickHouse server (for example, ClickHouse Cloud) instead of a local server started by cht.

View Source
const (
	RemoteDialTimeout = 20 * time.Second
	RemoteReadTimeout = 60 * time.Second
)

Timeouts for a remote server. They are larger than the client defaults because of network latency to the server.

View Source
const DatabasePrefix = "ch_go_test_"

DatabasePrefix is the name prefix of the databases that tests create on a remote server. Each test connection gets its own database.

View Source
const Env = "CH_E2E"

Env variable for E2E tests.

Variables

This section is empty.

Functions

func Database added in v0.76.0

func Database(tb testing.TB, exec Exec) string

Database creates a new database with a unique name through exec and drops it when the test ends. A test connection that uses this database sees only its own tables, as with a new local server.

Types

type Exec added in v0.76.0

type Exec func(ctx context.Context, query string) error

Exec runs a single query on a new connection to the remote server, using the default database.

type Remote added in v0.76.0

type Remote struct {
	Address  string
	User     string
	Password string
	TLS      *tls.Config
}

Remote describes an already running ClickHouse server.

func GetRemote added in v0.76.0

func GetRemote(tb testing.TB) (Remote, bool)

GetRemote returns the remote server from the environment. It reports false if EnvHost is not set.

type Status

type Status byte
const (
	NotSet   Status = iota // N/A
	Enabled                // explicitly enabled
	Disabled               // explicitly disabled
)

func Get

func Get(tb testing.TB) Status

Get reports current end-to-end status.

Jump to

Keyboard shortcuts

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