e2e

command
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package main provides a test-only CLI binary for E2E/BDD testing of framework features.

Why it exists: it lets us write contrived scenarios for the framework that a downstream tool inherits (init, doctor, config, update, chat, controls, signals, bootstrap) WITHOUT baking test fixtures into the real, shipped binary. It enables ALL feature-flagged commands. It is NOT shipped — goreleaser only builds ./cmd/gtb.

Self-update flows are network-free under test: when GTB_E2E_RELEASE_SCENARIO is set, applyReleaseStub (release_stub.go) injects an in-memory stub release source (pkg/vcs/release/releasetest) onto the tool and pins a deterministic current version, so `gtb update` scenarios resolve releases from memory. When the env var is unset the configured GitLab source is used as normal.

IMPORTANT — when NOT to use this binary: because it ENABLES InitCmd, the framework bootstrap REQUIRES a config file (init is how a tool's first config is created), so scenarios driving this binary must provide one. Conversely, gtb's own command-line tooling — generate, regenerate, remove, keys — is tested against ./cmd/gtb, which DISABLES InitCmd and runs config-free (allow-empty bootstrap), matching production. Driving the generator through this InitCmd-enabled binary wrongly demands a config file: green locally (ambient ~/.config/gtb config), red in CI's clean environment. Generator scenarios use support.GeneratorBinaryPath() (./cmd/gtb), not this binary.

See docs/development/testing/index.md § "E2E test binaries".

Jump to

Keyboard shortcuts

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