testenv

package
v0.63.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 3 Imported by: 0 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 testenv makes a test binary hermetic: HOME, the ledger, the asks and run dirs under one temp root, the developer's git config and shell environment ignored. It imports nothing from this module, so any package's tests may use it; cmd/f10's tests check its paths against the real ones.

Index

Constants

This section is empty.

Variables

View Source
var Cleared = []string{
	"XDG_CONFIG_HOME", "F10_STATE_DIR", "F10_USER_DIR", "CLAUDE_CONFIG_DIR", "GH_CONFIG_DIR", "GLAB_CONFIG_DIR",
	"F10_DRIVE_FILE", "F10_AGENT_MODEL", "F10_AGENT_VIA", "F10_AGENT_SESSION",
	"F10_SESSION_ID", "CLAUDE_CODE_SESSION_ID", "CLAUDECODE",
	"HERDR_ENV", "HERDR_WORKSPACE_ID",
	"F10_ROOTS", "F10_STATE_TTL", "F10_STATE_DEBUG",
	"F10_PLUGIN_ROOT", "CLAUDE_PLUGIN_ROOT",
	"F10_STANDUP_RECORD", "F10_BOARD_RECORD", "F10_STATUS_GLYPHS",
	"XDG_RUNTIME_DIR",
}

Cleared is the environment the developer's shell may set, which would otherwise leak into the tests. The dir overrides among it are cleared, not pinned, so they follow HOME and a test that moves HOME moves them too.

View Source
var Root string

Root holds every user-level dir for the run, so a test that sets nothing still never reads or writes the developer's own HOME.

Functions

func Home

func Home() string

Home is the HOME the tests run under.

func Main

func Main(m *testing.M)

Main sets the environment up, runs the tests and exits with their code.

func Setup

func Setup() func()

Setup makes Root and points the user-level dirs into it, returning what removes them. A TestMain that also swaps seams calls it before m.Run.

func UserDir

func UserDir() string

UserDir is the user's f10 dir under Home, where the notify switch lives.

Types

This section is empty.

Jump to

Keyboard shortcuts

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