Help us shape the future of Go! Take the 2026 Go Developer Survey

selftest

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package selftest runs isolated local checks included in the Engram binary.

Index

Constants

View Source
const (
	SuiteAll         = "all"
	SuiteReliability = "reliability"
	SuitePerformance = "performance"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Suite string
	Quick bool
}

Options controls an isolated self-test run.

type Report

type Report struct {
	SchemaVersion string     `json:"schema_version"`
	Suite         string     `json:"suite"`
	Quick         bool       `json:"quick"`
	Passed        bool       `json:"passed"`
	DurationMS    int64      `json:"duration_ms"`
	Scenarios     []Scenario `json:"scenarios"`
}

Report is the stable top-level JSON shape emitted by `engram test --json`.

func Run

func Run(options Options) Report

Run executes the selected local-only self-test suite. Every run owns a new temporary directory and never reads the configured Engram data directory.

type Scenario

type Scenario struct {
	Name       string             `json:"name"`
	Suite      string             `json:"suite"`
	Passed     bool               `json:"passed"`
	DurationMS int64              `json:"duration_ms"`
	Error      string             `json:"error,omitempty"`
	Metrics    map[string]float64 `json:"metrics,omitempty"`
}

Scenario records one self-test result. Performance scenarios include their operation count and throughput in Metrics; no timing threshold determines pass or fail.

Jump to

Keyboard shortcuts

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