exasol_test_setup_abstraction_go

package module
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 19 Imported by: 2

Documentation

Index

Constants

View Source
const DEFAULT_EXASOL_VERSION = "8.32.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder added in v0.3.0

type Builder struct {
	// contains filtered or unexported fields
}

func New added in v0.3.0

func New() Builder

New creates a new builder that allows creating a new TestSetupAbstraction.

func (Builder) CloudSetupConfigFilePath added in v0.3.0

func (c Builder) CloudSetupConfigFilePath(path string) Builder

CloudSetupConfigFilePath sets the path to the cloud setup config file. Call this to use a cloud test setup e.g. in AWS. This will fall back to a local Docker container in case the file does not exist.

func (Builder) DockerDbVersion added in v0.3.0

func (c Builder) DockerDbVersion(dockerDbVersion string) Builder

DockerDbVersion sets the Exasol Docker DB version to start. This defaults to the version defined in exasol-test-setup-abstraction-java.

func (Builder) Start added in v0.3.0

func (c Builder) Start() (*TestSetupAbstraction, error)

Start launches the test setup using the given configuration. Don't forget to stop the setup after usage by calling TestSetupAbstraction.Stop().

func (Builder) StartupTimeout added in v0.3.4

func (c Builder) StartupTimeout(timeout time.Duration) Builder

StartupTimeout sets the timeout for starting the Exasol test setup. This defaults to 10 minutes.

type ConnectionInfo

type ConnectionInfo struct {
	Host     string `json:"host"`     // Host name
	Port     int    `json:"port"`     // Port number
	User     string `json:"user"`     // User name
	Password string `json:"password"` // Password
}

Contains information required for connecting to an exasol database.

type ServiceAddress

type ServiceAddress struct {
	HostName string `json:"hostName"`
	Port     int    `json:"port"`
}

Address of a service with hostname and port.

type TestSetupAbstraction

type TestSetupAbstraction struct {
	// contains filtered or unexported fields
}

func (*TestSetupAbstraction) CreateConnection

func (testSetup *TestSetupAbstraction) CreateConnection() (*sql.DB, error)

CreateConnection returns a new database connection with autocommit enabled.

func (*TestSetupAbstraction) CreateConnectionWithConfig

func (testSetup *TestSetupAbstraction) CreateConnectionWithConfig(autocommit bool) (*sql.DB, error)

CreateConnection returns a new database connection with autocommit on or off.

func (*TestSetupAbstraction) DeleteFile

func (testSetup *TestSetupAbstraction) DeleteFile(path string) error

DeleteFile deletes a file from the default BucketFS bucket.

func (*TestSetupAbstraction) DownloadFile

func (testSetup *TestSetupAbstraction) DownloadFile(remotePath string, localPath string) error

DownloadFile downloads a file from the default BucketFS bucket to a local file.

func (*TestSetupAbstraction) DownloadFileAsString

func (testSetup *TestSetupAbstraction) DownloadFileAsString(path string) (string, error)

DownloadFileAsString downloads a file from the default BucketFS bucket.

func (*TestSetupAbstraction) GetConnectionInfo added in v0.2.3

func (testSetup *TestSetupAbstraction) GetConnectionInfo() (*ConnectionInfo, error)

GetConnectionInfo returns details required to connect to the Exasol database.

func (*TestSetupAbstraction) ListFiles

func (testSetup *TestSetupAbstraction) ListFiles(path string) ([]string, error)

ListFiles lists files in the default BucketFS bucket.

func (*TestSetupAbstraction) MakeDatabaseTcpServiceAccessibleFromLocalhost

func (testSetup *TestSetupAbstraction) MakeDatabaseTcpServiceAccessibleFromLocalhost(databasePort int) ([]int, error)

MakeDatabaseTcpServiceAccessibleFromLocalhost makes the port of a database node available from localhost. If the target is a cluster, this methods sets up a redirect for each node and returns multiple local port numbers. You can use this method for example to connect from your test PC to a profiling agent that listens on a TCP socket in an UDF.

func (*TestSetupAbstraction) MakeLocalTcpServiceAccessibleFromDatabase

func (testSetup *TestSetupAbstraction) MakeLocalTcpServiceAccessibleFromDatabase(localPort int) (*ServiceAddress, error)

MakeLocalTcpServiceAccessibleFromDatabase makes a local TCP service available from within the Exasol database. You can use this method for example for accessing a local s3 bucket implementation from inside the Exasol database. Another example is to connect from UDFs to a debugger running on the test PC. Returns the address under which the service is available from within the exasol database (same port).

func (*TestSetupAbstraction) MakeTcpServiceAccessibleFromDatabase

func (testSetup *TestSetupAbstraction) MakeTcpServiceAccessibleFromDatabase(serviceAddress ServiceAddress) (*ServiceAddress, error)

MakeTcpServiceAccessibleFromDatabase makes a given TCP service available inside of the Exasol database and returns the modified service address.

func (*TestSetupAbstraction) Stop

func (testSetup *TestSetupAbstraction) Stop() error

Stop stops the local server. Docker containers will keep running if reuse is enabled in ~/.testcontainers.properties.

func (*TestSetupAbstraction) UploadFile

func (testSetup *TestSetupAbstraction) UploadFile(localPath string, remoteName string) error

UploadFile uploads a local file to the default BucketFS bucket.

func (*TestSetupAbstraction) UploadStringContent

func (testSetup *TestSetupAbstraction) UploadStringContent(stringContent string, remoteName string) error

UploadStringContent uploads the given string content to a file in the default BucketFS bucket.

Jump to

Keyboard shortcuts

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