Documentation
¶
Overview ¶
Package storetest gives tests an isolated, migrated Postgres database.
Each call to New creates a fresh database on the server named by VX_TEST_DATABASE_URL (default: the docker-compose database) and drops it when the test ends. Tests are skipped when no server is reachable, unless VX_REQUIRE_DB is set, which CI uses to make a missing database fail.
Index ¶
Constants ¶
const DefaultURL = "postgres://vx:vx@127.0.0.1:54329/vx?sslmode=disable"
DefaultURL is the docker-compose development database.
Variables ¶
This section is empty.
Functions ¶
func AddTree ¶ added in v0.2.0
func AddTree(t testing.TB, s *store.Store, blobs blob.Store, repoID uuid.UUID, from, tree hash.Hash)
AddTree records the objects of tree that are not at the same path in from as part of the repo, as an upload with that repo would. Tests that write trees straight into a blob store call it before landing them.
func NewDatabase ¶ added in v0.2.0
NewDatabase creates a fresh, empty database (no migrations applied) and returns its URL; it is dropped when the test ends. Tests of data migrations use it with store.MigrateTo.
Types ¶
This section is empty.