Home Download Docs Code Community
import "perkeep.org/pkg/blobserver/storagetest"
Overview
Index

Overview ▾

Package storagetest tests blobserver.Storage implementations

Index

func CheckEnumerate(sto blobserver.Storage, wantUnsorted []blob.SizedRef, opts ...interface{}) error
func Test(t *testing.T, fn func(*testing.T) (sto blobserver.Storage, cleanup func()))
func TestOpt(t *testing.T, opt Opts)
func TestStreamer(t *testing.T, bs blobserver.BlobStreamer, opts ...StreamerTestOpt)
type Opts
type StreamerTestOpt
type WantN
type WantSizedRefs

Package files

storagetest.go

func CheckEnumerate

func CheckEnumerate(sto blobserver.Storage, wantUnsorted []blob.SizedRef, opts ...interface{}) error

func Test

func Test(t *testing.T, fn func(*testing.T) (sto blobserver.Storage, cleanup func()))

func TestOpt

func TestOpt(t *testing.T, opt Opts)

func TestStreamer

func TestStreamer(t *testing.T, bs blobserver.BlobStreamer, opts ...StreamerTestOpt)

TestStreamer tests that the BlobStreamer bs implements all of the promised interface behavior and ultimately yields the provided blobs.

If bs also implements BlobEnumerator, the two are compared for consistency.

type Opts

type Opts struct {
    // New is required and must return the storage server to test, along with a func to
    // clean it up. The cleanup may be nil.
    New func(*testing.T) (sto blobserver.Storage, cleanup func())

    // Retries specifies how long to wait to retry after each failure
    // that may be an eventual consistency issue (enumerate, stat), etc.
    Retries []time.Duration

    SkipEnum bool // for when EnumerateBlobs is not implemented
}

type StreamerTestOpt

type StreamerTestOpt interface {
    // contains filtered or unexported methods
}

type WantN

type WantN int

WantN is a wanted condition, that the caller wants N of the items.

type WantSizedRefs

type WantSizedRefs []blob.SizedRef
Website layout inspired by memcached.
Content by the authors.