d0ugal / d0ugal/graith

feat: declarative TUI end-to-end test harness (testty-style)

Open
#630 0 comments 0 reactions 0 assignees View on GitHub
enhancement size: L testing
Dominant language
Go
Stars
2
Forks
0
Avg merge
5h 49m
Merged PRs (30d)
189

Description

## Idea: declarative TUI end-to-end test harness (testty-style)

### Current state

graith already has good test coverage at two layers: a **daemon integration harness** (`internal/integration/integration_test.go`, `//go:build integration`, drives `SessionManager` + `Server` over a socket) and **PTY-level unit tests** (`internal/pty/*_test.go`, including render and scrollback tests).

### Gap

There's no higher-level **declarative TUI end-to-end** harness that drives the real `gr` TUI through a PTY. agentty ships exactly this ("testty"): YAML scenarios, predicate-driven waits ("eventually the screen contains X"), frame/screen snapshot assertions, and shareable **proof artifacts** (text/HTML/GIF, content-hash cached).

### Proposal

A declarative TUI E2E harness for graith's interactive surfaces — the session picker/overlay, the approval overlay, the dashboard, and the attach/passthrough flow — that today only have unit coverage. Scenarios spawn `gr`, send keystrokes, and assert on rendered frames, producing reviewable artifacts in CI.

### Notes / open questions

- This is dev-infra, not a user feature — but the interactive surfaces are exactly where regressions hide.
- Build on the existing `internal/pty` render/vterm machinery for frame capture.
- Scope: assertion model (substring vs full-frame snapshot), artifact format, flake-resistance (predicate waits, not fixed sleeps).

_Source: agentty `testty` PTY-driven E2E framework (competitive analysis)._

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading internal/integration/integration_test.go and the render and scrollback tests under internal/pty to understand the existing harnesses and frame machinery. Then inspect how the gr TUI exposes the session picker, approval overlay, dashboard, and attach/passthrough flow. Done means declarative scenarios can drive gr through a PTY, wait on predicates, assert frames or snapshots, and produce reviewable CI artifacts.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, devtools, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.