shared_test

package
v0.0.0-...-0933bec Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunFeatureStoreConcurrentModificationTests

func RunFeatureStoreConcurrentModificationTests(t *testing.T, store1 ld.FeatureStore, store2 ld.FeatureStore,
	setStore1UpdateHook func(func()))

RunFeatureStoreConcurrentModificationTests runs tests of concurrent modification behavior for store implementations that support testing this.

store1: A FeatureStore instance.

store2: A second FeatureStore instance which will be used to perform concurrent updates.

setStore1UpdateHook: A function which, when called with another function as a parameter, will modify store1 so that it will call the latter function synchronously during each Upsert operation - after the old value has been read, but before the new one has been written.

func RunFeatureStorePrefixIndependenceTests

func RunFeatureStorePrefixIndependenceTests(t *testing.T,
	makeStoreWithPrefix func(string) (ld.FeatureStore, error),
	clearExistingData func() error)

RunFeatureStorePrefixIndependenceTests is for feature store implementations that support storing independent data sets in the same database by assigning a different prefix/namespace to each one. It verifies that two store instances with different prefixes do not interfere with each other's data.

makeStoreWithPrefix: Creates a FeatureStore instance with the specified prefix/namespace, which can be empty. All instances should use the same underlying database. The store should not have caching enabled.

clearExistingData: Removes all data from the underlying store.

func RunFeatureStoreTests

func RunFeatureStoreTests(t *testing.T, storeFactory func() (ld.FeatureStore, error), clearExistingData func() error, isCached bool)

RunFeatureStoreTests runs a suite of tests on a feature store.

  • makeStore: Creates a new feature store instance, but does not call Init on it.
  • clearExistingData: If non-nil, this function will be called before each test to clear any storage that the store instances may be sharing. If this is nil, it means store instances do not share any common storage.
  • isCached: True if the instances returned by makeStore have caching enabled.

Types

This section is empty.

Jump to

Keyboard shortcuts

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