Documentation
¶
Overview ¶
Package test provides the system-wide consistency test suite: it reads the validation files in the testconfigs directory and executes the full set of APIs against the data within, ensuring that all results of the various APIs are consistent with one another.
This package lives outside of pkg/datastore/test on purpose. The consistency harness needs to stand up a full SpiceDB cluster (via internal/testserver and pkg/cmd/server), both of which transitively import every datastore engine. The per-engine datastore tests live in internal test packages (package crdb, etc.) that import pkg/datastore/test, so placing this harness there would create an import cycle (engine test -> pkg/datastore/test -> server -> engine). No engine package imports pkg/consistency/test, so it is free to depend on the full stack.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllConsistency ¶
func AllConsistency(t *testing.T, tester dstest.DatastoreTester)
AllConsistency runs the full system-wide consistency suite against the datastore produced by the given tester. It is the consistency analog of test.All and lets any DatastoreTester be exercised by the consistency suite.
func ConsistencyForEngine ¶
func ConsistencyForEngine(t *testing.T, engineID string, tester dstest.DatastoreTester)
ConsistencyForEngine runs the system-wide consistency suite, reading in the various validation files in the testconfigs directory and executing the full set of APIs against the data within, ensuring that all results of the various APIs are consistent with one another. It runs the suite against the local and caching dispatchers and multiple dispatch chunk sizes.
The datastore under test is obtained in one of two ways:
- If tester is non-nil, it is used to create a fresh datastore for each test file. This supports running the consistency suite against any DatastoreTester.
- Otherwise, a single Docker instance is spun up for engineID (one of the supported engines: postgres, mysql, crdb, spanner) and reused across all test files.
This acts as essentially a full integration test for the API, dispatching, caching, computation and datastore layers.
Types ¶
This section is empty.