testutil

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBContainerTimeoutSeconds = 60 * 30 // 30 minutes

	EnvKeyUseBlockAdapter = "USE_BLOCK_ADAPTER"
)

Variables

This section is empty.

Functions

func GetDB

func GetDB(t testing.TB, uri string, opts ...GetDBOption) (db.Database, string)

func GetDBInstance

func GetDBInstance(pool *dockertest.Pool) (string, func())

func Must

func Must(t testing.TB, err error)

func MustDo

func MustDo(t testing.TB, what string, err error)

func NewBlockAdapterByType

func NewBlockAdapterByType(t testing.TB, translator block.UploadIDTranslator, blockstoreType string) block.Adapter

func NewClientFromCreds added in v0.43.0

func NewClientFromCreds(logger logging.Logger, accessKeyID string, secretAccessKey string, endpointURL string) (*api.ClientWithResponses, error)

Creates a client using the credentials of a user

func ParseEndpointURL added in v0.43.0

func ParseEndpointURL(logger logging.Logger, endpointURL string) string

Parses the given endpoint string

Types

type GetDBOption

type GetDBOption func(options *GetDBOptions)

func WithGetDBApplyDDL

func WithGetDBApplyDDL(apply bool) GetDBOption

type GetDBOptions

type GetDBOptions struct {
	ApplyDDL bool
}

type SetupTestingEnvParams

type SetupTestingEnvParams struct {
	Name      string
	StorageNS string

	// Only if non-empty
	AdminAccessKeyID     string
	AdminSecretAccessKey string
}

type UploadIDTranslator

type UploadIDTranslator struct {
	T          *testing.T
	TransMap   map[string]string
	ExpectedID string
	// contains filtered or unexported fields
}

func (*UploadIDTranslator) RemoveUploadID

func (d *UploadIDTranslator) RemoveUploadID(inputUploadID string)

func (*UploadIDTranslator) SetUploadID

func (d *UploadIDTranslator) SetUploadID(uploadID string) string

func (*UploadIDTranslator) TranslateUploadID

func (d *UploadIDTranslator) TranslateUploadID(simulationID string) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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