Documentation
¶
Overview ¶
Package cmdtest is the shared test harness for rde command groups. It replaces five near-duplicate per-package `run` helpers (one apiece for session/template/savedinput/stack/machinetype in the reference implementation) with a single Run, adapted to how this repo actually resolves token/format/workspace: token from auth.yaml/BITRISE_TOKEN via cmdutil.ResolveToken, format from a real --format flag, workspace from flag/env/config layering — none of which live on a single flat struct the way the reference's config.Resolved does.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunIsolated ¶
RunIsolated sandboxes a package's tests with a temp XDG_CONFIG_HOME (so the token-refresh path never touches a developer's real auth.yaml) and a no-op analytics tracker (LogCommandParameters needs one set globally — see cli/app/main_test.go). Use from a package TestMain:
func TestMain(m *testing.M) { os.Exit(cmdtest.RunIsolated(m)) }
Every env var below reaches a command through a cli/cmdutil resolver rather than through config.WithResolved, so a developer who exports one would get different results than CI: an ambient BITRISE_WORKSPACE_ID alone silently redirects every request a test asserts a path for.