test

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLocalAuthority added in v1.15.6

func GetLocalAuthority() (string, error)

func JsonBytesEqual

func JsonBytesEqual(t *testing.T, expected, actual []byte, msgAndArgs ...interface{})

func ObjectsEqual

func ObjectsEqual(t *testing.T, expected, actual interface{}, msgAndArgs ...interface{})

func RenewGet

func RenewGet(url string) (*http.Response, error)

Types

type ClickHouseContainer added in v1.15.6

type ClickHouseContainer struct {
	Container testcontainers.Container
	Context   context.Context

	Port     int
	Dsns     []string
	Database string
}

func NewClickhouseContainer added in v1.15.6

func NewClickhouseContainer(ctx context.Context) (*ClickHouseContainer, error)

Creates new Clickhouse test container if CH_TEST_PORT is not defined. Otherwise uses db at defined port. This logic is required for running test at CI environment

func (*ClickHouseContainer) Close added in v1.15.6

func (ch *ClickHouseContainer) Close()

func (*ClickHouseContainer) CountRows added in v1.15.6

func (ch *ClickHouseContainer) CountRows(table string) (int, error)

type IntegrationTest added in v1.15.6

type IntegrationTest struct {
	Name             string
	ReqUrn           string
	ReqOrigin        string
	ReqBodyPath      string
	ExpectedJsonPath string
	XAuthToken       string

	ExpectedHttpCode int
	ExpectedErrMsg   string
}

type PostgresContainer added in v1.15.6

type PostgresContainer struct {
	Container testcontainers.Container
	Context   context.Context
	Host      string
	Port      int
	Database  string
	Schema    string
	Username  string
	Password  string
}

func NewPostgresContainer added in v1.15.6

func NewPostgresContainer(ctx context.Context) (*PostgresContainer, error)

Creates new Postgres test container if PG_TEST_PORT is not defined. Otherwise uses db at defined port. This logic is required for running test at CI environment

func (*PostgresContainer) Close added in v1.15.6

func (pgc *PostgresContainer) Close()

func (*PostgresContainer) CountRows added in v1.15.6

func (pgc *PostgresContainer) CountRows(table string) (int, error)

Jump to

Keyboard shortcuts

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