Skip to content

local html report#3

Open
jonasnobile wants to merge 6 commits into
mainfrom
feat/local-html-report
Open

local html report#3
jonasnobile wants to merge 6 commits into
mainfrom
feat/local-html-report

Conversation

@jonasnobile

Copy link
Copy Markdown
Member

No description provided.

jonasnobile and others added 6 commits June 17, 2026 14:51
Add a FileReporter implementing the Reporter interface that renders the same
per-step data the platform shows (status, timing, intent/manual, error,
screenshot) into a single self-contained report.html — the dashboard view,
locally, no server or credentials.

- harness: configureFromEnv selects it when OPICE_REPORT_FILE is set, ahead of
  the HTTP reporter, so a local run needs no OPICE_DSN to get a rich per-step
  view. Screenshots are base64-embedded so the file is portable.
- cli: `opice test --report [file]` sets OPICE_REPORT_FILE for the child
  (default .opice/report.html) and prints the resolved path after the run.

In-memory per process; a single-file run produces a complete report (the usual
authoring loop). Cross-file aggregation into one report is a follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Address review findings on the FileReporter:

- Fix scenario ordering: drop the id.localeCompare sort (Map already
  iterates in execution order; the sort put `local-10` before `local-2`
  once a file had >=10 scenarios).
- Aggregate multi-file runs: `opice test` now provides a fresh per-run
  parts dir (OPICE_REPORT_PARTS_DIR); each per-file `bun test` process
  persists its scenarios as an atomic JSON part and every render is the
  union of all parts, so the report stays complete instead of the last
  file clobbering the rest. CLI cleans the dir up after.
- Stop `--report` swallowing a bun test-file arg: only take the next
  token as the path when it ends in .html/.htm; else use the default and
  prefer the explicit --report=<file> form.
- Render `kind`: invariant steps now get a distinct badge.
- Escape `'` in esc().

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
readParts() persisted this process's scenarios to disk then read and
JSON-parsed that same (screenshot-laden) part right back to render the
union — on every step event. Splice the in-memory `own` in at its
pid-sorted position instead and only read sibling parts from disk. In the
common single-file authoring loop (own is the only part) this drops the
per-step read-back+parse entirely; the rendered output is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Cover the file reporter deterministically (no browser): single-scenario
render, flaky-retry step replacement, tier-skip, multi-process partsDir
aggregation, and HTML escaping. Also render a tier-skipped scenario with a
"skipped" tag + its reason instead of looking like a plain pending row.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Rewrite the report's rendering half to reproduce the dashboard's RunDetail
view instead of a separate dark-card skin: the dashboard's design tokens
(light/dark via prefers-color-scheme, muted-green accent, Inter/JetBrains
Mono, borders-not-shadows), the app-header with the chimp logo, SVG status
marks, and the master/detail workbench — filter tabs with counts, a
feature-grouped scenario list, and a detail pane with the step grid
(intent rule, error/blocked/fixme notes, invariant tag, polaroid
screenshots, meta chips). Driven by a small vanilla controller (row
selection, status/search filtering) plus an auto/light/dark theme switch.

Computed display statuses mirror the dashboard (a pending stub reads
incomplete, a tolerated fixme reads warning, a flaky pass stays passed),
as does severity ordering and auto-selecting the worst scenario. The
data/aggregation layer is untouched. `manual` is no longer rendered,
matching the dashboard (the field is still captured).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
It shipped across four commits without ever landing in `opice help` or the
README. Add it to the `test` usage line + description (precedence over
platform reporting, the .opice/report.html default, the =FILE
disambiguation, multi-file aggregation) and show it in the quickstart.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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