Skip to content

[lexical][lexical-y][lexical-playground][scripts] Chore: reduce repeated test setup and CI work - #80

Draft
etrepum wants to merge 5 commits into
mainfrom
codex/reduce-test-ci-costs
Draft

etrepum wants to merge 5 commits into
mainfrom
codex/reduce-test-ci-costs

Conversation

@etrepum

@etrepum etrepum commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Description

Reduce repeated CI work while retaining targeted regression coverage:

  • Reuse an already-validated fresh reader in normalization tests and snapshot peer exports once per synchronous convergence/fuzzer comparison.
  • Remove the disabled-check workload used only to print benchmark medians. Guard follow-up materialization deterministically (2/3 neighboring blocks), retaining both 10,000-block positions and all 60 updates.
  • Check the valid and invalid keyboard-shortcut Flow consumers in one compiler invocation. Keep both named tests and reject every unexpected diagnostic; canonicalize the temporary project path.
  • Run 50 normal + 25 GC fuzz seeds in ordinary core CI, leaving local defaults at 300/100 and all 47 minimized regression replays enabled. A separate daily/manual workflow retains the full fixed campaign on Node 22/24 and adds a reproducible rotating Node 24 window. This deliberately reduces random coverage on each push, with broader coverage deferred to the campaigns. Schedules become operational only after merging/enabling the workflow on the default branch.
  • Move schema and Markdown-transformer tests that do not require a DOM to Node fixtures. Preserve all 220 cases and their assertion bodies; explicitly enable history for the Markdown undo case.
  • Separate the eager HTML formatter from the general unit-test helper. Only the 20 actual formatting consumers import it, avoiding formatter workers for unrelated core, table, React and other suites without moving compiler startup into a timed assertion.
  • Replace matching E2E cases with real-browser fixtures for multiline HTML paste, UTF-8/UTF-16 character-limit overflow and paragraph deletion, and Google Docs table paste. Preserve clipboard payloads, native caret/deletion interactions, HTML and selection assertions. All replacement files pass Chromium, Firefox and macOS WebKit; keep the remaining distinct E2E interactions. No temporary validation workflow remains in the final diff.

The migrated cases no longer repeat full playground/prod-bundle integration setup; their browser-engine, DOM, native-input and assertion coverage moves to the browser fixtures. Distinct full-playground E2E cases remain.

No production code changes. Other fuzz suites, regression seeds, native input/IME, collaboration and the 300,000-linefeed stress test remain.

Changeset

None: tests, test helpers and CI configuration only.

Test plan

Before

Node 24.22.1, focused single-worker samples in the same checkout:

Workload Before After
NormalizationConvergence, 1,131 cases 84.55s 53.02s
Fuzz, unchanged full 300/100 campaign 126.28s 107.34s
FollowUpCheckCost, both positions 23.60s 18.23s
Keyboard Flow command, including setup/imports 18.60s 11.46s

These are single local comparisons, not CI-wide cost estimates. The optimized full fuzz campaign took 112.40s including startup versus 33.31s for the new per-push smoke campaign (test execution: 107.34s versus 18.48s).

After

  • Full lexical-y unit run: 4,724 passed, 0 failed, 2 existing skips across 139 files, including the unchanged large-input stress case.
  • Full scripts-unit run: 3,491 passed, 0 failed across 22 files. Focused Flow test passes after temporary-path canonicalization.
  • Fuzz smoke: 3 groups pass; first rotating window (301 onward, 300/100 seeds) passes all 16 groups. Existing KNOWN_OPEN exclusions remain explicit.
  • Mutation controls: full-document rereads fail with 10,000 blocks instead of 2/3; an extra Flow error in the valid consumer fails; replacing the invalid consumer with a valid one fails the required rejection check. All mutations restored.
  • tsc-test, tsc-scripts, changed-file ESLint/Prettier and whitespace checks pass. Fuzz workflow YAML structure, Bash syntax, window boundaries and rerun stability checked; actionlint unavailable locally.
  • Three-engine browser validation at 4bed4f3: 35 passed / 2 intentional plain-text skips per engine, across the three affected browser files (run). Local browser startup was sandbox-blocked; these are executed GitHub-hosted browser results, not static-only checks.
  • Schema/Markdown: 220 cases pass; all 657 assertion expressions are unchanged. Mutation controls for schema and undo fail as expected, then are restored.
  • Shared formatter: the controlled three-file default-timeout run passes 56/56, spawning two formatter workers instead of three. An assertion-time lazy-loader was rejected after a first-test timeout; the final design imports the dedicated formatter eagerly only where needed.
  • Combined affected-file validation at 662aa6e1: Node 22 and Node 24 each pass 891 tests / 1 existing skip across 22 files, with default timeouts unchanged; Node 24 typecheck passes (run). A local wide consumer run had two five-second timeouts; both passed isolated original/extracted controls before hosted validation.
  • Promoted exact validated source to f3fe2cad, excluding the temporary workflow. Final full standard CI is green at f3fe2cad (run): Node 22/24 unit suites, full Chromium browser (1,070 passed / 4 skipped), integrity/all builds and E2E canary (620 passed / 61 skipped). Fork-gated Extended/release jobs and the skipped collaboration step are not claimed as executed.

## Description

Reduce redundant work in three expensive `@lexical/y` unit suites without reducing their scenario matrices, document sizes, update counts, or fuzz seeds:

- Reuse the fresh reader already checked by `expectConverged` instead of building a second equivalent reader in normalization tests.
- Export and normalize each peer once per synchronous convergence/fuzzer comparison, preserving the existing diagnostics.
- Remove the disabled-check workload that only printed benchmark medians in `FollowUpCheckCost`. Replace its machine-dependent 5ms assertion with a deterministic guard that each follow-up materializes only the changed block and its neighbors (2 blocks at the end, 3 in the middle).

The range-size assertion guards against whole-document rereads; it is not a benchmark of every operation inside the check. Both 10,000-block positions and all 60 updates remain. No production code or browser/E2E coverage changes.

## Changeset

None: tests and test helpers only.

## Test plan

### Before

Same checkout, Node 24.22.1, single-worker focused runs at `f77b0b0458dcead1ab60b88d6e48c3ece03d2ff8`:

| Suite | Before | After |
| --- | ---: | ---: |
| NormalizationConvergence (1,131 cases) | 84.55s | 53.02s |
| Fuzz (16 groups; default 300 normal / 100 GC seeds, existing exclusions unchanged) | 126.28s | 107.34s |
| FollowUpCheckCost (2 cases) | 23.60s | 18.23s |

These are single local before/after samples, not a CI-wide savings estimate. An intermediate run retaining the old timing assertion failed at 5.51ms against the 5ms limit.

### After

- All focused cases above pass.
- Full `packages/lexical-y/src/__tests__/unit` run: 4,724 passed, 0 failed, 2 skipped across 139 files (`--maxWorkers=2`), including the unchanged 300,000-linefeed stress test.
- Mutation control: forcing whole-document reads makes both new assertions fail with 10,000 blocks instead of 2/3. That control used one update per position to avoid repeating deliberately expensive reads; the real suite retains 60. Mutation restored afterward.
- `pnpm run tsc-test` passes.
- ESLint and Prettier pass on all changed files; `git diff --check` passes.
- Browser execution was unavailable in this workspace (browser download failed; installed Chromium launch was sandbox-blocked). No unverified browser migration is included.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Deploying lexical with  Cloudflare Pages  Cloudflare Pages

Latest commit: f3fe2ca
Status: ✅  Deploy successful!
Preview URL: https://481b5183.lexical-a1o.pages.dev
Branch Preview URL: https://codex-reduce-test-ci-costs.lexical-a1o.pages.dev

View logs

## Description

Reduce repeated CI work while retaining targeted regression coverage:

- Reuse an already-validated fresh reader in normalization tests and snapshot peer exports once per synchronous convergence/fuzzer comparison.
- Remove the disabled-check workload used only to print benchmark medians. Guard follow-up materialization deterministically (2/3 neighboring blocks), retaining both 10,000-block positions and all 60 updates.
- Check the valid and invalid keyboard-shortcut Flow consumers in one compiler invocation. Keep both named tests and reject every unexpected diagnostic; canonicalize the temporary project path.
- Run 50 normal + 25 GC fuzz seeds in ordinary core CI, leaving local defaults at 300/100 and all 47 minimized regression replays enabled. A separate daily/manual workflow retains the full fixed campaign on Node 22/24 and adds a reproducible rotating Node 24 window. This deliberately reduces random coverage on each push, with broader coverage deferred to the campaigns. Schedules become operational only after merging/enabling the workflow on the default branch.
- Add a browser-fixture candidate for multiline HTML paste, retaining the exact payload, four paragraphs and raw rendered whitespace. **The original E2E remains until Chromium/Firefox/WebKit validation passes.** A temporary fork-only workflow validates this candidate; it will be removed after results are recorded.

No production code changes. Other fuzz suites, regression seeds, native input/IME, collaboration and the 300,000-linefeed stress test remain.

## Changeset

None: tests, test helpers and CI configuration only.

## Test plan

### Before

Node 24.22.1, focused single-worker samples in the same checkout:

| Workload | Before | After |
| --- | ---: | ---: |
| NormalizationConvergence, 1,131 cases | 84.55s | 53.02s |
| Fuzz, unchanged full 300/100 campaign | 126.28s | 107.34s |
| FollowUpCheckCost, both positions | 23.60s | 18.23s |
| Keyboard Flow command, including setup/imports | 18.60s | 11.46s |

These are single local comparisons, not CI-wide cost estimates. The optimized full fuzz campaign took 112.40s including startup versus 33.31s for the new per-push smoke campaign (test execution: 107.34s versus 18.48s).

### After

- Full lexical-y unit run: **4,724 passed, 0 failed, 2 existing skips across 139 files**, including the unchanged large-input stress case.
- Full scripts-unit run: **3,491 passed, 0 failed across 22 files**. Focused Flow test passes after temporary-path canonicalization.
- Fuzz smoke: 3 groups pass; first rotating window (301 onward, 300/100 seeds) passes all 16 groups. Existing KNOWN_OPEN exclusions remain explicit.
- Mutation controls: full-document rereads fail with 10,000 blocks instead of 2/3; an extra Flow error in the valid consumer fails; replacing the invalid consumer with a valid one fails the required rejection check. All mutations restored.
- `tsc-test`, `tsc-scripts`, changed-file ESLint/Prettier and whitespace checks pass. Fuzz workflow YAML structure, Bash syntax, window boundaries and rerun stability checked; actionlint unavailable locally.
- Real-browser validation is pending in the temporary fork CI workflow. Local browser startup was sandbox-blocked, so no browser-runtime result is claimed yet and no E2E coverage has been removed.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://codex-reduce-test-ci-costs-lexical-playground.mochimedia.workers.dev (commit f3fe2ca)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://84389508-lexical-playground.mochimedia.workers.dev f3fe2ca 2026-10-29T18:34:44.768Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://c1e19120-lexical-playground.mochimedia.workers.dev 0169a12 2026-10-29T18:22:32.512Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://0cf76b84-lexical-playground.mochimedia.workers.dev 352c580 2026-10-29T17:22:36.159Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://6e6b6b8d-lexical-playground.mochimedia.workers.dev e5d40a5 2026-10-29T17:09:06.393Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://67a9a3fb-lexical-playground.mochimedia.workers.dev 9dca0d6 2026-10-29T16:51:28.329Z Visit the dashboard ↗

@etrepum etrepum changed the title [lexical-y] Chore: reduce redundant unit-test work [lexical-y][lexical-playground][scripts] Chore: reduce repeated CI work Oct 29, 2026
## Description

Assert the raw collapsed whitespace produced by HTML import. The old E2E toHaveText string matcher normalized whitespace even with useInnerText, so its triple-space literal did not require triple spaces in the actual text. The new exact comparison retains paragraph-count coverage and detects extra line breaks instead of relying on that normalization.

## Changeset

None: test only.

## Test plan

### Before

Chromium and Firefox CI showed actual third paragraph text was Hello World !; the candidate incorrectly expected three spaces.

### After

Verified HTML import collapseWhitespace behavior and Playwright normalizeWhiteSpace:true implementation. ESLint and Prettier pass. Rerunning exact-head Chromium, Firefox and WebKit CI; original E2E retained until replacements pass.
## Description

Remove the temporary fork-only validation workflow after successful Chromium, Firefox and WebKit runs. Further experiments run on the separate validation branch.

## Changeset

None: CI cleanup only.

## Test plan

### Before

Three-engine validation run40922163607 passed35tests per engine with2 intentional skips.

### After

Only the temporary workflow is removed. Permanent fuzz campaigns remain unchanged.
… and E2E setup overhead

## Description

Use DOM-free fixtures for schema and Markdown transformer cases. Extract eager HTML formatting helpers so unrelated tests do not start formatter workers. Move multiline HTML paste, character-limit overflow/deletion and Google Docs table paste from repeated playground E2E setup to real-browser fixtures after three-engine validation. Retain unique assertions and native keyboard interactions; remove only matching originals.

## Changeset

None: test-only optimization.

## Test plan

### Before

Original fixture controls and E2E coverage mapped; all assertion bodies preserved in formatter consumers and schema/Markdown cases. Local wide formatter run had two default-timeout failures, both passing isolated original and extracted controls.

### After

Hosted Node22 and24 each pass891tests with1existing skip across22affectedfiles at662aa6e1; typecheck passes. Chromium, Firefox and macOSWebKit each pass35tests with2intentional skips at4bed4f3. ESLint/Prettier and survivingE2E collection pass. No temporary workflow included.
@etrepum etrepum changed the title [lexical-y][lexical-playground][scripts] Chore: reduce repeated CI work [lexical][lexical-y][lexical-playground][scripts] Chore: reduce repeated test setup and CI work Oct 29, 2026

This branch has not been deployed

No deployments
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