Skip to content

chore: fix up vitest configs and ci - #16555

Merged
teemingc merged 12 commits into
version-3from
faster-ci
Jul 29, 2026
Merged

teemingc merged 12 commits into
version-3from
faster-ci

Conversation

@teemingc

@teemingc teemingc commented Jul 28, 2026 •

Copy link
Copy Markdown
Member

The test-kit CI jobs take more than 17 minutes each because it's several consecutive groups of tests. If one test fails, everything needs to be retried and that's another 17 minutes. Separating them into unit, dev, and build, might make it a little faster since they run in parallel and it also makes test retries less painful. This may take up more CI minutes but definitely less wall clock time.

This PR also tightens the Vitest workspace config so that it works with both the VS Code Vitest extension and the built-in one for Zed.

EDIT: it takes 10 minutes to complete everything now

@pkg-svelte-dev

pkg-svelte-dev Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 1c86eae:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/1c86eaee36abbf151ddecfad2d3e7cf6c736dad1

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/16555

@svelte-docs-bot

Copy link
Copy Markdown

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vitest expects vitest.*.config.js filenames otherwise the extension throws

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks my guy

@elliott-with-the-longest-name-on-github

Copy link
Copy Markdown
Contributor

Noticed this is draft but it looks done?

@teemingc

Copy link
Copy Markdown
Member Author

Yeah there are a few vitest run scripts that still need to be fixed. It’s running all the unit tests rather just the ones in the directory

@changeset-bot

changeset-bot Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1c86eae

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@teemingc
teemingc marked this pull request as ready for review July 29, 2026 07:31
Comment thread packages/kit/package.json
Comment thread packages/kit/package.json
@teemingc
teemingc marked this pull request as draft July 29, 2026 08:40
Comment thread .github/workflows/ci.yml Outdated
Comment thread packages/kit/test/apps/basics/vite.config.js Outdated
@teemingc
teemingc marked this pull request as ready for review July 29, 2026 11:34
@teemingc
teemingc merged commit 45d25d2 into version-3 Jul 29, 2026
24 checks passed
@teemingc
teemingc deleted the faster-ci branch July 29, 2026 11:34
teemingc added a commit that referenced this pull request Oct 21, 2026
The `CSPs in prod` block in `csp.spec.js` and the `cookies in prod`
block in `cookie.spec.js` don't run in any project. They are skipped
when `process.env.DEV` is set, and Vitest sets `process.env.DEV` to
`'1'` itself (it mirrors `import.meta.env`), so they are skipped in
`kit-server-dev` as well as in `kit-server-build`, which sets `DEV:
'true'`. The dev blocks run twice instead. This dates from #16555, which
replaced the `NODE_ENV=production` run of these two files with the
`kit-server-build` project.

This sets `DEV` to an empty string in `kit-server-build`, the project
that only includes these two files, so it runs their production blocks,
and `kit-server-dev` keeps running the dev blocks.

Before, on `main`: 55 tests skipped in both projects (22 `CSPs in prod`,
33 `cookies in prod`). After: `kit-server-build` runs those 55 and skips
the 8 dev ones, `kit-server-dev` the reverse. All pass: `vitest run -c
vitest.kit.config.js src/runtime/server/page/csp.spec.js
src/runtime/server/cookie.spec.js` gives 72 passed, 64 skipped.

On this commit, `pnpm format` (as `oxfmt --check .`), `pnpm lint`, the
root `pnpm check` (which generates the types and checks every package
and test app) and `pnpm -F @sveltejs/kit test:unit` pass (77 files, 1119
passed, 64 skipped). I didn't run the integration suites; this only
changes the unit test config.

---

### Please don't delete this checklist! Before submitting the PR, please
make sure you do the following:

- [ ] It's really useful if your PR references an issue where it is
discussed ahead of time. In many cases, features are absent for a
reason. For large changes, please create an RFC:
https://github.com/sveltejs/rfcs
- [x] This message body should clearly illustrate what problems it
solves.
- [ ] Ideally, include a test that fails without this PR but passes with
it.

### Tests

- [ ] Run the tests with `pnpm test` and lint the project with `pnpm
lint` and `pnpm check`

### Changesets

- [ ] If your PR makes a change that should be noted in one or more
packages' changelogs, generate a changeset by running `pnpm changeset`
and following the prompts. Changesets that add features should be
`minor` and those that fix bugs should be `patch`. Please prefix
changeset messages with `feat:`, `fix:`, or `chore:`.

### Edits

- [x] Please ensure that 'Allow edits from maintainers' is checked. PRs
without this option may be closed.

---------

Co-authored-by: Tee Ming Chew <chewteeming01@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants