testfixture

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package testfixture builds deterministic on-disk fixtures shared by tests and benchmarks. It is internal so fixture helpers do not become public API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LargeSaga

type LargeSaga struct {
	Root        string
	Repository  string
	Base        string
	Head        string
	Chapters    int
	Sections    int
	Fragments   int
	Markdown    int
	SVG         int
	HTML        int
	Atoms       int
	Mappings    int
	References  int
	DiffFiles   int
	Reviews     int
	Threads     int
	DiffReviews int

	// CoverageRangeWidth and CoverageTargets are the resolved shape, with
	// zero-valued options replaced by the defaults they select.
	CoverageRangeWidth int
	CoverageTargets    int

	// MaxTargetReferences is the largest number of diff references a single
	// target owns. It is the concentration dimension reader scale benchmarks
	// vary while holding atoms and total references constant.
	MaxTargetReferences int
}

LargeSaga describes the generated fixture and its exact scale.

func GenerateLargeSaga

func GenerateLargeSaga(ctx context.Context, parent string, options LargeSagaOptions) (LargeSaga, error)

GenerateLargeSaga creates a source Git repository and a fully covered saga beneath parent. Given the same options, the saga bytes and Git object IDs are stable across runs.

type LargeSagaOptions

type LargeSagaOptions struct {
	Chapters            int
	SectionsPerChapter  int
	FragmentsPerSection int
	SourceFiles         int
	ChangedLinesPerFile int
	ReviewsPerFragment  int
	Threads             int
	DiffReviews         int

	// CoverageRangeWidth is how many consecutive changed lines one diff
	// reference covers. Zero selects coverageRangeWidth. One deliberately
	// produces the fragmented per-line shape that the authoring API now
	// canonicalizes, so reader benchmarks can defend against adversarial input.
	CoverageRangeWidth int

	// CoverageTargets is how many fragments receive evidence. Zero spreads it
	// across every generated fragment, which gives each target a handful of
	// references. A small number reproduces a real saga, where a few narrative
	// targets own thousands of the comparison's atoms.
	CoverageTargets int
}

LargeSagaOptions controls the scale of a generated source comparison and saga. Zero-valued fields are rejected so benchmarks cannot silently shrink.

func DefaultLargeSagaOptions

func DefaultLargeSagaOptions() LargeSagaOptions

DefaultLargeSagaOptions is intentionally large enough to catch nonlinear behavior while remaining practical for local benchmark iteration.

Jump to

Keyboard shortcuts

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