storetest

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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 New

func New(t testing.TB) *store.Store

New returns a migrated store on a fresh database.

func NewDatabase added in v0.2.0

func NewDatabase(t testing.TB) string

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.

Jump to

Keyboard shortcuts

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