ctx

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PgSqlDbName   = "isp-test"
	PgSqlPassword = "123321"

	ElasticPort = "9200"

	TestConfigEnvPrefix = "ISP_TEST"
)

Variables

This section is empty.

Functions

func CurrentSessionName added in v1.6.0

func CurrentSessionName() string

Types

type BaseTestConfiguration

type BaseTestConfiguration struct {
	ModuleName string
	Registry   struct {
		Host     string
		Username string
		Password string
	}
	Images struct {
		ConfigService string
		Module        string
	}
}

func (*BaseTestConfiguration) GetBaseConfiguration

func (tc *BaseTestConfiguration) GetBaseConfiguration() BaseTestConfiguration

type ConfigServiceLocalConfiguration

type ConfigServiceLocalConfiguration struct {
	Database         structure.DBConfiguration
	GrpcOuterAddress structure.AddressConfiguration
	ModuleName       string
	WS               struct {
		Rest structure.AddressConfiguration
		Grpc structure.AddressConfiguration
	}
}

type DefaultLocalConfiguration

type DefaultLocalConfiguration struct {
	ConfigServiceAddress structure.AddressConfiguration
	GrpcOuterAddress     structure.AddressConfiguration
	GrpcInnerAddress     structure.AddressConfiguration
	ModuleName           string
}

type IntegrationTestRunner

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

func NewIntegrationTest

func NewIntegrationTest(m *testing.M, configPtr Testable, runner Runner) (*IntegrationTestRunner, error)

NewIntegrationTest creates integration test context, loads test configuration from file.

func (*IntegrationTestRunner) PrepareAndRun

func (r *IntegrationTestRunner) PrepareAndRun()

run test only if test.short is false or not specified

type Runner

type Runner func(ctx *TestContext, runTest func() int) int

runner must prepare environment for test, defer all resources closing and finally call runTest

type TestContext

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

produce isolated configurations for tests

func (*TestContext) BaseConfiguration

func (ctx *TestContext) BaseConfiguration() BaseTestConfiguration

func (*TestContext) Configuration

func (ctx *TestContext) Configuration() Testable

func (*TestContext) GetConfigServiceAddress

func (ctx *TestContext) GetConfigServiceAddress() structure.AddressConfiguration

func (*TestContext) GetConfigServiceConfiguration

func (ctx *TestContext) GetConfigServiceConfiguration() ConfigServiceLocalConfiguration

produce local configuration for config-service instance

func (*TestContext) GetContainer

func (ctx *TestContext) GetContainer(baseContainerName string) string

func (*TestContext) GetDBConfiguration

func (ctx *TestContext) GetDBConfiguration() structure.DBConfiguration

func (*TestContext) GetDockerNetwork

func (ctx *TestContext) GetDockerNetwork() string

func (*TestContext) GetElasticConfiguration added in v1.1.0

func (ctx *TestContext) GetElasticConfiguration() structure.ElasticConfiguration

func (*TestContext) GetImage

func (ctx *TestContext) GetImage(imageName string) string

func (*TestContext) GetModuleLocalConfig

func (ctx *TestContext) GetModuleLocalConfig(port, moduleName string) DefaultLocalConfiguration

func (*TestContext) GetRabbitConfiguration

func (ctx *TestContext) GetRabbitConfiguration() mq.Config

type Testable

type Testable interface {
	GetBaseConfiguration() BaseTestConfiguration
}

Jump to

Keyboard shortcuts

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