January 2020
Intermediate to advanced
640 pages
16h 56m
English
To create and wire the test suite for the CockroachDB implementation, we will follow exactly the same steps that we did for the in-memory implementation. The first step is to define a test suite that embeds the shared graphtest.SuiteBase type and register it with go test:
var _ = gc.Suite(new(CockroachDBGraphTestSuite)) type CockroachDBGraphTestSuite struct { graphtest.SuiteBase db *sql.DB } // Register our test-suite with go test. func Test(t *testing.T) { gc.TestingT(t) }
Then, we need to provide a setup method for the test suite that will create a new CockroachDB graph instance and wire it to the base suite. Following the testing paradigm we discussed in Chapter 4, The Art of ...