go-core: github.com/stratumn/go-core/store/storetestcases Index | Files

package storetestcases

import "github.com/stratumn/go-core/store/storetestcases"

Package storetestcases defines test cases to test stores.

Index

Package Files

batch.go benchutil.go config.go createlink.go evidencestore.go findsegments.go getinfo.go getmapids.go getsegment.go keyvaluestore.go storeevents.go storetestcases.go

func RandomFilterOffset Uses

func RandomFilterOffset(b *testing.B, numLinks, i int) *store.SegmentFilter

RandomFilterOffset is a a FilterFunc that create a filter with a random offset.

func RandomFilterOffsetMapID Uses

func RandomFilterOffsetMapID(b *testing.B, numLinks, i int) *store.SegmentFilter

RandomFilterOffsetMapID is a a FilterFunc that create a filter with a random offset and map ID. The map ID will be one of ten possible values.

func RandomFilterOffsetMapIDTags Uses

func RandomFilterOffsetMapIDTags(b *testing.B, numLinks, i int) *store.SegmentFilter

RandomFilterOffsetMapIDTags is a a FilterFunc that create a filter with a random offset and map ID and tags. The map ID will be one of ten possible values. The tags will be one of fifty possible combinations.

func RandomFilterOffsetMapIDs Uses

func RandomFilterOffsetMapIDs(b *testing.B, numLinks, i int) *store.SegmentFilter

RandomFilterOffsetMapIDs is a a FilterFunc that create a filter with a random offset and 2 map IDs. The map ID will be one of ten possible values.

func RandomFilterOffsetPrevLinkHash Uses

func RandomFilterOffsetPrevLinkHash(b *testing.B, numLinks, i int) *store.SegmentFilter

RandomFilterOffsetPrevLinkHash is a a FilterFunc that create a filter with a random offset and previous link hash. The previous link hash will be one of ten possible values.

func RandomFilterOffsetPrevLinkHashTags Uses

func RandomFilterOffsetPrevLinkHashTags(b *testing.B, numLinks, i int) *store.SegmentFilter

RandomFilterOffsetPrevLinkHashTags is a a FilterFunc that create a filter with a random offset and previous link hash and tags. The previous link hash will be one of ten possible values. The tags will be one of fifty possible combinations.

func RandomFilterOffsetTags Uses

func RandomFilterOffsetTags(b *testing.B, numLinks, i int) *store.SegmentFilter

RandomFilterOffsetTags is a a FilterFunc that create a filter with a random offset and map ID. The tags will be one of fifty possible combinations.

func RandomLink(b *testing.B, numLinks, i int) *chainscript.Link

RandomLink creates a link with random data.

func RandomLinkMapID Uses

func RandomLinkMapID(b *testing.B, numLinks, i int) *chainscript.Link

RandomLinkMapID is a CreateLinkFunc that creates a random link with map ID. The map ID will be one of ten possible values.

func RandomLinkMapIDTags Uses

func RandomLinkMapIDTags(b *testing.B, numLinks, i int) *chainscript.Link

RandomLinkMapIDTags is a CreateLinkFunc that creates a random link with map ID and tags. The map ID will be one of ten possible values. The tags will contain one of ten possible values.

func RandomLinkPrevLinkHash Uses

func RandomLinkPrevLinkHash(b *testing.B, numLinks, i int) *chainscript.Link

RandomLinkPrevLinkHash is a CreateLinkFunc that creates a random link with previous link hash. The previous link hash will be one of ten possible values.

func RandomLinkPrevLinkHashTags Uses

func RandomLinkPrevLinkHashTags(b *testing.B, numLinks, i int) *chainscript.Link

RandomLinkPrevLinkHashTags is a CreateLinkFunc that creates a random link with previous link hash and tags. The previous link hash will be one of ten possible values. The tags will contain one of ten possible values.

func RandomLinkTags Uses

func RandomLinkTags(b *testing.B, numLinks, i int) *chainscript.Link

RandomLinkTags is a CreateLinkFunc that creates a random link with tags. The tags will contain one of ten possible values.

func RandomPaginationOffset Uses

func RandomPaginationOffset(b *testing.B, numLinks, i int) *store.MapFilter

RandomPaginationOffset is a a PaginationFunc that create a pagination with a random offset.

type CreateLinkFunc Uses

type CreateLinkFunc func(b *testing.B, numLinks, i int) *chainscript.Link

CreateLinkFunc is a type for a function that creates a link for benchmarks.

type Factory Uses

type Factory struct {
    // New creates an adapter.
    New func() (store.Adapter, error)

    // Free is an optional function to free an adapter.
    Free func(adapter store.Adapter)

    // NewKeyValueStore creates a KeyValueStore.
    // If your store implements the KeyValueStore interface,
    // you need to implement this method.
    NewKeyValueStore func() (store.KeyValueStore, error)

    // FreeKeyValueStore is an optional function to free
    // a KeyValueStore adapter.
    FreeKeyValueStore func(adapter store.KeyValueStore)
}

Factory wraps functions to allocate and free an adapter, and is used to run the tests on an adapter.

func (f Factory) BenchmarkCreateLink(b *testing.B)

BenchmarkCreateLink benchmarks creating new links.

func (Factory) BenchmarkCreateLinkParallel Uses

func (f Factory) BenchmarkCreateLinkParallel(b *testing.B)

BenchmarkCreateLinkParallel benchmarks creating new links in parallel.

func (Factory) BenchmarkDeleteValue Uses

func (f Factory) BenchmarkDeleteValue(b *testing.B)

BenchmarkDeleteValue benchmarks deleting existing segments.

func (Factory) BenchmarkDeleteValueParallel Uses

func (f Factory) BenchmarkDeleteValueParallel(b *testing.B)

BenchmarkDeleteValueParallel benchmarks deleting existing segments in parallel.

func (Factory) BenchmarkFindSegments Uses

func (f Factory) BenchmarkFindSegments(b *testing.B, numLinks int, createLinkFunc CreateLinkFunc, filterFunc FilterFunc)

BenchmarkFindSegments benchmarks finding segments.

func (Factory) BenchmarkFindSegments100 Uses

func (f Factory) BenchmarkFindSegments100(b *testing.B)

BenchmarkFindSegments100 benchmarks finding segments within 100 segments.

func (Factory) BenchmarkFindSegments1000 Uses

func (f Factory) BenchmarkFindSegments1000(b *testing.B)

BenchmarkFindSegments1000 benchmarks finding segments within 1000 segments.

func (Factory) BenchmarkFindSegments10000 Uses

func (f Factory) BenchmarkFindSegments10000(b *testing.B)

BenchmarkFindSegments10000 benchmarks finding segments within 10000 segments.

func (Factory) BenchmarkFindSegments10000Parallel Uses

func (f Factory) BenchmarkFindSegments10000Parallel(b *testing.B)

BenchmarkFindSegments10000Parallel benchmarks finding segments within 10000 segments.

func (Factory) BenchmarkFindSegments1000Parallel Uses

func (f Factory) BenchmarkFindSegments1000Parallel(b *testing.B)

BenchmarkFindSegments1000Parallel benchmarks finding segments within 1000 segments.

func (Factory) BenchmarkFindSegments100Parallel Uses

func (f Factory) BenchmarkFindSegments100Parallel(b *testing.B)

BenchmarkFindSegments100Parallel benchmarks finding segments within 100 segments.

func (Factory) BenchmarkFindSegmentsMapID100 Uses

func (f Factory) BenchmarkFindSegmentsMapID100(b *testing.B)

BenchmarkFindSegmentsMapID100 benchmarks finding segments with a map ID within 100 segments.

func (Factory) BenchmarkFindSegmentsMapID1000 Uses

func (f Factory) BenchmarkFindSegmentsMapID1000(b *testing.B)

BenchmarkFindSegmentsMapID1000 benchmarks finding segments with a map ID within 1000 segments.

func (Factory) BenchmarkFindSegmentsMapID10000 Uses

func (f Factory) BenchmarkFindSegmentsMapID10000(b *testing.B)

BenchmarkFindSegmentsMapID10000 benchmarks finding segments with a map ID within 10000 segments.

func (Factory) BenchmarkFindSegmentsMapID10000Parallel Uses

func (f Factory) BenchmarkFindSegmentsMapID10000Parallel(b *testing.B)

BenchmarkFindSegmentsMapID10000Parallel benchmarks finding segments with a map ID within 10000 segments.

func (Factory) BenchmarkFindSegmentsMapID1000Parallel Uses

func (f Factory) BenchmarkFindSegmentsMapID1000Parallel(b *testing.B)

BenchmarkFindSegmentsMapID1000Parallel benchmarks finding segments with a map ID within 1000 segments.

func (Factory) BenchmarkFindSegmentsMapID100Parallel Uses

func (f Factory) BenchmarkFindSegmentsMapID100Parallel(b *testing.B)

BenchmarkFindSegmentsMapID100Parallel benchmarks finding segments with a map ID within 100 segments.

func (Factory) BenchmarkFindSegmentsMapIDTags100 Uses

func (f Factory) BenchmarkFindSegmentsMapIDTags100(b *testing.B)

BenchmarkFindSegmentsMapIDTags100 benchmarks finding segments with map ID and tags within 100 segments.

func (Factory) BenchmarkFindSegmentsMapIDTags1000 Uses

func (f Factory) BenchmarkFindSegmentsMapIDTags1000(b *testing.B)

BenchmarkFindSegmentsMapIDTags1000 benchmarks finding segments with map ID and tags within 1000 segments.

func (Factory) BenchmarkFindSegmentsMapIDTags10000 Uses

func (f Factory) BenchmarkFindSegmentsMapIDTags10000(b *testing.B)

BenchmarkFindSegmentsMapIDTags10000 benchmarks finding segments with map ID and tags within 10000 segments.

func (Factory) BenchmarkFindSegmentsMapIDTags10000Parallel Uses

func (f Factory) BenchmarkFindSegmentsMapIDTags10000Parallel(b *testing.B)

BenchmarkFindSegmentsMapIDTags10000Parallel benchmarks finding segments with map ID and tags within 10000 segments.

func (Factory) BenchmarkFindSegmentsMapIDTags1000Parallel Uses

func (f Factory) BenchmarkFindSegmentsMapIDTags1000Parallel(b *testing.B)

BenchmarkFindSegmentsMapIDTags1000Parallel benchmarks finding segments with map ID and tags within 1000 segments.

func (Factory) BenchmarkFindSegmentsMapIDTags100Parallel Uses

func (f Factory) BenchmarkFindSegmentsMapIDTags100Parallel(b *testing.B)

BenchmarkFindSegmentsMapIDTags100Parallel benchmarks finding segments with map ID and tags within 100 segments.

func (Factory) BenchmarkFindSegmentsMapIDs100 Uses

func (f Factory) BenchmarkFindSegmentsMapIDs100(b *testing.B)

BenchmarkFindSegmentsMapIDs100 benchmarks finding segments with several map IDs within 100 segments.

func (Factory) BenchmarkFindSegmentsMapIDs1000 Uses

func (f Factory) BenchmarkFindSegmentsMapIDs1000(b *testing.B)

BenchmarkFindSegmentsMapIDs1000 benchmarks finding segments with several map IDs within 1000 segments.

func (Factory) BenchmarkFindSegmentsMapIDs10000 Uses

func (f Factory) BenchmarkFindSegmentsMapIDs10000(b *testing.B)

BenchmarkFindSegmentsMapIDs10000 benchmarks finding segments with several map IDs within 10000 segments.

func (Factory) BenchmarkFindSegmentsMapIDs10000Parallel Uses

func (f Factory) BenchmarkFindSegmentsMapIDs10000Parallel(b *testing.B)

BenchmarkFindSegmentsMapIDs10000Parallel benchmarks finding segments with several map ID within 10000 segments.

func (Factory) BenchmarkFindSegmentsMapIDs1000Parallel Uses

func (f Factory) BenchmarkFindSegmentsMapIDs1000Parallel(b *testing.B)

BenchmarkFindSegmentsMapIDs1000Parallel benchmarks finding segments with several map ID within 1000 segments.

func (Factory) BenchmarkFindSegmentsMapIDs100Parallel Uses

func (f Factory) BenchmarkFindSegmentsMapIDs100Parallel(b *testing.B)

BenchmarkFindSegmentsMapIDs100Parallel benchmarks finding segments with several map ID within 100 segments.

func (Factory) BenchmarkFindSegmentsParallel Uses

func (f Factory) BenchmarkFindSegmentsParallel(b *testing.B, numLinks int, createLinkFunc CreateLinkFunc, filterFunc FilterFunc)

BenchmarkFindSegmentsParallel benchmarks finding segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHash100 Uses

func (f Factory) BenchmarkFindSegmentsPrevLinkHash100(b *testing.B)

BenchmarkFindSegmentsPrevLinkHash100 benchmarks finding segments with previous link hash within 100 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHash1000 Uses

func (f Factory) BenchmarkFindSegmentsPrevLinkHash1000(b *testing.B)

BenchmarkFindSegmentsPrevLinkHash1000 benchmarks finding segments with previous link hash within 1000 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHash10000 Uses

func (f Factory) BenchmarkFindSegmentsPrevLinkHash10000(b *testing.B)

BenchmarkFindSegmentsPrevLinkHash10000 benchmarks finding segments with previous link hash within 10000 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHash10000Parallel Uses

func (f Factory) BenchmarkFindSegmentsPrevLinkHash10000Parallel(b *testing.B)

BenchmarkFindSegmentsPrevLinkHash10000Parallel benchmarks finding segments with a previous link hash within 10000 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHash1000Parallel Uses

func (f Factory) BenchmarkFindSegmentsPrevLinkHash1000Parallel(b *testing.B)

BenchmarkFindSegmentsPrevLinkHash1000Parallel benchmarks finding segments with a previous link hash within 1000 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHash100Parallel Uses

func (f Factory) BenchmarkFindSegmentsPrevLinkHash100Parallel(b *testing.B)

BenchmarkFindSegmentsPrevLinkHash100Parallel benchmarks finding segments with a previous link hash within 100 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags100 Uses

func (f Factory) BenchmarkFindSegmentsPrevLinkHashTags100(b *testing.B)

BenchmarkFindSegmentsPrevLinkHashTags100 benchmarks finding segments with previous link hash and tags within 100 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags1000 Uses

func (f Factory) BenchmarkFindSegmentsPrevLinkHashTags1000(b *testing.B)

BenchmarkFindSegmentsPrevLinkHashTags1000 benchmarks finding segments with previous link hash and tags within 1000 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags10000 Uses

func (f Factory) BenchmarkFindSegmentsPrevLinkHashTags10000(b *testing.B)

BenchmarkFindSegmentsPrevLinkHashTags10000 benchmarks finding segments with previous link hash and tags within 10000 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags10000Parallel Uses

func (f Factory) BenchmarkFindSegmentsPrevLinkHashTags10000Parallel(b *testing.B)

BenchmarkFindSegmentsPrevLinkHashTags10000Parallel benchmarks finding segments with map ID and tags within 10000 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags1000Parallel Uses

func (f Factory) BenchmarkFindSegmentsPrevLinkHashTags1000Parallel(b *testing.B)

BenchmarkFindSegmentsPrevLinkHashTags1000Parallel benchmarks finding segments with map ID and tags within 1000 segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags100Parallel Uses

func (f Factory) BenchmarkFindSegmentsPrevLinkHashTags100Parallel(b *testing.B)

BenchmarkFindSegmentsPrevLinkHashTags100Parallel benchmarks finding segments with map ID and tags within 100 segments.

func (Factory) BenchmarkFindSegmentsTags100 Uses

func (f Factory) BenchmarkFindSegmentsTags100(b *testing.B)

BenchmarkFindSegmentsTags100 benchmarks finding segments with tags within 100 segments.

func (Factory) BenchmarkFindSegmentsTags1000 Uses

func (f Factory) BenchmarkFindSegmentsTags1000(b *testing.B)

BenchmarkFindSegmentsTags1000 benchmarks finding segments with tags within 1000 segments.

func (Factory) BenchmarkFindSegmentsTags10000 Uses

func (f Factory) BenchmarkFindSegmentsTags10000(b *testing.B)

BenchmarkFindSegmentsTags10000 benchmarks finding segments with tags within 10000 segments.

func (Factory) BenchmarkFindSegmentsTags10000Parallel Uses

func (f Factory) BenchmarkFindSegmentsTags10000Parallel(b *testing.B)

BenchmarkFindSegmentsTags10000Parallel benchmarks finding segments with tags within 10000 segments.

func (Factory) BenchmarkFindSegmentsTags1000Parallel Uses

func (f Factory) BenchmarkFindSegmentsTags1000Parallel(b *testing.B)

BenchmarkFindSegmentsTags1000Parallel benchmarks finding segments with tags within 1000 segments.

func (Factory) BenchmarkFindSegmentsTags100Parallel Uses

func (f Factory) BenchmarkFindSegmentsTags100Parallel(b *testing.B)

BenchmarkFindSegmentsTags100Parallel benchmarks finding segments with tags within 100 segments.

func (Factory) BenchmarkGetMapIDs Uses

func (f Factory) BenchmarkGetMapIDs(b *testing.B, numLinks int, createLinkFunc CreateLinkFunc, filterFunc MapFilterFunc)

BenchmarkGetMapIDs benchmarks getting map IDs.

func (Factory) BenchmarkGetMapIDs100 Uses

func (f Factory) BenchmarkGetMapIDs100(b *testing.B)

BenchmarkGetMapIDs100 benchmarks getting map IDs within 100 segments.

func (Factory) BenchmarkGetMapIDs1000 Uses

func (f Factory) BenchmarkGetMapIDs1000(b *testing.B)

BenchmarkGetMapIDs1000 benchmarks getting map IDs within 1000 segments.

func (Factory) BenchmarkGetMapIDs10000 Uses

func (f Factory) BenchmarkGetMapIDs10000(b *testing.B)

BenchmarkGetMapIDs10000 benchmarks getting map IDs within 10000 segments.

func (Factory) BenchmarkGetMapIDs10000Parallel Uses

func (f Factory) BenchmarkGetMapIDs10000Parallel(b *testing.B)

BenchmarkGetMapIDs10000Parallel benchmarks getting map IDs within 10000 segments in parallel.

func (Factory) BenchmarkGetMapIDs1000Parallel Uses

func (f Factory) BenchmarkGetMapIDs1000Parallel(b *testing.B)

BenchmarkGetMapIDs1000Parallel benchmarks getting map IDs within 1000 segments in parallel.

func (Factory) BenchmarkGetMapIDs100Parallel Uses

func (f Factory) BenchmarkGetMapIDs100Parallel(b *testing.B)

BenchmarkGetMapIDs100Parallel benchmarks gettiBenchmarkFindSegmentsPrevLinkHashTags100Parallelng map IDs within 100 segments in parallel.

func (Factory) BenchmarkGetMapIDsParallel Uses

func (f Factory) BenchmarkGetMapIDsParallel(b *testing.B, numLinks int, createLinkFunc CreateLinkFunc, filterFunc MapFilterFunc)

BenchmarkGetMapIDsParallel benchmarks getting map IDs in parallel.

func (Factory) BenchmarkGetSegment Uses

func (f Factory) BenchmarkGetSegment(b *testing.B)

BenchmarkGetSegment benchmarks getting existing segments.

func (Factory) BenchmarkGetSegmentParallel Uses

func (f Factory) BenchmarkGetSegmentParallel(b *testing.B)

BenchmarkGetSegmentParallel benchmarks getting existing segments in parallel.

func (Factory) BenchmarkGetValue Uses

func (f Factory) BenchmarkGetValue(b *testing.B)

BenchmarkGetValue benchmarks getting existing values.

func (Factory) BenchmarkGetValueParallel Uses

func (f Factory) BenchmarkGetValueParallel(b *testing.B)

BenchmarkGetValueParallel benchmarks getting existing values in parallel.

func (Factory) BenchmarkSetValue Uses

func (f Factory) BenchmarkSetValue(b *testing.B)

BenchmarkSetValue benchmarks saving new values.

func (Factory) BenchmarkSetValueParallel Uses

func (f Factory) BenchmarkSetValueParallel(b *testing.B)

BenchmarkSetValueParallel benchmarks saving new values in parallel.

func (Factory) RunKeyValueStoreBenchmarks Uses

func (f Factory) RunKeyValueStoreBenchmarks(b *testing.B)

RunKeyValueStoreBenchmarks runs all the benchmarks for the key-value store interface.

func (Factory) RunKeyValueStoreTests Uses

func (f Factory) RunKeyValueStoreTests(t *testing.T)

RunKeyValueStoreTests runs all the tests for the key value store interface.

func (Factory) RunStoreBenchmarks Uses

func (f Factory) RunStoreBenchmarks(b *testing.B)

RunStoreBenchmarks runs all the benchmarks for the store adapter interface.

func (Factory) RunStoreTests Uses

func (f Factory) RunStoreTests(t *testing.T)

RunStoreTests runs all the tests for the store adapter interface.

func (Factory) TestAdapterConfig Uses

func (f Factory) TestAdapterConfig(t *testing.T)

TestAdapterConfig tests the implementation of the AdapterConfig interface. Stores that don't implement this interface are skipped.

func (Factory) TestBatch Uses

func (f Factory) TestBatch(t *testing.T)

TestBatch runs all tests for the store.Batch interface

func (f Factory) TestCreateLink(t *testing.T)

TestCreateLink tests what happens when you create a new link.

func (Factory) TestEvidenceStore Uses

func (f Factory) TestEvidenceStore(t *testing.T)

TestEvidenceStore runs all tests for the store.EvidenceStore interface

func (Factory) TestFindSegments Uses

func (f Factory) TestFindSegments(t *testing.T)

TestFindSegments tests what happens when you search for segments with various filters.

func (Factory) TestGetInfo Uses

func (f Factory) TestGetInfo(t *testing.T)

TestGetInfo tests what happens when you get information about the adapter.

func (Factory) TestGetMapIDs Uses

func (f Factory) TestGetMapIDs(t *testing.T)

TestGetMapIDs tests what happens when you get map IDs.

func (Factory) TestGetSegment Uses

func (f Factory) TestGetSegment(t *testing.T)

TestGetSegment tests what happens when you get a segment.

func (Factory) TestKeyValueStore Uses

func (f Factory) TestKeyValueStore(t *testing.T)

TestKeyValueStore runs all tests for the store.KeyValueStore interface

func (Factory) TestStoreEvents Uses

func (f Factory) TestStoreEvents(t *testing.T)

TestStoreEvents tests store channel event notifications.

type FilterFunc Uses

type FilterFunc func(b *testing.B, numLinks, i int) *store.SegmentFilter

FilterFunc is a type for a function that creates a filter for benchmarks.

type MapFilterFunc Uses

type MapFilterFunc func(b *testing.B, numLinks, i int) *store.MapFilter

MapFilterFunc is a type for a function that creates a mapId filter for benchmarks.

Package storetestcases imports 20 packages (graph). Updated 2019-04-28. Refresh now. Tools for package owners.