Skip to content

test(suite): a real test suite, ./formtools test and CI for it (0.14.0) - #16

Merged
nodemode-ai merged 14 commits into
mainfrom
test/suite-0.14.0
Nov 24, 2026
Merged

nodemode-ai merged 14 commits into
mainfrom
test/suite-0.14.0

Conversation

@nodemode-ai

Copy link
Copy Markdown
Contributor

test(suite): a real test suite, ./formtools test and CI for it (0.14.0)

Summary

  • formtools gets 1,244 new test cases: 253 for the interface (vitest with happy-dom, frontend/tests/unit) and 991 for the engine (pytest against the real FastAPI app, backend/tests). With the 90 cases that were already here, 1,334 pass.
  • ./formtools test runs both layers, ./formtools test unit or ./formtools test engine runs one. CI runs them in one job, test; the pytest step moved there from the backend job.
  • docs/TESTING.md holds the five rules a test must meet; CLAUDE.md and AGENTS.md have a tests line that points to them.
  • No app code changed. Two cases stay as strict expected failures whose reason starts with DEFECT:: the environment.d writer leaves $ unescaped, where environment.d(5) says to write $$; a copy job that fails because ffmpeg is missing leaves an empty reserved output file beside the source.
  • vitest 5.0.5 and happy-dom 21.0.4 are new development dependencies with a row in NOTICE.md; neither ships.

Commits

  • test(foundation): vitest and happy-dom for interface tests (0.14.0)
  • docs(testing): the rules a test must meet and where tests live (0.14.0)
  • test(runner): ./formtools test runs the unit and engine layers (0.14.0)
  • ci(tests): one job, test, runs the two layers one step each (0.14.0)
  • test(agents): mcp json-rpc and tool shapes, mcp and http agreement, window bridge order, terminal refusals (0.14.0)
  • test(batch): batch rename previews and real renames with undo, regex guard, presets, batch runs over a folder and the worker pool (0.14.0)
  • test(core): file-system routes, jobs, error shape, host and window-key guard, config, settings seal, engine log and port file, file families and media types, tool registry, and the cli, mcp stdio bridge and mcpb programs (0.14.0)
  • test(docview): text, csv table, json tree, hex, markdown viewers and 3d model loading and bounds (0.14.0)
  • test(files): archives made and read back, safe extraction, hashes, text encodings and counts, csv and sqlite reading, fonts, safety limits (0.14.0)
  • test(image): edit, turn, orientation tag, info, rating sidecar, radiance tone mapping and refusals through the image routes (0.14.0)
  • test(media): video and audio status, probe, thumbnails, waveforms, subtitles, snapshots, copy jobs and streaming, metadata reading, and 3d model info, view, assets and conversion (0.14.0)
  • test(ui): tool forms, jobs panel, save dialog, checksums, break timer overlay, agent consent dialog and engine client (0.14.0)
  • test(utilities): disk usage, duplicate finder, walk limits, empty and broken file scans, templates, trash refusals, hosts file, environment profile, elevation refusal and thumbnails (0.14.0)
  • chore(release): version 0.14.0 (0.14.0)

The short hashes are left out because signing changes them.

Version

v0.14.0 (the release commit is last). The version moves to 0.14.0 in backend/app/init.py, frontend/package.json, frontend/package-lock.json, frontend/src/version.ts, setup/cli.py, setup/mcp_stdio.py, setup/mcpb/manifest.json, src-tauri (Cargo.toml, Cargo.lock, tauri.conf.json), the README badge, CLAUDE.md and AGENTS.md, each by hand. CHANGELOG.md describes 0.14.0. Ran: ./formtools agents check (clean), ./formtools test unit (253 passed) and ./formtools test engine (1081 passed, 1 skipped, 2 expected failures). Not run: the browser demo was not rebuilt, the desktop shell, macOS and Windows.

Checks

Ran: ./formtools agents check (clean), ./formtools test unit (253 passed) and ./formtools test engine (1081 passed, 1 skipped, 2 expected failures).
From a clean clone of this branch: npm ci in frontend with the stock npm of Node 22, then npx vitest run: npm ci ok
Tests 253 passed (253).
Sampled expected values were flipped in every lane to see the tests fail, then restored.

Not run: the browser demo was not rebuilt, the desktop shell, macOS and Windows. The workflow itself has not run on GitHub; the .bat runner has not run on Windows.

Merging

Merge with a merge commit so each commit and its signature stays. Do not squash.

frontend/vitest.config.ts runs tests/unit/**/*.test.ts in happy-dom. vitest 5.0.5 and happy-dom 21.0.4 are development dependencies, the versions FormCAD uses; neither ships. Ran: one probe test under npx vitest run, passed.
docs/TESTING.md says how to run the tests, the two layers (unit with vitest, engine with pytest), where an area's tests live, the five rules, what is not accepted and the DEFECT: rule. CLAUDE.md and AGENTS.md gain the tests rule, CONTRIBUTING.md points at the page, NOTICE.md lists vitest and happy-dom as test only, and setup/HASHOUT_LOG.md records the runner. No app code changed; nothing was run for this commit.
setup/test and setup/test.bat run vitest in frontend (unit) and pytest on backend/tests with the backend venv (engine); nothing or all runs both, an unknown layer exits 2 with a sentence, and the rest of the line goes to the runner. The launchers dispatch test and list it in their usage text. The script installs nothing and says what to install when the venv, node_modules, pytest or httpx is missing. Run: bash -n on both scripts; ./formtools test nope exited 2; ./formtools test engine passed 90 tests; ./formtools test unit started vitest, which found no test files yet. Not run: test.bat, no Windows here.
The new job test installs the frontend with npm ci and the engine with pip, then runs vitest and pytest as separate steps so the failing step names the layer. The pytest step that closed the backend job is removed from it, since the new job runs the same tests. The shell syntax step already covers setup/test through its setup/* list. Checked: the workflow parses as YAML. Not run: the workflow itself.
…indow bridge order, terminal refusals (0.14.0)

Drives the real app in process through POST /mcp, the HTTP routes, the /api/live window socket and the terminal routes: replies are checked against JSON-RPC 2.0 and the MCP tool-listing and tool-call shapes, every listed tool is called and must refuse missing or wrong-typed arguments with a sentence, MCP tools must give the same answer as their HTTP routes, run events must reach the window in order with the window's answer returned, and terminal routes must refuse callers without the window key or from another origin. Expected values come from the JSON-RPC 2.0 and MCP rules, the tools' own published schemas, files written in tmp_path, hashlib, and two independent paths that must agree. Ran: venv/bin/python -m pytest tests/agents -q -p no:cacheprovider, 87 passed, 0 expected failures.
…guard, presets, batch runs over a folder and the worker pool (0.14.0)

Drives the rename, preset and batch routes of the real app against files in tmp_path and checks the names, the file contents (multiset before equals after), the refusals with their messages, and the written pictures; expected values come from the rules of each rename rule worked out by hand, pixel and size arithmetic, the BMP header read byte by byte, the standard library re module as a second path, and the apply then undo round trip. Ran: cd backend && venv/bin/python -m pytest tests/batch -q -p no:cacheprovider, 75 passed, 0 expected failures.
…y guard, config, settings seal, engine log and port file, file families and media types, tool registry, and the cli, mcp stdio bridge and mcpb programs (0.14.0)

Checks the real app over HTTP (folder listing, raw files, jobs started, listed, finished and cancelled, refusals as {"ok": false, "error": sentence}, foreign host and origin refusals, every registered tool answering a GET) and runs setup/cli.py, setup/mcp_stdio.py and setup/mcpb.py as programs on temp copies, against a closed port or a loopback relay into the real app; expected values come from the documented sentences and usage text, HMAC-SHA256 computed independently, the stdlib mimetypes table, the zip format read back with zipfile, natural number order, and save-then-read round trips. Ran: cd backend && venv/bin/python -m pytest tests/core -q -p no:cacheprovider, 150 passed, 0 expected failures.
…3d model loading and bounds (0.14.0)

Mounts the real document viewers against a stubbed engine fetch and checks the DOM a user sees: text lines, line endings and search counts, CSV sort/filter/header/column labels, JSON tree previews, paths and paging, hex offsets/bytes/text checked against an independent reference formatter in the test, goto-offset scroll maths, markdown rendering with script and raw HTML never made live, plus model loading of hand-made STL (ASCII and binary) and OBJ whose bounds, centre, sphere radius and normals are checked against geometry maths. Ran: cd frontend && npx vitest run tests/unit/docview, 94 passed, 0 expected failures.
…xt encodings and counts, csv and sqlite reading, fonts, safety limits (0.14.0)

Archives the app creates are read back with Python's zipfile, tarfile and zstandard and compared byte for byte with the source; hostile archives (dot-dot, absolute, drive letter, backslash, links, device nodes, zip bombs) are refused; hashes are checked against published vectors and hashlib; text, csv, sqlite and font results are checked against hand counts and files written by Python's csv, sqlite3 and fontTools. Ran: cd backend && venv/bin/python -m pytest tests/test_*.py tests/files -q -p no:cacheprovider (314 passed, no collection error); lane alone tests/files: 224 passed, 0 expected failures.
…nce tone mapping and refusals through the image routes (0.14.0)

Tiny PNG, PPM and Radiance HDR files are built byte by byte in tmp_path and sent through /api/image/edit, transform, info, view, thumb and /api/meta; results are read back with an independent reader and compared with plain geometry, the EXIF orientation table, the PNG header, the RGBE rule, the sRGB curve and the filmic fit computed in the test folder, plus the refusal messages a user sees. Ran: venv/bin/python -m pytest tests/image -q -p no:cacheprovider, 100 passed, 0 expected failures.
…btitles, snapshots, copy jobs and streaming, metadata reading, and 3d model info, view, assets and conversion (0.14.0)

Drives the real app over HTTP with temporary stand-in ffmpeg, ffprobe, perl and exiftool programs on a private PATH (so the stated refusals, the lookup order and the exact command lines are checked), and with hand-written glTF, GLB, STL, OBJ, PLY and OFF files read back by independent readers; expected values come from the container and mesh format rules, ffmpeg and exiftool documented options, sha512 and npm layout conventions, and save-then-reopen agreement. Ran: cd backend && venv/bin/python -m pytest tests/test_*.py tests/media -q -p no:cacheprovider, 297 passed, 1 expected failures.
… overlay, agent consent dialog and engine client (0.14.0)

Views are mounted into a happy-dom document with only fetch stubbed (or the dock consent host), and checks cover tool forms built from engine action descriptions, validation before any request, the exact request bodies buttons send, refusals shown as sentences, rows patched in place on repeat data, dialogs closing with focus returned, the break timer counting in the overlay root, and the engine client's requests, refusals and URLs; expected values are hand-worked (1536 bytes as 1.5 KB, 4000x3000 at width 1000 gives 750, 90 minutes as 1:30:00, 12000 paths in 5000-path batches) or the app's own documented sentences. Ran: cd frontend && npx vitest run tests/unit/ui tests/unit/io, 159 passed, 0 expected failures.
… broken file scans, templates, trash refusals, hosts file, environment profile, elevation refusal and thumbnails (0.14.0)

Drives the real app over HTTP (and the MCP tool route and thumbnail.main) on hand-made temp trees, temp hosts file and temp environment.d profile; expected values come from arithmetic on the files made, the hosts(5) line format and environment.d(5) rules checked with independent readers in the test folder, and the freedesktop trash format. Ran: cd backend && venv/bin/python -m pytest tests/utilities -q -p no:cacheprovider, 148 passed, 1 expected failures (and with tests/test_*.py together: 238 passed, 1 xfailed, no collection error).
The version moves to 0.14.0 in backend/app/__init__.py, frontend/package.json, frontend/package-lock.json, frontend/src/version.ts, setup/cli.py, setup/mcp_stdio.py, setup/mcpb/manifest.json, src-tauri (Cargo.toml, Cargo.lock, tauri.conf.json), the README badge, CLAUDE.md and AGENTS.md, each by hand. CHANGELOG.md describes 0.14.0. Ran: ./formtools agents check (clean), ./formtools test unit (253 passed) and ./formtools test engine (1081 passed, 1 skipped, 2 expected failures). Not run: the browser demo was not rebuilt, the desktop shell, macOS and Windows.
@nodemode-ai
nodemode-ai requested a review from gbarnai as a code owner November 24, 2026 22:04
@nodemode-ai
nodemode-ai merged commit 8d727f4 into main Nov 24, 2026
6 checks passed
@nodemode-ai
nodemode-ai deleted the test/suite-0.14.0 branch November 29, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant