storetest

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: BSD-3-Clause Imports: 8 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 opens throw-away stores for tests. It imports "testing", so only test code imports it, never the program.

Index

Constants

View Source
const LargeDemoEnv = "CLOWDER_BENCH_DB"

LargeDemoEnv is the environment variable that names the database file of a large demo (`clowder demo -size large`, SPEC §10) for the benchmarks.

Variables

This section is empty.

Functions

func Open

func Open(tb testing.TB, clk clock.Clock) *store.Store

Open returns a Store on a new, empty database in a file of the test's temporary directory, migrated and using clk. Each call gets its own database, so tests do not see each other's rows, not even in parallel. The Store is closed when the test ends. A failure stops the test.

func OpenLarge

func OpenLarge(tb testing.TB, clk clock.Clock) *store.Store

OpenLarge opens a copy of the large demo database that LargeDemoEnv names, in the test's temporary directory, so that the benchmark never changes the original. It skips the test or benchmark with a message when the variable is not set, which keeps the benchmarks out of the default test run. The Store is closed when the test ends. A failure stops the test.

Types

This section is empty.

Jump to

Keyboard shortcuts

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