test

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GCCategory    = "GC"
	WatchCategory = "Watch"
)

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

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

DeleteNotExistantTest tests the deletion of a non-existant relationship.

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 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 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 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 WatchCancelTest

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

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

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

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