Bump Vitest to v4 (#19216)

This PR bumps Vitest from v2 to v4. As far as I know we don't use any
Vitest specific features in our tests, but had to upgrade the
`vitest.workspace.ts` file to a `vitest.config.ts` file instead.

The only features we use are the typical `describe`, `it`, `test`, and
`expect` functions.

The only other part we use is `vi.spyOn` and `vi.fn` but those didn't
change in API either.

The test shards were removed to prevent errors. Not all suites have
enough files / tests to be broken up into 3 parts so Vitest now errors
when that happens.

### Test plan

1. All tests should pass in CI.
2. All integration tests should pass in CI.

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
This commit is contained in:
Robin Malfait 2025-11-21 00:16:20 +01:00 • committed by GitHub
parent 642b9b8576
commit 479b725cd3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 346 additions and 565 deletions

View file

@ -103,18 +103,8 @@ jobs:
CARGO_PROFILE_RELEASE_LTO: 'off'
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER: 'lld-link'
- name: Test ${{ matrix.integration }} 1/3
run: pnpm run test:integrations ./integrations/${{ matrix.integration }} --shard 1/3
env:
GITHUB_WORKSPACE: ${{ github.workspace }}
- name: Test ${{ matrix.integration }} 2/3
run: pnpm run test:integrations ./integrations/${{ matrix.integration }} --shard 2/3
env:
GITHUB_WORKSPACE: ${{ github.workspace }}
- name: Test ${{ matrix.integration }} 3/3
run: pnpm run test:integrations ./integrations/${{ matrix.integration }} --shard 3/3
- name: Test ${{ matrix.integration }}
run: pnpm run test:integrations ./integrations/${{ matrix.integration }}
env:
GITHUB_WORKSPACE: ${{ github.workspace }}