storetestcases

package
v0.0.4-dev Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package storetestcases defines test cases to test stores.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomFilterOffset

func RandomFilterOffset(b *testing.B, numSegments, i int) *store.Filter

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

func RandomFilterOffsetMapID

func RandomFilterOffsetMapID(b *testing.B, numSegments, i int) *store.Filter

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

func RandomFilterOffsetMapIDTags(b *testing.B, numSegments, i int) *store.Filter

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 RandomFilterOffsetPrevLinkHash

func RandomFilterOffsetPrevLinkHash(b *testing.B, numSegments, i int) *store.Filter

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

func RandomFilterOffsetPrevLinkHashTags(b *testing.B, numSegments, i int) *store.Filter

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

func RandomFilterOffsetTags(b *testing.B, numSegments, i int) *store.Filter

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 RandomPaginationOffset

func RandomPaginationOffset(b *testing.B, numSegments, i int) *store.Pagination

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

func RandomSegment

func RandomSegment(b *testing.B, numSegments, i int) *cs.Segment

RandomSegment is a SegmentFunc that create a random segment.

func RandomSegmentMapID

func RandomSegmentMapID(b *testing.B, numSegments, i int) *cs.Segment

RandomSegmentMapID is a SegmentFunc that create a random segment with map ID. The map ID will be one of ten possible values.

func RandomSegmentMapIDTags

func RandomSegmentMapIDTags(b *testing.B, numSegments, i int) *cs.Segment

RandomSegmentMapIDTags is a SegmentFunc that create a random segment 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 RandomSegmentPrevLinkHash

func RandomSegmentPrevLinkHash(b *testing.B, numSegments, i int) *cs.Segment

RandomSegmentPrevLinkHash is a SegmentFunc that create a random segment with previous link hash. The previous link hash will be one of ten possible values.

func RandomSegmentPrevLinkHashTags

func RandomSegmentPrevLinkHashTags(b *testing.B, numSegments, i int) *cs.Segment

RandomSegmentPrevLinkHashTags is a SegmentFunc that create a random segment 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 RandomSegmentTags

func RandomSegmentTags(b *testing.B, numSegments, i int) *cs.Segment

RandomSegmentTags is a SegmentFunc that create a random segment with tags. The tags will contain one of ten possible values.

Types

type Factory

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

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

func (Factory) BenchmarkDeleteSegment

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

BenchmarkDeleteSegment benchmarks deleting existing segments.

func (Factory) BenchmarkDeleteSegmentParallel

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

BenchmarkDeleteSegmentParallel benchmarks deleting existing segments in parallel.

func (Factory) BenchmarkFindSegments

func (f Factory) BenchmarkFindSegments(b *testing.B, numSegments int, segmentFunc SegmentFunc, filterFunc FilterFunc)

BenchmarkFindSegments benchmarks finding segments.

func (Factory) BenchmarkFindSegments100

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

BenchmarkFindSegments100 benchmarks finding segments within 100 segments.

func (Factory) BenchmarkFindSegments1000

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

BenchmarkFindSegments1000 benchmarks finding segments within 1000 segments.

func (Factory) BenchmarkFindSegments10000

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

BenchmarkFindSegments10000 benchmarks finding segments within 10000 segments.

func (Factory) BenchmarkFindSegments10000Parallel

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

BenchmarkFindSegments10000Parallel benchmarks finding segments within 10000 segments.

func (Factory) BenchmarkFindSegments1000Parallel

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

BenchmarkFindSegments1000Parallel benchmarks finding segments within 1000 segments.

func (Factory) BenchmarkFindSegments100Parallel

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

BenchmarkFindSegments100Parallel benchmarks finding segments within 100 segments.

func (Factory) BenchmarkFindSegmentsMapID100

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

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

func (Factory) BenchmarkFindSegmentsMapID1000

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

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

func (Factory) BenchmarkFindSegmentsMapID10000

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

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

func (Factory) BenchmarkFindSegmentsMapID10000Parallel

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

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

func (Factory) BenchmarkFindSegmentsMapID1000Parallel

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

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

func (Factory) BenchmarkFindSegmentsMapID100Parallel

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

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

func (Factory) BenchmarkFindSegmentsMapIDTags100

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

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

func (Factory) BenchmarkFindSegmentsMapIDTags1000

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

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

func (Factory) BenchmarkFindSegmentsMapIDTags10000

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

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

func (Factory) BenchmarkFindSegmentsMapIDTags10000Parallel

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

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

func (Factory) BenchmarkFindSegmentsMapIDTags1000Parallel

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

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

func (Factory) BenchmarkFindSegmentsMapIDTags100Parallel

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

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

func (Factory) BenchmarkFindSegmentsParallel

func (f Factory) BenchmarkFindSegmentsParallel(b *testing.B, numSegments int, segmentFunc SegmentFunc, filterFunc FilterFunc)

BenchmarkFindSegmentsParallel benchmarks finding segments.

func (Factory) BenchmarkFindSegmentsPrevLinkHash100

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

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

func (Factory) BenchmarkFindSegmentsPrevLinkHash1000

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

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

func (Factory) BenchmarkFindSegmentsPrevLinkHash10000

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

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

func (Factory) BenchmarkFindSegmentsPrevLinkHash10000Parallel

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

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

func (Factory) BenchmarkFindSegmentsPrevLinkHash1000Parallel

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

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

func (Factory) BenchmarkFindSegmentsPrevLinkHash100Parallel

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

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

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags100

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

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

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags1000

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

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

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags10000

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

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

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags10000Parallel

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

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

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags1000Parallel

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

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

func (Factory) BenchmarkFindSegmentsPrevLinkHashTags100Parallel

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

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

func (Factory) BenchmarkFindSegmentsTags100

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

BenchmarkFindSegmentsTags100 benchmarks finding segments with tags within 100 segments.

func (Factory) BenchmarkFindSegmentsTags1000

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

BenchmarkFindSegmentsTags1000 benchmarks finding segments with tags within 1000 segments.

func (Factory) BenchmarkFindSegmentsTags10000

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

BenchmarkFindSegmentsTags10000 benchmarks finding segments with tags within 10000 segments.

func (Factory) BenchmarkFindSegmentsTags10000Parallel

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

BenchmarkFindSegmentsTags10000Parallel benchmarks finding segments with tags within 10000 segments.

func (Factory) BenchmarkFindSegmentsTags1000Parallel

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

BenchmarkFindSegmentsTags1000Parallel benchmarks finding segments with tags within 1000 segments.

func (Factory) BenchmarkFindSegmentsTags100Parallel

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

BenchmarkFindSegmentsTags100Parallel benchmarks finding segments with tags within 100 segments.

func (Factory) BenchmarkGetMapIDs

func (f Factory) BenchmarkGetMapIDs(b *testing.B, numSegments int, segmentFunc SegmentFunc, paginationFunc PaginationFunc)

BenchmarkGetMapIDs benchmarks getting map IDs.

func (Factory) BenchmarkGetMapIDs100

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

BenchmarkGetMapIDs100 benchmarks getting map IDs within 100 segments.

func (Factory) BenchmarkGetMapIDs1000

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

BenchmarkGetMapIDs1000 benchmarks getting map IDs within 1000 segments.

func (Factory) BenchmarkGetMapIDs10000

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

BenchmarkGetMapIDs10000 benchmarks getting map IDs within 10000 segments.

func (Factory) BenchmarkGetMapIDs10000Parallel

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

BenchmarkGetMapIDs10000Parallel benchmarks getting map IDs within 10000 segments in parallel.

func (Factory) BenchmarkGetMapIDs1000Parallel

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

BenchmarkGetMapIDs1000Parallel benchmarks getting map IDs within 1000 segments in parallel.

func (Factory) BenchmarkGetMapIDs100Parallel

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

BenchmarkGetMapIDs100Parallel benchmarks getting map IDs within 100 segments in parallel.

func (Factory) BenchmarkGetMapIDsParallel

func (f Factory) BenchmarkGetMapIDsParallel(b *testing.B, numSegments int, segmentFunc SegmentFunc, paginationFunc PaginationFunc)

BenchmarkGetMapIDsParallel benchmarks getting map IDs in parallel.

func (Factory) BenchmarkGetSegment

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

BenchmarkGetSegment benchmarks getting existing segments.

func (Factory) BenchmarkGetSegmentParallel

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

BenchmarkGetSegmentParallel benchmarks getting existing segments in parallel.

func (Factory) BenchmarkSaveSegment

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

BenchmarkSaveSegment benchmarks saving new segments.

func (Factory) BenchmarkSaveSegmentParallel

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

BenchmarkSaveSegmentParallel benchmarks saving new segments in parallel.

func (Factory) BenchmarkSaveSegmentUpdatedMapID

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

BenchmarkSaveSegmentUpdatedMapID benchmarks updating segment map IDs.

func (Factory) BenchmarkSaveSegmentUpdatedMapIDParallel

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

BenchmarkSaveSegmentUpdatedMapIDParallel benchmarks updating segment map IDs in parallel.

func (Factory) BenchmarkSaveSegmentUpdatedState

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

BenchmarkSaveSegmentUpdatedState benchmarks updating segments states.

func (Factory) BenchmarkSaveSegmentUpdatedStateParallel

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

BenchmarkSaveSegmentUpdatedStateParallel benchmarks updating segments states in parallel.

func (Factory) RunBenchmarks

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

RunBenchmarks runs all the benchmarks.

func (Factory) RunTests

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

RunTests runs all the tests.

func (Factory) TestDeleteSegment

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

TestDeleteSegment tests what happens when you delete an existing segments.

func (Factory) TestDeleteSegmentNotFound

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

TestDeleteSegmentNotFound tests what happens when you delete a nonexistent segment.

func (Factory) TestFindSegmentEmpty

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

TestFindSegmentEmpty tests what happens when there are no matches.

func (Factory) TestFindSegments

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

TestFindSegments tests what happens when you search with default pagination.

func (Factory) TestFindSegmentsMapID

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

TestFindSegmentsMapID tests whan happens when you search for an existing map ID.

func (Factory) TestFindSegmentsMapIDNotFound

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

TestFindSegmentsMapIDNotFound tests whan happens when you search for a nonexistent map ID.

func (Factory) TestFindSegmentsMapIDTags

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

TestFindSegmentsMapIDTags tests whan happens when you search for an existing map ID and tags.

func (Factory) TestFindSegmentsMultipleTags

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

TestFindSegmentsMultipleTags tests what happens when you search with more than one tag.

func (Factory) TestFindSegmentsPagination

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

TestFindSegmentsPagination tests what happens when you search with pagination.

func (Factory) TestFindSegmentsPrevLinkHash

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

TestFindSegmentsPrevLinkHash tests whan happens when you search for an existing previous link hash.

func (Factory) TestFindSegmentsPrevLinkHashMapID

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

TestFindSegmentsPrevLinkHashMapID tests that the map ID is ignored if a previous link hash is given.

func (Factory) TestFindSegmentsPrevLinkHashNotFound

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

TestFindSegmentsPrevLinkHashNotFound tests whan happens when you search for a nonexistent previous link hash.

func (Factory) TestFindSegmentsPrevLinkHashTags

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

TestFindSegmentsPrevLinkHashTags tests whan happens when you search for a previous link hash and tags.

func (Factory) TestFindSegmentsSingleTag

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

TestFindSegmentsSingleTag tests what happens when you search with only one tag.

func (Factory) TestGetInfo

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

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

func (Factory) TestGetMapIDs

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

TestGetMapIDs tests what happens when you get map IDs with default pagination.

func (Factory) TestGetMapIDsEmpty

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

TestGetMapIDsEmpty tests what happens when you should get no map IDs.

func (Factory) TestGetMapIDsPagination

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

TestGetMapIDsPagination tests what happens when you get map IDs with pagination.

func (Factory) TestGetSegment

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

TestGetSegment tests what happens when you get an existing segment.

func (Factory) TestGetSegmentNotFound

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

TestGetSegmentNotFound tests what happens when you get a nonexistent segment.

func (Factory) TestGetSegmentUpdatedMapID

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

TestGetSegmentUpdatedMapID tests what happens when you get a segment whose map ID was updated.

func (Factory) TestGetSegmentUpdatedState

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

TestGetSegmentUpdatedState tests what happens when you get a segment whose state was updated.

func (Factory) TestSaveSegment

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

TestSaveSegment tests what happens when you save a new segment.

func (Factory) TestSaveSegmentBranch

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

TestSaveSegmentBranch tests what happens when you save a segment with a previous link hash.

func (Factory) TestSaveSegmentUpdatedMapID

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

TestSaveSegmentUpdatedMapID tests what happens when you update the map ID of a segment.

func (Factory) TestSaveSegmentUpdatedState

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

TestSaveSegmentUpdatedState tests what happens when you update the state of a segment.

type FilterFunc

type FilterFunc func(b *testing.B, numSegments, i int) *store.Filter

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

type PaginationFunc

type PaginationFunc func(b *testing.B, numSegments, i int) *store.Pagination

PaginationFunc is a type for a function that creates a pagination for benchmarks.

type SegmentFunc

type SegmentFunc func(b *testing.B, numSegments, i int) *cs.Segment

SegmentFunc is a type for a function that creates a segment for benchmarks.

Jump to

Keyboard shortcuts

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