cht

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package cht implements ClickHouse testing utilities, primarily end to end.

Package cht implements running ClickHouse for tests.

Index

Constants

View Source
const EnvBin = "CH_BIN"

EnvBin is environmental variable that sets paths to current ClickHouse binary.

Variables

This section is empty.

Functions

func Bin

func Bin() (string, error)

Bin returns path to current ClickHouse binary.

Types

type Config

type Config struct {
	XMLName xml.Name `xml:"clickhouse"`
	Logger  Logger   `xml:"logger"`
	HTTP    int      `xml:"http_port"`
	TCP     int      `xml:"tcp_port"`
	Host    string   `xml:"host"`

	Path            string  `xml:"path"`
	TempPath        string  `xml:"tmp_path"`
	UserFilesPath   string  `xml:"user_files_path"`
	UserDirectories UserDir `xml:"user_directories"`

	MarkCacheSize int64 `xml:"mark_cache_size"`
	MMAPCacheSize int64 `xml:"mmap_cache_size"`
}

Config for ClickHouse.

type Logger

type Logger struct {
	Level   string `xml:"level"`
	Console int    `xml:"console,omitempty"`
}

Logger settings.

type Server

type Server struct {
	TCP  string
	HTTP string
}

Server represents testing ClickHouse server.

func New

func New(t testing.TB) Server

New creates new ClickHouse server and returns it.

Skip tests if CH_E2E variable is set to 0. Fails if CH_E2E is 1, but no binary is available. Skips if CH_E2E is unset and no binary.

Override binary with CH_BIN. Can be clickhouse-server or clickhouse.

type UserDir

type UserDir struct {
	UsersXML UsersXML `xml:"users_xml"`
}

UserDir for ClickHouse.

type UsersXML

type UsersXML struct {
	Path string `xml:"path"`
}

UsersXML config for ClickHouse.

Jump to

Keyboard shortcuts

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