diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-04 16:50:10 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-04 17:04:36 -0300 |
| commit | 2693c24cf44b8788ec26f98eeedc4d74b5ac98de (patch) | |
| tree | 4464a03090122f03e221b3d6e6e05577e806625a /build.zig | |
| parent | be3985092df1c3388cfa09ca5e989d2fa66f55ec (diff) | |
| download | pardes-2693c24cf44b8788ec26f98eeedc4d74b5ac98de.tar.gz pardes-2693c24cf44b8788ec26f98eeedc4d74b5ac98de.zip | |
test: the 9P monkey at T1 and the agent driver's interaction checks at T2, for the Python ports: test/monkey9p.zig (was test/monkey9p.py) drives an in-process Session with random 9P requests, every op drawn from the seed alone (panes, columns, stale serials and held files as tokens resolved when the op runs), so --seed/--steps replay a run, --only replays any subset of its steps and a failure shrinks by delta debugging over them; each run is a child of the program in a throwaway root (its HOME, XDG directories and dump), so a panic or a hang is a failure reported and shrunk like the rules' (one failure rule, close runs only line files, /index matching /pane, chunked reads equal whole, the log marker); the 9P engine's own refusals and OTRUNC's truncation made by the monkey, Session doing no effects; steps monkey-session and monkey-session-smoke, the smoke part of behaviour-test; Session's mky helpers walk, ask (a raw request answering errno, held or bytes) and ended; test/process/terminals.zig, three cases of test/agent_session_test.py (a prompt that settles, input shown and ^U taking the screen back; history past a screenful in the body; a raw-mode control byte through pty/data), the driver's own argument, output, timeout and cleanup checks left in Python; monkey9p.py deleted; each checked to fail against a break: serveFs not noting a pane file's err (one failure rule), noting it twice (one failure rule's upper bound), a msg beside a refused pane write (its msg clause), /pane leaving out serial 3 (index matching pane dirs), stagedReply skipping a byte past offset 0 on small reads (chunked equals whole), a panic in pty/run's write (a crash, shrunk 377 -> 3 ops), the root ctl taking an unknown word (the log marker), pty/data dropping a lone control byte (raw key), a 4 KiB terminal scrollback (history, raw key), pty/data dropping a write's last byte (all three terminal cases)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -1893,6 +1893,29 @@ pub fn build(b: *std.Build) void { const behaviour_test_step = b.step("behaviour-test", "run the behavioural tests, through the 9P tree alone (test/behaviour/)"); behaviour_test_step.dependOn(&run_behaviour_tests.step); if (testMatch(b, unit_profile, test_filters, behaviour_test_step)) |check| check.addArtifactArg(behaviour_tests); + // The 9P monkey at T1 (test/monkey9p.zig): random requests against + // an in-process session, the documented rules checked after each. + // Its fixed-seed smoke run is part of behaviour-test. + const monkey_session = b.addExecutable(.{ + .name = "pardes-monkey-session", + .root_module = b.createModule(.{ + .target = target, + .optimize = optimize, + .root_source_file = b.path("test/monkey9p.zig"), + .link_libc = true, + }), + }); + monkey_session.root_module.addImport("session", session_module); + const run_monkey_session = b.addRunArtifact(monkey_session); + run_monkey_session.addPassthruArgs(); + run_monkey_session.has_side_effects = true; + b.step("monkey-session", "random 9P requests against an in-process session, checking the documented rules (-- [--seed N]... [--steps M] [--only i,j,k] [--no-shrink] [-v])").dependOn(&run_monkey_session.step); + const run_monkey_session_smoke = b.addRunArtifact(monkey_session); + run_monkey_session_smoke.addArg("--smoke"); + run_monkey_session_smoke.has_side_effects = true; + const monkey_session_smoke_step = b.step("monkey-session-smoke", "a short fixed-seed run of monkey-session (part of behaviour-test)"); + monkey_session_smoke_step.dependOn(&run_monkey_session_smoke.step); + if (test_filters.len == 0) behaviour_test_step.dependOn(&run_monkey_session_smoke.step); // Kitty graphics conformance at the core: what a terminal pane's // program sends, what it reads back, what ghostty stores and what a |
