test

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GCCategory               = "GC"
	WatchCategory            = "Watch"
	WatchSchemaCategory      = "WatchSchema"
	WatchCheckpointsCategory = "WatchCheckpoints"
	StatsCategory            = "Stats"
)

Variables

This section is empty.

Functions

func All

func All(t *testing.T, tester DatastoreTester)

All runs all generic datastore tests on a DatastoreTester.

func AllWithExceptions

func AllWithExceptions(t *testing.T, tester DatastoreTester, except Categories)

AllWithExceptions runs all generic datastore tests on a DatastoreTester, except those specified test categories

func BulkDeleteRelationshipsTest

func BulkDeleteRelationshipsTest(t *testing.T, tester DatastoreTester)

func BulkUploadAlreadyExistsErrorTest

func BulkUploadAlreadyExistsErrorTest(t *testing.T, tester DatastoreTester)

func BulkUploadAlreadyExistsSameCallErrorTest

func BulkUploadAlreadyExistsSameCallErrorTest(t *testing.T, tester DatastoreTester)

func BulkUploadErrorsTest

func BulkUploadErrorsTest(t *testing.T, tester DatastoreTester)

func BulkUploadTest

func BulkUploadTest(t *testing.T, tester DatastoreTester)

func CaveatNotFoundTest

func CaveatNotFoundTest(t *testing.T, tester DatastoreTester)

CaveatNotFound tests to ensure that an unknown caveat returns the expected error.

func CaveatSnapshotReadsTest

func CaveatSnapshotReadsTest(t *testing.T, tester DatastoreTester)

func CaveatedRelationshipFilterTest

func CaveatedRelationshipFilterTest(t *testing.T, tester DatastoreTester)

func CaveatedRelationshipWatchTest

func CaveatedRelationshipWatchTest(t *testing.T, tester DatastoreTester)

func ConcurrentRevisionsTest

func ConcurrentRevisionsTest(t *testing.T, tester DatastoreTester)

func ConcurrentWriteSerializationTest

func ConcurrentWriteSerializationTest(t *testing.T, tester DatastoreTester)

ConcurrentWriteSerializationTest uses goroutines and channels to intentionally set up a deadlocking dependency between transactions.

func CreateAlreadyExistingTest

func CreateAlreadyExistingTest(t *testing.T, tester DatastoreTester)

CreateAlreadyExistingTest tests creating a relationship twice.

func CreateDeleteTouchTest

func CreateDeleteTouchTest(t *testing.T, tester DatastoreTester)

CreateDeleteTouchTest tests writing a relationship, deleting it, and then touching it.

func CreateTouchDeleteTouchTest

func CreateTouchDeleteTouchTest(t *testing.T, tester DatastoreTester)

CreateTouchDeleteTouchTest tests writing a relationship, touching it, deleting it, and then touching it.

func CursorErrorsTest

func CursorErrorsTest(t *testing.T, tester DatastoreTester)

func DeleteAlreadyDeletedTest

func DeleteAlreadyDeletedTest(t *testing.T, tester DatastoreTester)

DeleteAlreadyDeletedTest tests the deletion of an already-deleted relationship.

func DeleteCaveatedTupleTest

func DeleteCaveatedTupleTest(t *testing.T, tester DatastoreTester)

DeleteCaveatedTupleTest tests deleting a relationship with a caveat.

func DeleteNotExistantTest

func DeleteNotExistantTest(t *testing.T, tester DatastoreTester)

DeleteNotExistantTest tests the deletion of a non-existant relationship.

func DeleteOneThousandIndividualInOneCallTest

func DeleteOneThousandIndividualInOneCallTest(t *testing.T, tester DatastoreTester)

DeleteOneThousandIndividualInOneCallTest tests deleting 1000 relationships, individually.

func DeleteRelationshipsTest

func DeleteRelationshipsTest(t *testing.T, tester DatastoreTester)

DeleteRelationshipsTest tests whether or not the requirements for deleting relationships hold for a particular datastore.

func DeleteRelationshipsWithVariousFiltersTest

func DeleteRelationshipsWithVariousFiltersTest(t *testing.T, tester DatastoreTester)

DeleteRelationshipsWithVariousFiltersTest tests deleting relationships with various filters.

func DeleteWithLimitTest

func DeleteWithLimitTest(t *testing.T, tester DatastoreTester)

DeleteWithLimitTest tests deleting relationships with a limit.

func EmptyNamespaceDeleteTest

func EmptyNamespaceDeleteTest(t *testing.T, tester DatastoreTester)

EmptyNamespaceDeleteTest tests deleting an empty namespace in the datastore.

func InvalidReadsTest

func InvalidReadsTest(t *testing.T, tester DatastoreTester)

InvalidReadsTest tests whether or not the requirements for reading via invalid revisions hold for a particular datastore.

func LimitTest

func LimitTest(t *testing.T, tester DatastoreTester)

func MultipleReadsInRWTTest

func MultipleReadsInRWTTest(t *testing.T, tester DatastoreTester)

func NamespaceDeleteTest

func NamespaceDeleteTest(t *testing.T, tester DatastoreTester)

NamespaceDeleteTest tests whether or not the requirements for deleting namespaces hold for a particular datastore.

func NamespaceMultiDeleteTest

func NamespaceMultiDeleteTest(t *testing.T, tester DatastoreTester)

func NamespaceNotFoundTest

func NamespaceNotFoundTest(t *testing.T, tester DatastoreTester)

NamespaceNotFoundTest tests to ensure that an unknown namespace returns the expected error.

func NamespaceWriteTest

func NamespaceWriteTest(t *testing.T, tester DatastoreTester)

NamespaceWriteTest tests whether or not the requirements for writing namespaces hold for a particular datastore.

func ObjectIDsTest

func ObjectIDsTest(t *testing.T, tester DatastoreTester)

func OrderedLimitTest

func OrderedLimitTest(t *testing.T, tester DatastoreTester)

func OrderingTest

func OrderingTest(t *testing.T, tester DatastoreTester)

func QueryRelationshipsWithVariousFiltersTest

func QueryRelationshipsWithVariousFiltersTest(t *testing.T, tester DatastoreTester)

QueryRelationshipsWithVariousFiltersTest tests various relationship filters for query relationships.

func RecreateRelationshipsAfterDeleteWithFilter

func RecreateRelationshipsAfterDeleteWithFilter(t *testing.T, tester DatastoreTester)

func RelationshipCountersTest

func RelationshipCountersTest(t *testing.T, tester DatastoreTester)

func ResumeTest

func ResumeTest(t *testing.T, tester DatastoreTester)

func RetryTest

func RetryTest(t *testing.T, tester DatastoreTester)

func RevisionGCTest

func RevisionGCTest(t *testing.T, tester DatastoreTester)

RevisionGCTest makes sure revision GC takes place, revisions out-side of the GC window are invalid, and revisions inside the GC window are valid.

func RevisionQuantizationTest

func RevisionQuantizationTest(t *testing.T, tester DatastoreTester)

RevisionQuantizationTest tests whether or not the requirements for revisions hold for a particular datastore.

func RevisionSerializationTest

func RevisionSerializationTest(t *testing.T, tester DatastoreTester)

RevisionSerializationTest tests whether the revisions generated by this datastore can be serialized and sent through the dispatch layer.

func SequentialRevisionsTest

func SequentialRevisionsTest(t *testing.T, tester DatastoreTester)

func SimpleTest

func SimpleTest(t *testing.T, tester DatastoreTester)

SimpleTest tests whether or not the requirements for simple reading and writing of relationships hold for a particular datastore.

func StableNamespaceReadWriteTest

func StableNamespaceReadWriteTest(t *testing.T, tester DatastoreTester)

StableNamespaceReadWriteTest tests writing a namespace to the datastore and reading it back, ensuring that it does not change in any way and that the deserialized data matches that stored.

func StatsTest

func StatsTest(t *testing.T, tester DatastoreTester)

func TouchAlreadyExistingCaveatedTest

func TouchAlreadyExistingCaveatedTest(t *testing.T, tester DatastoreTester)

TouchAlreadyExistingCaveatedTest tests touching a relationship twice.

func TouchAlreadyExistingTest

func TouchAlreadyExistingTest(t *testing.T, tester DatastoreTester)

TouchAlreadyExistingTest tests touching a relationship twice.

func TypedTouchAlreadyExistingTest

func TypedTouchAlreadyExistingTest(t *testing.T, tester DatastoreTester)

TypedTouchAlreadyExistingTest tests touching a relationship twice, when valid type information is provided.

func TypedTouchAlreadyExistingWithCaveatTest

func TypedTouchAlreadyExistingWithCaveatTest(t *testing.T, tester DatastoreTester)

TypedTouchAlreadyExistingWithCaveatTest tests touching a relationship twice, when valid type information is provided.

func UpdateRelationshipCounterTest

func UpdateRelationshipCounterTest(t *testing.T, tester DatastoreTester)

func UseAfterCloseTest

func UseAfterCloseTest(t *testing.T, tester DatastoreTester)

func VerifyUpdates

func VerifyUpdates(
	require *require.Assertions,
	testUpdates [][]*core.RelationTupleUpdate,
	changes <-chan *datastore.RevisionChanges,
	errchan <-chan error,
	expectDisconnect bool,
)

func WatchAllTest

func WatchAllTest(t *testing.T, tester DatastoreTester)

func WatchCancelTest

func WatchCancelTest(t *testing.T, tester DatastoreTester)

WatchCancelTest tests whether or not the requirements for cancelling watches hold for a particular datastore.

func WatchCheckpointsTest

func WatchCheckpointsTest(t *testing.T, tester DatastoreTester)

func WatchSchemaTest

func WatchSchemaTest(t *testing.T, tester DatastoreTester)

func WatchTest

func WatchTest(t *testing.T, tester DatastoreTester)

WatchTest tests whether or not the requirements for watching changes hold for a particular datastore.

func WatchWithDeleteTest

func WatchWithDeleteTest(t *testing.T, tester DatastoreTester)

func WatchWithTouchTest

func WatchWithTouchTest(t *testing.T, tester DatastoreTester)

func WriteCaveatedRelationshipTest

func WriteCaveatedRelationshipTest(t *testing.T, tester DatastoreTester)

func WriteDeleteWriteTest

func WriteDeleteWriteTest(t *testing.T, tester DatastoreTester)

WriteDeleteWriteTest tests writing a relationship, deleting it, and then writing it again.

func WriteReadDeleteCaveatTest

func WriteReadDeleteCaveatTest(t *testing.T, tester DatastoreTester)

Types

type Categories

type Categories map[string]struct{}

func WithCategories

func WithCategories(cats ...string) Categories

func (Categories) GC

func (c Categories) GC() bool

func (Categories) Stats

func (c Categories) Stats() bool

func (Categories) Watch

func (c Categories) Watch() bool

func (Categories) WatchCheckpoints

func (c Categories) WatchCheckpoints() bool

func (Categories) WatchSchema

func (c Categories) WatchSchema() bool

type DatastoreTester

type DatastoreTester interface {
	// New creates a new datastore instance for a single test.
	New(revisionQuantization, gcInterval, gcWindow time.Duration, watchBufferLength uint16) (datastore.Datastore, error)
}

DatastoreTester provides a generic datastore suite a means of initializing a particular datastore.

type DatastoreTesterFunc

type DatastoreTesterFunc func(revisionQuantization, gcInterval, gcWindow time.Duration, watchBufferLength uint16) (datastore.Datastore, error)

func (DatastoreTesterFunc) New

func (f DatastoreTesterFunc) New(revisionQuantization, gcInterval, gcWindow time.Duration, watchBufferLength uint16) (datastore.Datastore, error)

type TestableDatastore

type TestableDatastore interface {
	datastore.Datastore

	ExampleRetryableError() error
}

Jump to

Keyboard shortcuts

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