Commit Graph
11 Commits
Author SHA1 Message Date
Willie 7d4a6fd282 fix(runbook): address code review findings
- Guard TUI Init() against empty steps (prevents panic)
- Fix plainFailReason for negated assertions (align with TUI logic)
- Add pipefail to bash executor for pipeline error detection
- Remove unused RunOptions.TUI field
2026-03-11 04:53:08 +08:00
Willie 336bdb9e25 test(runbook): integration tests with self-contained and real runbook parsing
Three integration tests:
- SelfContainedRunbook: 3 bash steps through RunRunbook, verifies 3/3 pass + valid JSON
- ParseAllRealRunbooks: parses all 17 runbooks, checks titles/steps/classification
- DryRunAllRunbooks: dry-runs all 17 runbooks, verifies all steps skipped
2026-03-11 04:53:08 +08:00
Willie a1ba7eae6e feat(runbook): plain text reporter for single and batch output
WriteSingleReport prints per-step results with status icons,
duration, and failure reasons. WritePlainSummary aggregates
multiple runbook results into a compact batch summary.
2026-03-11 04:53:08 +08:00
Willie e53ca07639 feat(runbook): CLI entry with --report json, --dry-run, --no-tui flags
Replace placeholder main.go with full CLI that supports:
- Single file or directory of *_runbook.md files
- TUI mode (default for single files), plain text, and JSON output
- --dry-run for parse-and-classify without execution
- Per-step timeout with --timeout flag
- Exit code 1 on any failure
2026-03-11 04:53:08 +08:00
Willie a4343df41d feat(runbook): runner engine wires parser, classifier, executor, and assertions 2026-03-11 04:53:08 +08:00
Willie 67ceed3270 feat(runbook): JSON report writer 2026-03-11 04:53:08 +08:00
Willie 377aa0bafc feat(runbook): assertion matcher with negation and case-insensitive matching 2026-03-11 04:53:08 +08:00
Willie f919bfb7ae feat(runbook): bash executor with stdout/stderr capture and timeout
Execute() runs step commands via bash -e -c, captures stdout/stderr
separately, extracts exit codes via syscall.WaitStatus, and handles
context timeout/cancellation. Merged code blocks (---) are joined
before execution. Six tests cover echo, exit codes, multiline,
timeout, stderr capture, and merged blocks.
2026-03-11 04:53:08 +08:00
Willie c848309c78 feat(runbook): step classifier categorizes auto/manual execution 2026-03-11 04:53:08 +08:00
Willie 173c09d67b feat(runbook): markdown parser extracts steps, code blocks, and expected assertions
Line-by-line state machine parser (bufio.Scanner + regex) that handles all
17 real E2E runbook files. Supports multiple heading formats (## Step N,
### N., ### Nb., double-labeling), multi code blocks per step (merged with
\n---\n separator), Expected/bold-Expected variants, inline markdown
stripping, and stops at Pass/Fail Criteria sections.
2026-03-11 04:53:08 +08:00
Willie b2a9ebbaab feat(tools): scaffold runbook test runner with types 2026-03-11 04:53:08 +08:00