@unotest/viewer 0.18.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,140 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.20.0] - 2026-08-24
4
+
5
+ ### Minor Changes
6
+
7
+ - 7957469: A status of its own for tests that are supposed to fail, and tiles that fade with age.
8
+
9
+ **`// @expect-fail`.** A scenario can declare that failing IS its assertion.
10
+ The marker lives in the comment block before the first code — with the
11
+ mandatory header (right after the colour line) or without one. The parser is
12
+ `parseScenarioAnnotations` in `@unotest/protocol`; `ScenarioMeta` gains an
13
+ `expectFail` field.
14
+
15
+ Such a scenario carries its own status in the viewer (`expected`, purple):
16
+ it stays out of the FAILED counter, out of the "failing now" badge and out
17
+ of the "Failing now" section. The inverse case — a marked test that
18
+ **passed** — turns red: whatever it was guarding stopped breaking and nobody
19
+ found out. One rule (`scenarioHealthStatus`) drives the dashboard, the
20
+ scenario tree and the badge, so the three cannot drift apart.
21
+
22
+ The runner does not interpret the marker: exit code and run status are
23
+ unchanged. The run really did fail — it is the test itself that is fine.
24
+
25
+ **Fading.** An overview tile dims as its last result ages: four steps (hour /
26
+ day / week / older) set the strength of the fill itself — 46 / 30 / 19 / 11%
27
+ of the status colour. The 11% floor keeps an old red still red. The time of
28
+ the last run is now part of the tile's accessible name — colour is the one
29
+ channel a screen reader does not have.
30
+
31
+ ### Patch Changes
32
+
33
+ - aab65a5: A failure in the first test of a file is no longer lost, and the dashboard no longer waits for F5.
34
+
35
+ **One run, one `run:finished`.** The event was written by the executor's
36
+ per-entry tap, so a file with four `test_*()` functions left four terminal
37
+ events in `steps.jsonl`. Every consumer reads the last one — so `collection`
38
+ reported a scenario green whenever the final function passed and the first
39
+ one failed. The runner now writes the event once, folding the outcomes of
40
+ every entry: `failed` > `interrupted` > `aborted` > `completed`. A run that
41
+ never got started (no entry function, browser failed to launch) writes a
42
+ terminal event too — its artifact used to read as "the process died".
43
+
44
+ **The viewer asks for the index again.** The first `load()` could land while
45
+ the server was still rebuilding the run index: the answer was "no runs", and
46
+ nobody asked again — WS only reports a run starting and finishing. On a
47
+ project with history the whole overview showed "never run" until a page
48
+ reload. `indexReady: false` now schedules a retry with a 0.5s → 30s backoff,
49
+ until the first ready answer.
50
+
51
+ - Updated dependencies [7957469]
52
+ - Updated dependencies [c6efd92]
53
+ - @unotest/protocol@0.20.0
54
+ - @unotest/dsl@0.20.0
55
+
56
+ ## [0.19.0] - 2026-08-23
57
+
58
+ ### Minor Changes
59
+
60
+ - dfb3991: Per-collection parallelism via a `workers:` field in the collection YAML.
61
+
62
+ - `workers: N` (integer ≥ 1) in `unotest/e2e/_collections/*.yaml` sets how
63
+ many scenarios of that collection run concurrently; omitted = serial.
64
+ - Precedence: CLI `--workers=N` flag > manifest `workers:` > 1.
65
+ - Viewer: the collection header shows an editable `workers` value; the
66
+ setting is stored in the YAML, so CLI and CI runs pick it up too.
67
+ - `CollectionMeta` (protocol) gains a `workers: number | null` field.
68
+
69
+ - Run history scales: runs are filed under daily shards and the viewer stops
70
+ polling history it is not showing.
71
+
72
+ - New on-disk layout `unotest/.runs/<YYYY>/<MM>/<DD>/<runId>/` (UTC date the
73
+ run started). The shard is a pure function of the `runId`, which already
74
+ carries the timestamp — a direct link to a run keeps working even with the
75
+ index deleted. Existing flat `.runs/<runId>/` history is migrated
76
+ automatically (see the `runs migrate` entry).
77
+ - The viewer's watcher polls only LIVE runs; finished history never touches
78
+ it. Discovery watches the current day's directory with native `fs.watch`
79
+ and re-attaches at UTC midnight.
80
+ - A JSONL index per day and per scenario backs the history list. It is fully
81
+ rebuildable — rebuilt on start, non-blocking — so a corrupted or missing
82
+ index degrades the listing, never the runs themselves.
83
+ - `@unotest/protocol`: new `run-shard` and `run-index` modules (shard path
84
+ derivation, index record shapes) exported from the root entry.
85
+
86
+ - Upgrading moves existing run history to the new layout by itself, and
87
+ Playwright moves to 1.62.
88
+
89
+ - The flat `.runs/<runId>/` history is migrated on the first run of the new
90
+ version. Default is to remove old runs (nobody asked to keep them);
91
+ `UNOTEST_RUNS_LEGACY=keep` re-files them into date shards instead. The
92
+ completion marker is written last, so an interrupted or failed move is
93
+ retried on the next start rather than silently marked done.
94
+ - New command `unotest-web runs migrate [--dry-run]` — the same migration,
95
+ runnable FIRST, with a report-only mode. A migration nobody can look at
96
+ before it happens is one that runs unannounced on someone else's machine.
97
+ - `playwright` moves to `^1.62.0` in `@unotest/web` and `@unotest/viewer`.
98
+ Run `npx playwright install` once after upgrading if your browser cache
99
+ predates it.
100
+ - Frame capture is now format-parameterised internally, still PNG. WebP was
101
+ measured and rejected: Chromium's lossless `type: "webp"` is pixel-exact
102
+ but 1.5× LARGER than PNG on real frames (3.17 MB vs 2.04 MB on one suite).
103
+ - Fix: the viewer served step screenshots as 403 after the layout change —
104
+ its asset allow-list still expected the flat layout. The route now has
105
+ tests.
106
+
107
+ - The viewer's sidebar becomes a chronological history instead of a flat list.
108
+
109
+ - Runs are grouped by the reader's calendar day; a run with a `parentRunId`
110
+ collapses into its collection's row, and neighbouring identical outcomes
111
+ collapse run-length style, so a long history stays readable.
112
+ - Each test carries a chip with its recent trend, and a badge counts tests
113
+ whose LAST run failed. The badge reads `_latest.json`, so it is correct
114
+ regardless of how much history the sidebar has loaded; the "Failing now"
115
+ section matches it by construction.
116
+ - Fix: `/api/runs` returned a page while the client still expected an array,
117
+ and the sidebar history rendered empty. The response shape now lives in
118
+ one place (`shared/runs-page.ts`) and `RunsStore` has tests.
119
+
120
+ - Overview dashboard — the viewer opens on the health of the whole project
121
+ instead of "pick something from the sidebar".
122
+
123
+ - One tile per scenario, filled by the status of its last run. Tile size is
124
+ computed from the window, so the entire suite fits without scrolling.
125
+ - Hovering a tile shows a card with the scenario name, when it last ran, how
126
+ long it took, and a strip of its recent outcomes. Clicking opens the
127
+ scenario in a tab. The counters across the top double as filters.
128
+ - The card's data comes from the run index, not from a request per tile: a
129
+ field of 200 tests used to mean 200 requests during one sweep of the mouse.
130
+ - Fix: the status shown next to a scenario in the tree came from whatever
131
+ slice of history happened to be loaded, instead of the per-scenario index —
132
+ so it changed as you scrolled.
133
+
134
+ - Tree rows in the history sidebar share one grid: a collection, a test run and
135
+ the "open collection run" row now line up on the same vertical and have the
136
+ same height, and nesting is one indent step per level.
137
+
3
138
  ## [0.18.0] - 2026-08-23
4
139
 
5
140
  ### Minor Changes