Commit 24d34a1
perf(test): default DOM tests to a light setup; isolate heavy registry setup (#2644)
Follow-up to #2641, which sharded the Vitest suite but only parallelized
its cost. This reduces the cost itself.
`setup` was the largest line item in a CI run — 990s cumulative vs 205s
of actual `tests` — because `vitest.setup.dom.tsx` side-effect imports
@object-ui/components, fields, plugin-dashboard and plugin-grid and
re-registers 9 widgets, and under `isolate: true` that module graph
re-executes for every DOM test file. Measured at ~3.3s of pure setup per
file. But an empirical run of the whole `dom` project under a trimmed
setup showed only ~20 of ~310 files actually render through the
ComponentRegistry; the other ~290 paid that 3.3s for nothing.
Split the DOM tests into two projects by need:
- `dom` (default): the new light `vitest.setup.dom-light.tsx` — base
polyfills + jest-dom + RTL cleanup, none of the heavy package graphs.
- `dom-heavy`: the ~20 `heavyDomTests` that drive the registry, keeping
the full `vitest.setup.dom.tsx` (which apps/console also still uses).
`heavyDomTests` was derived empirically, not guessed: every file in it
failed under the light setup (e.g. "page:card not registered"). The list
is self-correcting — a heavy test left off it lands in the light project
and fails loudly in CI, so coverage can't be silently lost, only turned
red with a pointer to the fix.
Behavior-preserving: full suite is 566 files / 6892 tests
(6868 passed, 24 skipped) both before and after, at the same commit.
Local cumulative `setup` drops from ~990s to ~167s.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 6c53960 commit 24d34a1
3 files changed
Lines changed: 111 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
55 | 94 | | |
56 | 95 | | |
57 | 96 | | |
58 | 97 | | |
59 | 98 | | |
60 | 99 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
68 | 115 | | |
69 | 116 | | |
70 | 117 | | |
| |||
89 | 136 | | |
90 | 137 | | |
91 | 138 | | |
92 | | - | |
| 139 | + | |
93 | 140 | | |
94 | 141 | | |
95 | 142 | | |
96 | 143 | | |
97 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
98 | 157 | | |
99 | 158 | | |
100 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
0 commit comments