Skip to content

Commit c0c0ebc

Browse files
authored
docs: mention file-based attachments are not included in blob report and update CI example (#9641)
1 parent 7c94c17 commit c0c0ebc

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

docs/guide/improving-performance.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,15 @@ jobs:
159159
include-hidden-files: true
160160
retention-days: 1
161161

162+
- name: Upload attachments to GitHub Actions Artifacts
163+
if: ${{ !cancelled() }}
164+
uses: actions/upload-artifact@v4
165+
with:
166+
name: blob-attachments-${{ matrix.shardIndex }}
167+
path: .vitest-attachments/**
168+
include-hidden-files: true
169+
retention-days: 1
170+
162171
merge-reports:
163172
if: ${{ !cancelled() }}
164173
needs: [tests]
@@ -183,10 +192,19 @@ jobs:
183192
pattern: blob-report-*
184193
merge-multiple: true
185194

195+
- name: Download attachments from GitHub Actions Artifacts
196+
uses: actions/download-artifact@v4
197+
with:
198+
path: .vitest-attachments
199+
pattern: blob-attachments-*
200+
merge-multiple: true
201+
186202
- name: Merge reports
187203
run: npx vitest --merge-reports
188204
```
189205
206+
If your tests create file-based attachments (for example via `context.annotate` or custom artifacts), upload and restore [`attachmentsDir`](/config/attachmentsdir) in the merge job as shown above.
207+
190208
:::
191209

192210
:::tip

docs/guide/reporters.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,9 @@ All blob reports can be merged into any report by using `--merge-reports` comman
592592
npx vitest --merge-reports=reports --reporter=json --reporter=default
593593
```
594594

595+
Blob reporter output doesn't include file-based [attachments](/api/advanced/artifacts.html#testattachment).
596+
Make sure to merge [`attachmentsDir`](/config/attachmentsdir) separately alongside blob reports on CI when using this feature.
597+
595598
::: tip
596599
Both `--reporter=blob` and `--merge-reports` do not work in watch mode.
597600
:::

0 commit comments

Comments
 (0)