Commit e895a5e
perf(ci): shard tests for ≤60s per ubuntu job; PR runs ubuntu-only fast path
Cut the monolithic test job (single ~190s vitest run, gated by a 170s cluster
file; 12-29min on CI) into parallel, wall-time-balanced shards so every job on
the PR critical path stays ≤60s — verified on real CI (48 ubuntu shards run
15-59s).
PR critical path = ubuntu only:
- Test sharding (scripts/run-shard.js, driven by the CI matrix): fork-heavy
packages split via vitest --shard (cluster→3, egg→2, mock→2, schedule→4,
security→2, plus redis/multipart/development standalone), each capped with
--maxWorkers so forked egg cluster processes don't oversubscribe the CPU; the
light remainder greedy bin-packed by per-dir cpu weight into 8 rest-* shards.
- Long single test files split by `describe` block (no semantic change, no
removed cases) so vitest can parallelize them.
- quality split into a parallel matrix (lint/typecheck/fmtcheck/build/site) so
the slowest check — not their sum — bounds wall time.
- egg-bin runs without --coverage to stay ≤60s (no threshold; report only).
macOS/Windows whole-suite compatibility (slow: ~13-25min; macOS has only ~5
runner slots) moved to a `test-compat` job that runs at merge time
(merge_group) and on push to next — NOT on pull_request — so it no longer gates
the PR wall while still enforcing cross-platform coverage before code lands.
CI test jobs on a PR drop from 132 to the 48 ubuntu shards.
Latent bugs fixed along the way:
- tegg controller ControllerMetaManager.test.ts triggers a duplicate-proto
error that polluted the process-global registry under isolate:false, failing
sibling files; isolated that project (isolate:true).
- clean-dist used `ut run clean --workspaces` which aborts the && chain (root has
no clean script) → scripts/clean-dist.js.
- typecheck/pretest used `ut run <self> --workspaces`, which includes the root
and recurses infinitely → scripts/run-workspaces.js (concurrent, root-bin PATH).
- Windows runner images no longer set %HOME%, breaking egg_loader getHomedir;
export HOME=%USERPROFILE% on the windows compat job.
Windows flakes absorbed by --retry. No test semantics changed or cases removed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 5c856b3 commit e895a5e
46 files changed
Lines changed: 2392 additions & 1552 deletions
File tree
- .github/workflows
- packages
- cluster/test
- master
- egg/test/lib/plugins
- plugins
- development/test
- mock/test
- schedule/test
- scripts
- tegg/plugin/controller
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
22 | 31 | | |
23 | 32 | | |
24 | 33 | | |
25 | | - | |
| 34 | + | |
26 | 35 | | |
27 | 36 | | |
28 | 37 | | |
| |||
41 | 50 | | |
42 | 51 | | |
43 | 52 | | |
| 53 | + | |
44 | 54 | | |
45 | 55 | | |
46 | 56 | | |
| 57 | + | |
47 | 58 | | |
48 | 59 | | |
49 | 60 | | |
| 61 | + | |
50 | 62 | | |
51 | 63 | | |
52 | 64 | | |
| 65 | + | |
53 | 66 | | |
54 | 67 | | |
55 | 68 | | |
| 69 | + | |
56 | 70 | | |
57 | 71 | | |
58 | 72 | | |
59 | 73 | | |
60 | 74 | | |
61 | 75 | | |
62 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
63 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
64 | 157 | | |
65 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
66 | 186 | | |
67 | 187 | | |
68 | 188 | | |
69 | | - | |
| 189 | + | |
70 | 190 | | |
71 | 191 | | |
72 | 192 | | |
73 | 193 | | |
74 | 194 | | |
75 | 195 | | |
76 | | - | |
77 | | - | |
| 196 | + | |
| 197 | + | |
78 | 198 | | |
79 | 199 | | |
80 | 200 | | |
| |||
130 | 250 | | |
131 | 251 | | |
132 | 252 | | |
133 | | - | |
134 | | - | |
135 | | - | |
| 253 | + | |
| 254 | + | |
136 | 255 | | |
137 | 256 | | |
138 | 257 | | |
139 | 258 | | |
140 | | - | |
141 | | - | |
| 259 | + | |
| 260 | + | |
142 | 261 | | |
143 | 262 | | |
144 | 263 | | |
| |||
148 | 267 | | |
149 | 268 | | |
150 | 269 | | |
151 | | - | |
152 | | - | |
153 | 270 | | |
154 | 271 | | |
155 | 272 | | |
| |||
163 | 280 | | |
164 | 281 | | |
165 | 282 | | |
166 | | - | |
167 | | - | |
| 283 | + | |
| 284 | + | |
168 | 285 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
173 | 290 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 291 | + | |
| 292 | + | |
180 | 293 | | |
181 | 294 | | |
182 | 295 | | |
| |||
207 | 320 | | |
208 | 321 | | |
209 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
210 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
211 | 333 | | |
212 | 334 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
| 335 | + | |
221 | 336 | | |
222 | 337 | | |
223 | 338 | | |
| |||
263 | 378 | | |
264 | 379 | | |
265 | 380 | | |
| 381 | + | |
266 | 382 | | |
267 | 383 | | |
268 | | - | |
| 384 | + | |
269 | 385 | | |
270 | 386 | | |
| 387 | + | |
| 388 | + | |
271 | 389 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | | - | |
| 38 | + | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
41 | 57 | | |
42 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
43 | 80 | | |
44 | 81 | | |
45 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | | - | |
| 28 | + | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
0 commit comments