Documentation
¶
Index ¶
- Constants
- Variables
- func CheckFilesWereGarbageCollected(t *testing.T, expectedExisting map[string]bool, ...)
- func CleanupUser(t testing.TB, ctx context.Context, client apigen.ClientWithResponsesInterface, ...)
- func DeleteAllGroups(ctx context.Context, client apigen.ClientWithResponsesInterface, ...) error
- func DeleteAllPolicies(ctx context.Context, client apigen.ClientWithResponsesInterface, ...) error
- func DeleteAllRepositories(ctx context.Context, client apigen.ClientWithResponsesInterface, ...) error
- func DeleteAllUsers(ctx context.Context, client apigen.ClientWithResponsesInterface, ...) error
- func DeleteRepositoryIfAskedTo(ctx context.Context, repositoryName string)
- func EnvCleanup(client apigen.ClientWithResponsesInterface, ...) error
- func GenerateUniqueRepositoryName() string
- func GenerateUniqueStorageNamespace(repoName string) string
- func GetAuthor(t testing.TB) (string, string)
- func GetCommitter(t testing.TB) string
- func GravelerIterator(data []byte) (*sstable.Iterator, error)
- func HooksSuccessTest(ctx context.Context, t *testing.T, repo string, ...)
- func Lakectl() string
- func LakectlWithParams(accessKeyID, secretAccessKey, endPointURL string) string
- func LakectlWithParamsWithPosixPerms(accessKeyID, secretAccessKey, endPointURL string, withPosixPerms bool) string
- func LakectlWithPosixPerms() string
- func Lakefs() string
- func LakefsWithBasicAuth() string
- func LakefsWithParams(connectionString string) string
- func LakefsWithParamsWithBasicAuth(connectionString string, basicAuth bool) string
- func ListRepositoryObjects(ctx context.Context, t *testing.T, repository string, ref string, ...) []apigen.ObjectStats
- func MakeRepositoryName(name string) string
- func RequireBlockstoreType(t testing.TB, requiredTypes ...string)
- func RequirePostgresDB(t *testing.T)
- func RunCmdAndVerifyContainsText(t *testing.T, cmd string, isTerminal bool, expectedRaw string, ...)
- func RunCmdAndVerifyFailure(t *testing.T, cmd string, isTerminal bool, expected string, ...)
- func RunCmdAndVerifyFailureContainsText(t *testing.T, cmd string, isTerminal bool, expectedRaw string, ...)
- func RunCmdAndVerifyFailureWithFile(t *testing.T, cmd string, isTerminal bool, goldenFile string, ...)
- func RunCmdAndVerifySuccess(t *testing.T, cmd string, isTerminal bool, expected string, ...)
- func RunCmdAndVerifySuccessWithFile(t *testing.T, cmd string, isTerminal bool, goldenFile string, ...)
- func RunSparkSubmit(config *SparkSubmitConfig) error
- func UploadContent(ctx context.Context, repo, branch, objPath, objContent string, ...) (*apigen.UploadObjectResponse, error)
- func UploadFileAndReport(ctx context.Context, repo, branch, objPath, objContent string, direct bool, ...) (checksum string, err error)
- func UploadFileRandomData(ctx context.Context, t *testing.T, repo, branch, objPath string, ...) (checksum, content string)
- func UploadFileRandomDataAndReport(ctx context.Context, repo, branch, objPath string, direct bool, ...) (checksum, content string, err error)
- func VerifyResponse(resp *http.Response, body []byte) error
- func WaitForListRepositoryRunsLen(ctx context.Context, t *testing.T, repo, ref string, l int, ...) *apigen.ActionRunList
- type AdapterFactory
- type ArrayFlags
- type ClientAdapter
- type HookResponse
- type LakeCtlCmd
- type ObjectStats
- type SparkSubmitConfig
- type WebhookServer
- type ZeroReader
Constants ¶
const ( DefaultAdminAccessKeyID = "AKIAIOSFDNN7EXAMPLEQ" //nolint:gosec DefaultAdminSecretAccessKey = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" //nolint:gosec AdminUsername = "esti" ViperStorageNamespaceKey = "storage_namespace" ViperBlockstoreType = "blockstore_type" )
Variables ¶
var ActionsPath embed.FS
var ErrWebhookTimeout = errors.New("timeout passed waiting for hook")
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 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 GetCommitter ¶ added in v1.52.0
func GravelerIterator ¶ added in v1.51.0
func HooksSuccessTest ¶ added in v1.52.0
func LakectlWithParams ¶
func LakectlWithParamsWithPosixPerms ¶ added in v1.28.2
func LakectlWithPosixPerms ¶ added in v1.28.2
func LakectlWithPosixPerms() string
func LakefsWithBasicAuth ¶ added in v1.32.0
func LakefsWithBasicAuth() string
func LakefsWithParams ¶ added in v1.32.0
func LakefsWithParamsWithBasicAuth ¶ added in v1.32.0
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
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
RequireBlockstoreType Skips test if blockstore type doesn't match the required type
func RequirePostgresDB ¶ added in v1.32.0
func RunCmdAndVerifyContainsText ¶ added in v0.70.0
func RunCmdAndVerifyFailure ¶
func RunCmdAndVerifyFailureContainsText ¶ added in v1.25.0
func RunCmdAndVerifySuccess ¶
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 UploadFileRandomData ¶ added in v1.51.0
func UploadFileRandomDataAndReport ¶ added in v1.52.0
func VerifyResponse ¶ added in v1.51.0
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
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 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
ZeroReader reads only zeros into the provided buffer, until `Amount` is reached.
func NewZeroReader ¶ added in v1.26.0
func NewZeroReader(amount int) *ZeroReader