testutil

package
v0.83.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBName                    = "lakefs_db"
	DBContainerTimeoutSeconds = 60 * 30 // 30 minutes

	EnvKeyUseBlockAdapter = "USE_BLOCK_ADAPTER"
)
View Source
const (
	DynamodbLocalPort = "6432"
	DynamodbLocalURI  = "http://localhost:6432"

	DynamoDBReadCapacity  = 1000
	DynamoDBWriteCapacity = 1000
	DynamoDBScanLimit     = 10
)

Variables

This section is empty.

Functions

func CleanupKV added in v0.66.0

func CleanupKV(ctx context.Context, t *testing.T, store kv.Store)

func GetDBInstance

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

func GetDynamoDBInstance added in v0.68.0

func GetDynamoDBInstance() (string, func(), error)

func GetDynamoDBProd added in v0.68.0

func GetDynamoDBProd(ctx context.Context, tb testing.TB) kv.Store

func MigrateBadEntry added in v0.66.0

func MigrateBadEntry(_ context.Context, _ *pgxpool.Pool, _ blockparams.AdapterConfig, writer io.Writer) error

func MigrateBasic added in v0.66.0

func MigrateBasic(_ context.Context, _ *pgxpool.Pool, _ blockparams.AdapterConfig, writer io.Writer) error

func MigrateEmpty added in v0.66.0

func MigrateNoHeader added in v0.66.0

func MigrateNoHeader(_ context.Context, _ *pgxpool.Pool, _ blockparams.AdapterConfig, writer io.Writer) error

func MigrateParallel added in v0.66.0

func MigrateParallel(_ context.Context, _ *pgxpool.Pool, _ blockparams.AdapterConfig, writer io.Writer) error

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, 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)

NewClientFromCreds creates a client using the credentials of a user

func ParseEndpointURL added in v0.43.0

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

ParseEndpointURL parses the given endpoint string

func RandomRune added in v0.51.0

func RandomRune(rand *rand.Rand, num, den int) rune

RandomRune returns a random Unicode rune from rand, weighting at least num out of den runes to be ASCII.

func RandomString added in v0.51.0

func RandomString(rand *rand.Rand, size int) string

RandomString returns a random UTF-8 string of size or almost size bytes from rand. It is weighted towards using many ASCII characters.

func SetupTestS3Client added in v0.82.0

func SetupTestS3Client(endpoint, key, secret string) *s3.S3

func UniqueKVTableName added in v0.68.0

func UniqueKVTableName() string

func ValidateKV added in v0.66.0

func ValidateKV(ctx context.Context, t *testing.T, store kv.Store, entries int)

Types

type GetDBOption

type GetDBOption func(options *GetDBOptions)

type GetDBOptions

type GetDBOptions struct {
	ApplyDDL bool
}

type SetupTestingEnvParams

type SetupTestingEnvParams struct {
	Name      string
	StorageNS string

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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