fmtfixture

command
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Command fmtfixture regenerates the frozen on-disk fixtures used by the rolling-upgrade compatibility tests in store/wal, store/snapshot, and store/csrfile. Run it whenever a writer in one of those packages changes the on-disk shape; commit the refreshed fixtures alongside the writer change.

Usage:

go run ./cmd/fmtfixture            # refresh every fixture
go run ./cmd/fmtfixture -pkg wal   # refresh just the WAL fixture

The fixtures themselves live under each package's testdata/v<N>/ tree and are read by *_compat_test.go in that same package.

store/csrfile is an exception: do NOT refresh it

store/csrfile/testdata/v1/sample.csr must stay exactly as committed, and -pkg all overwrites it. Its value is that an OLDER build wrote it, so refreshing it deletes the only guarantee it carries; and its payload is not reproducible even in principle, because the build that wrote it drew a fresh random shard-hash seed per process. csrfile.TestCompat_V1FixtureMaps pins the file's SHA-256 and fails if it changes — see that test's docstring for the full account (rmp #2752). When a csrfile format change makes the v1 sample genuinely unreadable, add a v2 fixture beside it rather than regenerating this one.

Jump to

Keyboard shortcuts

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