purgetest

package
v0.72.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package purgetest seeds and inspects the Spec 116 removal purge set (data-model.md §PurgeSet) for tests. It reads bbolt directly with its own key-match rules, independent of the production purge, so a test that uses it checks the purge rather than restating it.

Index

Constants

View Source
const (
	Upstream        = "upstreams"
	Identities      = "server_identities"
	ToolCalls       = "tool_call_buckets"
	ToolApprovals   = "tool_approvals"
	PromptApprovals = "prompt_approvals"
	OAuthTokens     = "oauth_tokens"
	OAuthCompletion = "oauth_completion"
	Baselines       = "integrity_baselines"
	ScanReports     = "security_reports"
	ScanJobs        = "security_scan_jobs"
	ScanJobIndex    = "security_scan_job_index"
	ToolHash        = "toolhash"
	ToolBaseline    = "tool_baseline_decisions"
)

Bucket labels used in Counts.

Variables

This section is empty.

Functions

func AssertPurged

func AssertPurged(t *testing.T, mgr *storage.Manager, name, path string)

AssertPurged fails the test for every purge-set bucket that still holds a key of name.

func AssertSeeded

func AssertSeeded(t *testing.T, mgr *storage.Manager, name string)

AssertSeeded fails the test unless every seeded bucket holds at least one key of name (the fixture precondition).

func Counts

func Counts(t *testing.T, mgr *storage.Manager, name string) map[string]int

Counts returns, per purge-set bucket, how many keys belong to name.

func OAuthKey

func OAuthKey(name string) string

OAuthKey returns a token key in the oauth.GenerateServerKey format (name + "_" + 16 lowercase hex) without importing the oauth package.

func Seed

func Seed(t *testing.T, mgr *storage.Manager, name string)

Seed writes one record of every purge-set kind for name (not the upstream row, which the commit owns). Every record identifies the server only by name, as production does.

Types

This section is empty.

Jump to

Keyboard shortcuts

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