Files
hyperframes/packages/studio/tests/e2e/edit-accuracy/grid.test.mjs
James RussoandClaude Opus 5.5 a59a422195 perf(studio): speed up the edit accuracy bench and trim its grid (#5569)
* perf(studio): cut fixed waits from the edit accuracy bench

- Settle window 1000 ms -> 500 ms (EDIT_ACCURACY_STILL_MS overrides it).
- Drop the fixed 1 s sleep in openStudio; the settle that follows is the
  real readiness wait.
- Mark composition hosts data-no-timeline in the producer's page when the
  saved project has no GSAP timeline, so the render skips the 10 s
  playerReadyTimeout wait.
- Run the blank-page smoothness control once per gesture per browser.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* ci(studio): trim the edit accuracy grid to 741 cases

Drops zoom 200, the pct and center placements, and nested keyframed cases
from the grid (2061 -> 741 cases; the pr slice 435 -> 265). Drag paths and
sequences are unchanged.

baseline.json loses the 1320 removed cases. The ratchet no longer counts a
base case that the head's baseline.json does not hold, and lists such cases
as retired, so removing cases from the grid and baseline.json together does
not fail the gate.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(studio): measure the blank-page control again after it fails

The control is cached per browser and gesture, so a rejected measurement stayed
cached and failed every later case with that gesture before Studio was tested.
Drop a rejected entry so the next case measures again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* ci(studio): keep the nested keyframed resize cases in the edit accuracy PR slice

Two historical gate runs failed only on resize-scale-px-r0-nested-z100-on,
which the trim removed, so the PR slice would have passed that build. Keep
the nested keyframed resize on a keyframe at zoom 100 without rotation, one
case per GSAP mode, with their baseline entries. PR slice 265 -> 271 cases,
full grid 741 -> 747.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-14 03:46:17 +00:00

40 lines
1.4 KiB
JavaScript

import { mkdtempSync, readdirSync, readFileSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { describe, expect, it } from "vitest";
import { FIXTURE_CDN, buildGrid, localAsset, writeFixture } from "./grid.mjs";
function fixtureUrls(spec) {
const dir = mkdtempSync(join(tmpdir(), "edit-bench-urls-"));
writeFixture(spec, dir);
const pages = readdirSync(dir, { recursive: true }).filter((f) => String(f).endsWith(".html"));
const urls = pages.flatMap((f) =>
[...readFileSync(join(dir, String(f)), "utf8").matchAll(/https?:\/\/[^"'\s)]+/g)].map(
(m) => m[0],
),
);
rmSync(dir, { recursive: true });
return urls;
}
// Only the CDN host is intercepted, so a mapped URL anywhere else would still reach the network.
const servedLocally = (url) => url.startsWith(FIXTURE_CDN) && localAsset(url) !== undefined;
describe("grid fixtures", () => {
it("reference only URLs the bench serves from the repo", () => {
const unserved = buildGrid("full")
.flatMap(fixtureUrls)
.filter((url) => !servedLocally(url));
expect([...new Set(unserved)]).toEqual([]);
}, 30_000);
});
describe("grid size", () => {
it("holds 747 cases, 271 of them in the pull request slice, each id once", () => {
const full = buildGrid("full");
expect(full).toHaveLength(747);
expect(new Set(full.map((c) => c.id)).size).toBe(747);
expect(buildGrid("pr")).toHaveLength(271);
});
});