Repository navigation
test: run playgrounds under bundled dev, skip unsupported cases - #23027
Conversation
Add VITE_TEST_BUNDLED_DEV=1 (pnpm run test-serve-bundled) to force experimental.bundledDev for every playground without separate configs. Tests that do not pass under bundled dev yet are marked with test.skipIf(isBundledDev) / describe.skipIf(isBundledDev) and still run in normal serve and build modes. vitestSetup now waits for the bundled-dev fallback page to swap to the real page after page.goto (bounded at 15s; hmr-full-bundle-mode is exempt because it asserts the fallback itself), which makes bundled-dev results deterministic.
|
instead of adding Line 16 in 41c4658 isBundledDev so we can enable playgrounds with few failing tests)When the list is long enough, we can switch to listing the excluded files. |
Per review: instead of skipIf everywhere, vitest.config.e2e.ts now lists every spec file for the bundled-dev run, with not-yet-passing files commented out. Files with only a few failing cases stay enabled and keep test.skipIf(isBundledDev) for those cases. Heavily-failing files got their skipIf annotations reverted.
|
Reworked as suggested in 4d658ad: One tradeoff to be aware of: the commented-out files also contained ~240 tests that pass under bundled dev (e.g. large parts of Suite is green in this mode (341 passed / 159 skipped / 0 failed, ~20s), and the normal serve/build runs are unchanged. Tracking issue #23028 is updated to describe the uncomment-the-file workflow. |
|
Would you remove the playgrounds that most test fails from Also, given that there's more include that exclude, I think we can use |
Per review: use exclude from the start, and move files where most cases fail under bundled dev (e.g. tailwind, 4 of 5) into bundledDevExclude instead of keeping per-case skipIf. skipIf remains only in files where failing cases are the minority.
|
Both done in d105a5c:
Bundled-dev suite: 73 files collected, 0 failures. Normal serve and build runs unchanged. |
Vite merged vitejs/vite#23027, which added a `test-serve-bundled` script: it runs the whole playground e2e suite under bundled dev mode (`VITE_TEST_BUNDLED_DEV=1`), with unsupported cases skipped. This PR makes `packages/vite-tests/run.ts` run that suite as well, between `test-serve` and `test-build`. The prepared vite checkout is always the latest `rolldown-canary` rebased onto `main`, and that always contains the script since the rebase on 2026-07-24. Verified locally at the current `rolldown-canary` tip (50fd47de7) with a locally built rolldown linked in: 330 passed, 116 skipped, 0 failed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
#10434) Vite merged vitejs/vite#23027, which added a `test-serve-bundled` script: it runs the whole playground e2e suite under bundled dev mode (`VITE_TEST_BUNDLED_DEV=1`), with unsupported cases skipped. This PR makes `packages/vite-tests/run.ts` run that suite as well, between `test-serve` and `test-build`. The prepared vite checkout is always the latest `rolldown-canary` rebased onto `main`, and that always contains the script since the rebase on 2026-07-24. Verified locally at the current `rolldown-canary` tip (50fd47de7) with a locally built rolldown linked in: 330 passed, 116 skipped, 0 failed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Description
Skipped tests are tracked in #23028.
This PR makes the whole playground e2e suite runnable under full bundle mode, with one command and no per-playground configs:
pnpm run test-serve-bundled(envVITE_TEST_BUNDLED_DEV=1).playground/vitestSetup.tsmergesexperimental: { bundledDev: true }on top of each playground's own config after loading it, so the mode is forced everywhere.isBundledDevflag exported from~utils. Every test that does not pass under bundled dev yet is markedtest.skipIf(isBundledDev)(ordescribe.skipIf(isBundledDev)for loop-generated groups). These tests still run in normal serve and build modes, whereisBundledDevis always false.The skips are a tracked to-do list, not accepted behavior: 502 tests are skipped because they fail under bundled dev today (497 from the baseline run on
main@ 34af7b7, plus 5 found once timing was made deterministic, see below). About 30 more currently-passing tests are also skipped because they live in shared helper files (fs-serve/__tests__/commonTests.ts,css/__tests__/tests.ts) where a per-importing-spec condition is not possible with plain vitest APIs.Why most tests fail under bundled dev
The dev server in bundled mode serves the outputs of a rolldown bundle from memory. It does not serve individual source files by URL.
flowchart LR R["browser request"] --> N{"normal dev"} R --> F{"bundled dev"} N -->|"/nested/asset.png"| N1["file read and transform → 200 with source-path URL"] N -->|"/@fs/ path outside allow"| N2["403 Restricted"] F -->|"/assets/asset-HASH.png"| F1["bundle output from memory → 200"] F -->|"any other file URL"| F2["no handler → 404 or HTML fallback"]Minimal example — same import, different URL shape:
Main failure classes: asset/source URL shape (assets 122, and parts of html/css), only-bundle-outputs-served (fs-serve 108 — verified fail-closed, denied files are never leaked, but allowed static/
/@fs/fetches 404), HMR gaps (hmr 42), workers (50), dep optimizer interplay (optimize-deps 52), sourcemaps (25), plus many small groups that follow from the first two classes.Harness fix: wait out the fallback page
Bundled dev serves a self-reloading fallback page until the first bundle completes. Without handling this, results are timing-dependent: a test that runs early asserts against the placeholder page and fails at random.
vitestSetup.tsnow waits for the real page afterpage.goto:tsconfig-json-load-error,optimize-deps) still run and handle that state themselves,hmr-full-bundle-modeis exempt because its first test asserts the fallback page itself.How to work on a skipped test
skipIf(isBundledDev).pnpm run test-serve-bundled <playground-name>.🤖 Generated with Claude Code