matrix

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 10 Imported by: ? 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: tests/matrix / conformance type: test job: the cross-backend agreement matrix — build one deterministic archive into every available backend, run the shared RQL corpus against each, and assert every backend's answer matches the reference's limits: correctness only, never timing (-> tests/performance); it asks whether an answer is right, never how a backend produced it — routing, lowering, and cache tiers are the backend's business

Two backends must answer a query identically; a divergence is a conformance bug in at least one. Run it over your own rows with matrix.Run(t, Config{Rows: ...}).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseFixtures

func CloseFixtures()

CloseFixtures releases every shared archive. TestMain calls it once the run is over: the instances outlive the tests that built them, so no test can close them.

func Each

func Each[T any](t *testing.T, r Recipe[T], check func(*testing.T, ranke.Universe, T))

Each runs check over every row this run asks for, against the archive r builds — the package's one row iteration.

func Opens

func Opens() int

Opens counts the backends opened for fixtures so far. A test asserts on it, so a change that reopens a row per test shows up as a number rather than as minutes.

func Rows

func Rows(t *testing.T) []backends.Backend

Rows is the row set this run asks for (RANKE_ROWS, all of them when unset). An unresolvable name fails the test: a mistyped row would otherwise narrow it silently.

func Run

func Run(t *testing.T, cfg Config)

Run builds one deterministic archive into the reference and every available row, then asserts each row answers the corpus identically, in stream order.

Types

type Config

type Config struct {
	// Reference is the engine every row is compared against; the zero value is
	// backends.Reference(), the in-memory store on the reference executor.
	Reference *backends.Backend
	// Rows are the backends under test; nil means the set the run asks for. The row
	// named like the reference drops out — nothing is compared to itself.
	Rows []backends.Backend
	// Size is the generator size knob; 0 means defaultSize.
	Size int
	// Only narrows the run to the one corpus entry with this name — the focus
	// mode for isolating a single divergence. Empty runs the whole corpus.
	Only string
}

Config parameterises an agreement run.

type Recipe

type Recipe[T any] struct {
	Key   string
	Build func(context.Context, ranke.Universe) (T, error)
}

Recipe builds one archive into a universe. Key is its identity — one key, one instance, shared by every test that asks, so those tests must only READ it.

func FromSpec

func FromSpec(spec generator.Spec) Recipe[*generator.Manifest]

FromSpec is the recipe for a generator spec. The spec is the key: one spec yields one archive, ids included, by the generator's contract.

Jump to

Keyboard shortcuts

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