Skip to content

Bump Vitest to 5.1.0 and TUnit to 1.78.0 - #4656

Merged
akira28 merged 4 commits into
mainfrom
chore/bump-vitest
Nov 3, 2026
Merged

akira28 merged 4 commits into
mainfrom
chore/bump-vitest

Conversation

@akira28

@akira28 akira28 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Vitest moves to 5.1.0, TUnit to 1.78.0 and AwesomeAssertions to 9.6.0, with the Microsoft.Testing.Platform packages that TUnit now requires. Newer Verify.TUnit releases can use this TUnit once it merges.

Affects: Automation

Prompt summary: Update Vitest, TUnit and the related test packages (Microsoft.Testing.Platform, AwesomeAssertions, FakeItEasy) to their latest stable versions in a separate PR. The Verify snapshot pilot (#4654) is pinned to Verify.TUnit 31.28.0 because the repo's TUnit is too old for newer releases, and this bump removes that limit.

Why

Verify.TUnit 32.0.0 and later need TUnit.Core 1.65.63 or higher. The repo pins TUnit 1.65.0, so the Verify pilot cannot move past 31.28.0. Vitest 5.1.0 is the current stable release and was a patch behind.

What

Frontend test runner

vitest and @vitest/coverage-v8 move from 5.0.5 to 5.1.0. Vite 8.3.5 already satisfies the new peer range. jsdom and the Testing Library packages are already at their latest versions, so they do not change.

.NET test runner

TUnit moves from 1.65.0 to 1.78.0. TUnit.Engine 1.78.0 depends on Microsoft.Testing.Platform 2.5.2, so Microsoft.Testing.Platform and Microsoft.Testing.Platform.MSBuild move from 2.4.1 to 2.5.2. Both are at the latest stable release.

Assertion and mocking libraries

AwesomeAssertions moves from 9.4.0 to 9.6.0. FakeItEasy is already at its latest release, 9.0.1, so it does not change.

Flaky tests that failed on CI

DocsSyncTests.TestApply failed on CI after the TUnit bump. It reads spans from a process-wide ActivitySource, and the round-trip tests in IncrementalDeployRoundTripTests emit spans on the same source without sharing its [NotInParallel] key, so their spans could land in its exporter. All three round-trip tests now carry the key. I could not reproduce the race locally, so the fix rests on the span tags seen in the CI failure.

AiEnrichmentDeadlineTests.Create_WallClockElapses_LinkedTokenCancelledAndTimedOut failed once on the Windows runner. It slept a fixed 200 ms and expected a 1 ms timer to have fired by then, which a loaded runner can miss. It now waits on the token's cancellation callback with a 30 second upper bound. It passed on Windows in #4654 with the same TUnit, so the flake predates this bump.

Out of scope: The Verify.TUnit bump belongs in #4654 once this merges.

Verify

./build.sh unit-test
cd src/Elastic.Documentation.Site
npm ci
npm run test
npm run lint
npm run compile:check

./build.sh unit-test runs 18 test projects with 8,530 tests and no failures. npm run test reports 737 tests, all passing.

Vitest and @vitest/coverage-v8 move from 5.0.5 to 5.1.0. TUnit moves from 1.65.0 to 1.78.0, which requires Microsoft.Testing.Platform 2.5.2, so that package and its MSBuild companion move from 2.4.1 to 2.5.2. Newer Verify.TUnit releases need TUnit.Core 1.65.63 or later, so this unblocks them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@akira28
akira28 requested a review from a team as a code owner November 2, 2026 17:35
@akira28
akira28 requested a review from Mpdreamz November 2, 2026 17:35
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Docs preview (local build)

Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4656/

DocsSyncTests.TestApply asserts on the sync apply span from a process-wide ActivitySource. The round-trip and exclude tests also reach AwsS3SyncApplyStrategy.Apply, but they did not share its NotInParallel key. They could run alongside TestApply, and their spans landed in its exporter, so it read the wrong span and failed on CI. All three now carry the same key.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
FakeItEasy is already at its latest release, 9.0.1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Create_WallClockElapses slept a fixed 200 ms and then expected a 1 ms timer to have fired. A loaded Windows runner can delay the timer past that, so the test failed on CI. The test now waits for the token's cancellation callback, with a 30 second upper bound.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@akira28
akira28 enabled auto-merge (squash) November 3, 2026 07:18
@akira28
akira28 disabled auto-merge November 3, 2026 07:52
@akira28
akira28 merged commit 008b600 into main Nov 3, 2026
36 checks passed
@akira28
akira28 deleted the chore/bump-vitest branch November 3, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant