3.2 KiB
3.2 KiB
name, description
| name | description |
|---|---|
| mire-e2e | Record, replay, and maintain CLI end-to-end tests with mire. Use when an agent needs to create new mire scenarios, run existing e2e fixtures, rewrite golden outputs after expected CLI changes, debug replay mismatches (including CI failures), or explain mire test structure (`mire.toml`, `e2e/{scenario}/in`, `e2e/{scenario}/out`, and layered `setup.sh` fixtures). |
Mire E2E
Overview
Use this skill to drive mire workflows end-to-end in a repository that ships the mire CLI. Prefer explicit, reproducible command sequences and keep fixture changes intentional.
For command recipes and troubleshooting tables, read references/mire-workflow.md.
Preflight
- Confirm dependencies are present before running commands:
command -v bash
command -v bwrap
- Work from the project root so relative paths resolve correctly.
- Build or locate the
mirebinary if needed:
make build
./build/mire --help
Core Workflow
- Initialize or refresh mire scaffolding:
mire init
This ensures mire.toml exists and regenerates <test_dir>/shell.sh.
- Record a scenario interactively:
mire record path/to/scenario
Add --save to skip save confirmation:
mire record --save path/to/scenario
Record only paths inside configured mire.test_dir.
- Replay tests:
mire test
mire test path/to/subtree
Use scoped paths to iterate quickly.
- Rewrite golden outputs after expected behavior changes:
mire rewrite
mire rewrite path/to/subtree
Run mire test before and after rewrite to ensure only intended changes landed.
Scenario Structure
- Keep each scenario under
<test_dir>/<scenario>/. - Use fixture files:
in: recorded keystrokes/input for replayout: expected terminal output golden
- Keep scenario names stable and descriptive (
command/flag-case,error/invalid-input,nested/path).
Setup Fixtures
- Use
setup.shto prepare state inside sandbox before record/replay. - Place
setup.shat test root and/or nested directories. - Expect layered execution from test root down to scenario directory.
- Keep setup scripts idempotent and deterministic.
Configuration Notes
- Read and update
mire.tomlas needed:mire.test_dir: scenario root (defaulte2e)mire.ignore_diffs: regexes for lines that may varysandbox.home,sandbox.mounts,sandbox.paths: sandbox host exposure
- Keep
sandbox.homeabsolute and mount/path entries valid on host.
Agent Patterns
- Create a new test safely:
mire init
mire record --save some/scenario
mire test some
- Update expected output safely after intentional UX/style changes:
mire test some/scenario
mire rewrite some/scenario
mire test some/scenario
- Investigate failures:
- Capture the first mismatch line from
mire test. - Verify whether output change is intentional.
- Rewrite only if expected; otherwise adjust setup/commands or underlying CLI behavior.
Limits
- Treat mire as Linux-focused due to
bash+bwraprequirements. - Keep test expectations deterministic; avoid time-sensitive or environment-variant output unless ignored by
mire.ignore_diffs.