feat(experimental): support merge reports for non-sharded multi-environment runs (take 2)#10031
Open
hi-ogawa wants to merge 68 commits intovitest-dev:mainfrom
Open
feat(experimental): support merge reports for non-sharded multi-environment runs (take 2)#10031hi-ogawa wants to merge 68 commits intovitest-dev:mainfrom
hi-ogawa wants to merge 68 commits intovitest-dev:mainfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Codex <noreply@openai.com>
Member
|
I like the approach, but I feel like Should we make it more internal to avoid clashes with user meta? It could also be removed from json.meta: #10078 |
Collaborator
Author
|
Agree |
Co-authored-by: Codex <noreply@openai.com>
Collaborator
Author
|
Hash was aligned so pre-parse mode was broken. I consolidated ast-collect with the same |
Collaborator
Author
|
We discussed that
|
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Collaborator
Author
|
The PR is updated with blob reporter level option. I've also revived |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Alternative take for #9967 (comment)
This PR adds new blob reporter option
labelso--merge-reportscan distinguish results from the same test files across different environments, such as linux/macos/windows CI jobs.Usage example
Set
VITEST_BLOB_LABELwhen creating blobs:Or pass the label via the blob reporter option:
The label is included in the default blob filename (
blob-linux.json) to avoid collisions. When merging, each labeled run is shown separately:How it works
The label is a blob reporter option, with
VITEST_BLOB_LABELas an environment-variable shortcut for CI usage. During config resolution, Vitest extracts the label from['blob', { label }]orprocess.env.VITEST_BLOB_LABELand stores it as internal core config (mergeReportsLabel).During the original test run, this label is not exposed as a normal built-in reporter label. This keeps terminal output unchanged for runs that create blobs with another reporter enabled, for example
reporters: ['default', ['blob', { label: 'linux' }]].The label is stored in blob task metadata and salts the file identity used for merged reports, so state deduplication can keep same-filepath files from different environments separate. The default blob output filename also uses the label as
blob-(label)-(shard).jsonwhen no explicit output file is configured.Reporters read the label from merged blob metadata and display it when replaying
--merge-reports.The difference from #9967
TestProjectper label at read timereadBlobschangesfile.projectName[["blob", { label }]]reporter option orVITEST_BLOB_LABEL[["blob", { label }]]reporter option orVITEST_BLOB_LABEL(same)Demo
I setup CI to upload html reports for
test/cliandtest/core. It's viewable on newly introduced viewer #10023.https://viewer.vitest.dev/?url=https://github.com/vitest-dev/vitest/actions/runs/24275938517/artifacts/6383832383
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.