test

package
v1.30.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

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 added in v1.24.0

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 added in v1.30.0

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

func BulkUploadErrorsTest added in v1.22.0

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

func BulkUploadTest added in v1.22.0

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

func CaveatNotFoundTest added in v1.16.2

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

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

func CaveatSnapshotReadsTest added in v1.14.0

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

func CaveatedRelationshipFilterTest added in v1.14.0

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

func CaveatedRelationshipWatchTest added in v1.14.0

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

func ConcurrentRevisionsTest added in v1.29.1

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 added in v1.12.0

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

CreateAlreadyExistingTest tests creating a relationship twice.

func CreateDeleteTouchTest added in v1.24.0

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

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

func CreateTouchDeleteTouchTest added in v1.24.0

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

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

func CursorErrorsTest added in v1.21.0

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

func DeleteAlreadyDeletedTest added in v1.12.0

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

DeleteAlreadyDeletedTest tests the deletion of an already-deleted relationship.

func DeleteCaveatedTupleTest added in v1.30.0

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

DeleteCaveatedTupleTest tests deleting a relationship with a caveat.

func DeleteNotExistantTest added in v1.12.0

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

DeleteNotExistantTest tests the deletion of a non-existant relationship.

func DeleteOneThousandIndividualInOneCallTest added in v1.30.0

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 added in v1.30.0

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

DeleteRelationshipsWithVariousFiltersTest tests deleting relationships with various filters.

func DeleteWithLimitTest added in v1.30.0

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 added in v1.21.0

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 added in v1.14.0

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

func NamespaceNotFoundTest added in v1.16.2

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 added in v1.20.0

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

func OrderedLimitTest added in v1.21.0

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

func OrderingTest added in v1.21.0

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

func QueryRelationshipsWithVariousFiltersTest added in v1.30.0

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

QueryRelationshipsWithVariousFiltersTest tests various relationship filters for query relationships.

func ResumeTest added in v1.21.0

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

func RetryTest added in v1.22.0

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

func RevisionGCTest added in v1.18.0

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 added in v1.14.0

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 added in v1.29.1

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 added in v1.13.0

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 added in v1.22.0

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

TouchAlreadyExistingCaveatedTest tests touching a relationship twice.

func TouchAlreadyExistingTest added in v1.12.0

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

TouchAlreadyExistingTest tests touching a relationship twice.

func UseAfterCloseTest added in v1.27.0

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

func VerifyUpdates added in v1.30.0

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

func WatchAllTest added in v1.29.0

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 added in v1.29.0

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

func WatchSchemaTest added in v1.29.0

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 added in v1.29.0

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

func WatchWithTouchTest added in v1.22.0

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

func WriteCaveatedRelationshipTest added in v1.14.0

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

func WriteDeleteWriteTest added in v1.12.0

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

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

func WriteReadDeleteCaveatTest added in v1.14.0

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

Types

type Categories added in v1.24.0

type Categories map[string]struct{}

func WithCategories added in v1.24.0

func WithCategories(cats ...string) Categories

func (Categories) GC added in v1.24.0

func (c Categories) GC() bool

func (Categories) Watch added in v1.24.0

func (c Categories) Watch() bool

func (Categories) WatchCheckpoints added in v1.29.0

func (c Categories) WatchCheckpoints() bool

func (Categories) WatchSchema added in v1.29.0

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 added in v1.22.0

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