/** * Command registry — single source of truth for cele2e's command structure. * Used by completion, help, and coverage tests. */ export interface CommandDef { name: string; description: string; subcommands?: SubcommandDef[]; flags?: FlagDef[]; } export interface SubcommandDef { name: string; description: string; } export interface FlagDef { name: string; description: string; } export const COMMANDS: CommandDef[] = [ { name: 'run', description: 'Run e2e tests — pass a module path or pattern, or --all / --all-modules', flags: [ { name: '--all', description: 'Full regression: every module suite + top-level e2e/tests/ (quarantined cele2e-ci-unsafe tests skipped)', }, { name: '--complete', description: 'Run EVERYTHING including quarantined (cele2e-ci-unsafe) tests — the only mode that opts into them', }, { name: '--ci-safe', description: 'Alias for the default full regression (quarantined tests skipped); kept for the nightly', }, { name: '--all-modules', description: 'Run e2e tests for all modules with e2e/ directories' }, { name: '--keep', description: 'Keep network running after tests' }, { name: '--reuse', description: 'Reuse existing network if running' }, { name: '--live', description: 'Use live (non-simulated) internet' }, { name: '--published', description: 'Use published .netapp packages' }, { name: '--notify', description: 'Desktop notification when the run finishes' }, { name: '--source-cli', description: 'Run celilo from the mounted workspace instead of the baked image (roughly doubles each command start-up)', }, { name: '--shuffle', description: 'Randomize test order to surface order-dependent bugs (seed is logged)', }, { name: '--seed=', description: 'Replay a specific --shuffle order (e.g. --seed=12345)' }, ], }, { name: 'list', description: 'List every discoverable Docker e2e test (module + top-level)', flags: [{ name: '--paths', description: 'Also show each test file path' }], }, { name: 'up', description: 'Start interactive test network', subcommands: [ { name: '--caddy', description: 'Start with caddy machine in DMZ' }, { name: '--full-stack', description: 'Start with caddy, IDP, and DB machines' }, { name: '--infrastructure', description: 'Start infrastructure only (default)' }, ], }, { name: 'down', description: 'Tear down running network', flags: [ { name: '--keep', description: 'Stop containers but preserve volumes' }, { name: '--all', description: 'Also stop competing module containers' }, ], }, { name: 'build-infra', description: 'Rebuild Docker images and package all modules as .netapps', flags: [ { name: '--save', description: 'Save Docker images to tarball after build' }, { name: '--skip-modules', description: 'Skip .netapp packaging (only rebuild Docker images)', }, ], }, { name: 'clear-timing', description: 'Clear saved timing history for test ETAs', }, { name: 'shell', description: 'Shell into a running container (default: management)', }, { name: 'status', description: 'Show run-lock holder + network status (exit 3 if busy)', flags: [{ name: '--json', description: 'Emit a machine-readable lock snapshot for polling' }], }, { name: 'doctor', description: "Check everything a run needs (baked images, base images, lock, disk) — run's implicit preflight", flags: [{ name: '--json', description: 'Emit the full report as JSON' }], }, { name: 'host', description: 'Bring the Docker host VM up/down in the shape the rig needs', subcommands: [ { name: 'status', description: 'Report the VM against the policy (exit 1 if out of policy)' }, { name: 'up', description: 'Start it, or say why a running one is out of policy' }, { name: 'down', description: 'Stop it (refuses while the e2e run-lock is held)' }, { name: 'reset', description: 'Recreate it — the only way to change mount type. DESTROYS every image', }, ], }, { name: 'last', description: "Show the most recent run's results dir and counts", flags: [ { name: '--json', description: 'Emit {runId, resultsDir, total, passed, failed} for scripting', }, ], }, { name: 'release', description: 'Free a run-lock left by --keep/up (does not tear down)', }, { name: 'load', description: 'Load cached Docker images from tarball', }, { name: 'scaffold', description: 'Generate a new test file from template', }, { name: 'version', description: 'Show cele2e version', }, { name: 'completion', description: 'Generate shell completion script', subcommands: [ { name: 'zsh', description: 'Generate zsh completion script' }, { name: 'bash', description: 'Generate bash completion script' }, ], }, ]; export const UP_PRESETS = ['--caddy', '--full-stack', '--infrastructure']; export const RUN_FLAGS = [ '--all', '--complete', '--ci-safe', '--all-modules', '--keep', '--reuse', '--live', '--published', '--notify', '--source-cli', ]; export const HOST_VERBS = ['status', 'up', 'down', 'reset']; export const DOWN_FLAGS = ['--keep', '--all']; /** Read-only reporters whose only flag is `--json`. */ export const JSON_FLAG_COMMANDS = ['status', 'doctor', 'last']; export const BUILD_INFRA_FLAGS = ['--save', '--skip-modules', '--published'];