storetest

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package storetest is the conformance suite every Weave store backend runs.

Each case populates the fields the dashboard reads (metadata, offsets, timestamps, tenants), because a suite that only builds empty structs tests the absence of those features. Assertions compare identities, never bare counts: a count passes when the wrong rows come back in the right number.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, open Opener)

Run runs every conformance case against the backend open returns.

func RunLegacy

func RunLegacy(t *testing.T, open Opener, plant Planter)

RunLegacy runs the cases that need rows only an older install could write, planted with plant. A custom store that never held v1.8 data can skip it.

Types

type Opener

type Opener func(t *testing.T) store.Store

Opener returns a fresh, migrated, empty store. It is called once per case.

type Planter

type Planter func(t *testing.T, s store.Store, doc *document.Document)

Planter writes doc straight into s's storage, with none of the store's checks, the way a v1.8 install wrote rows with an empty tenant. It only exists for the cases RunLegacy runs; the store API can't write such a row.

Jump to

Keyboard shortcuts

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