Commit dd140f8
committed
Resolves #7064(FR-2744)
## Summary
FR-2611 dropped `ArtiomTr/jest-coverage-report-action` (Jest-only) when CI moved to Vitest, so PRs lost the coverage diff comment and inline test-failure annotations. This restores the equivalent surface using `davelosert/vitest-coverage-report-action@v2`.
### Local setup
- Add `@vitest/coverage-v8@^4.1.4` as devDependency in `react/`, `packages/backend.ai-ui/`, root.
- Coverage block in each `vitest.config.ts`:
- `provider: 'v8'` — uses Node's V8 inspector, no Babel transform needed (fastest provider).
- `reporter: ['text', 'json', 'json-summary', 'html']` — `json-summary` is what the GitHub Action consumes; `text` keeps a console summary; `html` lets devs open `coverage/index.html` locally.
- `exclude` patterns trim test files, stories, generated Relay artifacts, and zero-logic entries (`src/index.tsx`, `reportWebVitals`, BUI locale catalog, `wsproxy`, bundled `backend.ai-client-node.*`).
- `/coverage` added to `packages/backend.ai-ui/.gitignore` (root and react/ already had it).
### CI setup
- `.github/workflows/vitest.yml` gains `pull-requests: write` permission so the action can post / update its PR comment.
- Each of the three jobs (`react-vitest`, `backend-ai-ui-vitest`, `root-vitest`) runs `pnpm exec vitest run --coverage` and follows it with a `davelosert/vitest-coverage-report-action@v2` step keyed by a unique `name:` so the three PR comments don't collide.
- The action runs with `if: always()` so a coverage comment posts even when tests fail (matches the prior Jest behaviour, which surfaced failed-test annotations).
## Verification
```
=== react/ === Lines 7.23% (1645/22722)
=== BUI === Lines 7.91% (317/4006)
=== root === Lines 3.66% (282/7703)
```
- [x] All three workspaces produce `coverage/coverage-summary.json` in the shape the action expects
- [x] Test pass counts unchanged (react 856/856, BUI 315 + 5 skip, root 90 + 1 skip)
- [x] No regression in lint / format
## Out of scope
- **No coverage threshold gates** — baseline %s above are intentionally low (mostly UI code without unit tests). Gating now would block normal PRs. A separate decision on thresholds belongs to a follow-up after the team agrees on a target.
- README coverage badge.
- Backfilling the 6 `TODO(FR-2609)` skipped tests.
## Stack
Top of the Vite migration stack (now 12 PRs). Builds on PR #6879 (`fix(FR-2606)` webpackIgnore → @vite-ignore).
1 parent c303197 commit dd140f8
8 files changed
Lines changed: 89 additions & 9 deletions
File tree
- .github/workflows
- packages/backend.ai-ui
- react
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
83 | | - | |
84 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
85 | 94 | | |
86 | 95 | | |
87 | 96 | | |
| |||
119 | 128 | | |
120 | 129 | | |
121 | 130 | | |
122 | | - | |
123 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
124 | 139 | | |
125 | 140 | | |
126 | 141 | | |
| |||
150 | 165 | | |
151 | 166 | | |
152 | 167 | | |
153 | | - | |
154 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
62 | 81 | | |
63 | 82 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
| 167 | + | |
167 | 168 | | |
168 | 169 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
100 | 120 | | |
101 | 121 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
34 | 49 | | |
35 | 50 | | |
0 commit comments