esti

package
v1.55.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAdminAccessKeyID     = "AKIAIOSFDNN7EXAMPLEQ"                     //nolint:gosec
	DefaultAdminSecretAccessKey = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" //nolint:gosec
	AdminUsername               = "esti"

	ViperStorageNamespaceKey = "storage_namespace"
	ViperBlockstoreType      = "blockstore_type"
)

Variables

View Source
var ActionsPath embed.FS
View Source
var ErrWebhookTimeout = errors.New("timeout passed waiting for hook")
View Source
var ExportHooksFiles embed.FS

Functions

func CheckFilesWereGarbageCollected added in v1.54.0

func CheckFilesWereGarbageCollected(t *testing.T, expectedExisting map[string]bool, presignedURLs map[string]string)

CheckFilesWereGarbageCollected checks that the actual list of presigned URLs matches the expected list in terms of existence status

func CleanupUser added in v1.54.0

func CleanupUser(t testing.TB, ctx context.Context, client apigen.ClientWithResponsesInterface, userName string)

CleanupUser - A helper function to remove created users during test

func DeleteAllGroups added in v1.51.0

func DeleteAllGroups(ctx context.Context, client apigen.ClientWithResponsesInterface, groupsToKeep ArrayFlags) error

func DeleteAllPolicies added in v1.51.0

func DeleteAllPolicies(ctx context.Context, client apigen.ClientWithResponsesInterface, policiesToKeep ArrayFlags) error

func DeleteAllRepositories added in v1.51.0

func DeleteAllRepositories(ctx context.Context, client apigen.ClientWithResponsesInterface, repositoriesToKeep ArrayFlags) error

func DeleteAllUsers added in v1.51.0

func DeleteAllUsers(ctx context.Context, client apigen.ClientWithResponsesInterface, usersToKeep ArrayFlags) error

func DeleteRepositoryIfAskedTo added in v1.51.0

func DeleteRepositoryIfAskedTo(ctx context.Context, repositoryName string)

func EnvCleanup added in v1.51.0

func EnvCleanup(client apigen.ClientWithResponsesInterface, repositoriesToKeep, groupsToKeep, usersToKeep, policiesToKeep ArrayFlags) error

func GenerateUniqueRepositoryName added in v1.51.0

func GenerateUniqueRepositoryName() string

func GenerateUniqueStorageNamespace added in v1.51.0

func GenerateUniqueStorageNamespace(repoName string) string

func GetAuthor added in v1.52.0

func GetAuthor(t testing.TB) (string, string)

func GetCommitter added in v1.52.0

func GetCommitter(t testing.TB) string

func GravelerIterator added in v1.51.0

func GravelerIterator(data []byte) (*sstable.Iterator, error)

func HooksSuccessTest added in v1.52.0

func HooksSuccessTest(ctx context.Context, t *testing.T, repo string, lakeFSClient apigen.ClientWithResponsesInterface)

func Lakectl

func Lakectl() string

func LakectlWithParams

func LakectlWithParams(accessKeyID, secretAccessKey, endPointURL string) string

func LakectlWithParamsWithPosixPerms added in v1.28.2

func LakectlWithParamsWithPosixPerms(accessKeyID, secretAccessKey, endPointURL string, withPosixPerms bool) string

func LakectlWithPosixPerms added in v1.28.2

func LakectlWithPosixPerms() string

func Lakefs added in v1.32.0

func Lakefs() string

func LakefsWithBasicAuth added in v1.32.0

func LakefsWithBasicAuth() string

func LakefsWithParams added in v1.32.0

func LakefsWithParams(connectionString string) string

func LakefsWithParamsWithBasicAuth added in v1.32.0

func LakefsWithParamsWithBasicAuth(connectionString string, basicAuth bool) string

func ListRepositoryObjects added in v1.52.0

func ListRepositoryObjects(ctx context.Context, t *testing.T, repository string, ref string, clt apigen.ClientWithResponsesInterface) []apigen.ObjectStats

func MakeRepositoryName added in v1.51.0

func MakeRepositoryName(name string) string

MakeRepositoryName changes name to make it an acceptable repository name by replacing all non-alphanumeric characters with a `-`.

func RequireBlockstoreType added in v1.51.0

func RequireBlockstoreType(t testing.TB, requiredTypes ...string)

RequireBlockstoreType Skips test if blockstore type doesn't match the required type

func RequirePostgresDB added in v1.32.0

func RequirePostgresDB(t *testing.T)

func RunCmdAndVerifyContainsText added in v0.70.0

func RunCmdAndVerifyContainsText(t *testing.T, cmd string, isTerminal bool, expectedRaw string, vars map[string]string)

func RunCmdAndVerifyFailure

func RunCmdAndVerifyFailure(t *testing.T, cmd string, isTerminal bool, expected string, vars map[string]string)

func RunCmdAndVerifyFailureContainsText added in v1.25.0

func RunCmdAndVerifyFailureContainsText(t *testing.T, cmd string, isTerminal bool, expectedRaw string, vars map[string]string)

func RunCmdAndVerifyFailureWithFile

func RunCmdAndVerifyFailureWithFile(t *testing.T, cmd string, isTerminal bool, goldenFile string, vars map[string]string)

func RunCmdAndVerifySuccess

func RunCmdAndVerifySuccess(t *testing.T, cmd string, isTerminal bool, expected string, vars map[string]string)

func RunCmdAndVerifySuccessWithFile

func RunCmdAndVerifySuccessWithFile(t *testing.T, cmd string, isTerminal bool, goldenFile string, vars map[string]string)

func RunSparkSubmit added in v1.54.0

func RunSparkSubmit(config *SparkSubmitConfig) error

func UploadContent added in v1.51.0

func UploadContent(ctx context.Context, repo, branch, objPath, objContent string, clt apigen.ClientWithResponsesInterface) (*apigen.UploadObjectResponse, error)

func UploadFileAndReport added in v1.51.0

func UploadFileAndReport(ctx context.Context, repo, branch, objPath, objContent string, direct bool, clt apigen.ClientWithResponsesInterface) (checksum string, err error)

func UploadFileRandomData added in v1.51.0

func UploadFileRandomData(ctx context.Context, t *testing.T, repo, branch, objPath string, clt apigen.ClientWithResponsesInterface) (checksum, content string)

func UploadFileRandomDataAndReport added in v1.52.0

func UploadFileRandomDataAndReport(ctx context.Context, repo, branch, objPath string, direct bool, clt apigen.ClientWithResponsesInterface) (checksum, content string, err error)

func VerifyResponse added in v1.51.0

func VerifyResponse(resp *http.Response, body []byte) error

VerifyResponse returns an error based on failed if resp failed to perform action. It uses body in errors.

func WaitForListRepositoryRunsLen added in v1.51.0

func WaitForListRepositoryRunsLen(ctx context.Context, t *testing.T, repo, ref string, l int, clt apigen.ClientWithResponsesInterface) *apigen.ActionRunList

Types

type AdapterFactory added in v1.51.0

type AdapterFactory map[string]func() (ClientAdapter, error)

type ArrayFlags added in v1.51.0

type ArrayFlags []string

func (*ArrayFlags) Set added in v1.51.0

func (i *ArrayFlags) Set(value string) error

func (*ArrayFlags) String added in v1.51.0

func (i *ArrayFlags) String() string

type ClientAdapter added in v1.51.0

type ClientAdapter interface {
	// Upload uploads data from contents to physicalAddress and returns stored stats.
	// Returned MTime may be zero.
	Upload(ctx context.Context, physicalAddress *url.URL, contents io.ReadSeeker) (ObjectStats, error)

	// Download returns a Reader to download data from physicalAddress.  The Close method
	// of that Reader can return errors!
	Download(ctx context.Context, physicalAddress *url.URL) (io.ReadCloser, error)
}

ClientAdapter abstracts operations on a backing store.

func NewAdapter added in v1.51.0

func NewAdapter(protocol string) (ClientAdapter, error)

NewAdapter returns a ClientAdapter for protocol.

type HookResponse added in v1.51.0

type HookResponse struct {
	Path        string
	Err         error
	Data        []byte
	QueryParams map[string][]string
}

func ResponseWithTimeout added in v1.51.0

func ResponseWithTimeout(s *WebhookServer, timeout time.Duration) (*HookResponse, error)

ResponseWithTimeout wait for webhook response

type LakeCtlCmd added in v1.26.0

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

func NewLakeCtl added in v1.26.0

func NewLakeCtl() *LakeCtlCmd

func (*LakeCtlCmd) Arg added in v1.26.0

func (l *LakeCtlCmd) Arg(arg string) *LakeCtlCmd

func (*LakeCtlCmd) Flag added in v1.26.0

func (l *LakeCtlCmd) Flag(arg string) *LakeCtlCmd

Flag Same as Arg, added for usage clarity.

func (*LakeCtlCmd) Get added in v1.26.0

func (l *LakeCtlCmd) Get() string

func (*LakeCtlCmd) PathArg added in v1.26.0

func (l *LakeCtlCmd) PathArg(components ...string) *LakeCtlCmd

func (*LakeCtlCmd) URLArg added in v1.26.0

func (l *LakeCtlCmd) URLArg(schemaPrefix string, components ...string) *LakeCtlCmd

type ObjectStats added in v1.51.0

type ObjectStats struct {
	// Size is the number of bytes.
	Size int64
	// ETag is a unique identifier of the contents.
	ETag string
	// MTime is the time stored for last object modification. It can be returned as 0
	// from calls to ClientAdapter.Upload().
	MTime time.Time
}

ObjectStats metadata of an object stored on a backing store.

type SparkSubmitConfig added in v1.54.0

type SparkSubmitConfig struct {
	SparkVersion string
	// LocalJar is a local path to a jar that contains the main class.
	LocalJar string
	// EntryPoint is the class name to run
	EntryPoint      string
	ExtraSubmitArgs []string
	ProgramArgs     []string
	LogSource       string
}

type WebhookServer added in v1.51.0

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

func StartWebhookServer added in v1.51.0

func StartWebhookServer(t testing.TB) *WebhookServer

func (*WebhookServer) BaseURL added in v1.51.0

func (s *WebhookServer) BaseURL() string

func (*WebhookServer) Server added in v1.51.0

func (s *WebhookServer) Server() *http.Server

type ZeroReader added in v1.26.0

type ZeroReader struct {
	Amount       int
	NumBytesRead int
}

ZeroReader reads only zeros into the provided buffer, until `Amount` is reached.

func NewZeroReader added in v1.26.0

func NewZeroReader(amount int) *ZeroReader

func (*ZeroReader) Read added in v1.26.0

func (zr *ZeroReader) Read(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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