Commit 383cbbe
authored
refactor(ci): let resolution gate reuse benchmark artifact (#1167)
* refactor(ci): let resolution gate reuse benchmark artifact
The pre-publish-benchmark job's `Run resolution benchmark` step builds
codegraphs for ~34 language fixtures, computes precision/recall, and
writes resolution-result.json. The `Gate on resolution thresholds` step
that follows then ran the same vitest suite which independently copied
every fixture and rebuilt the graphs again — doubling the most expensive
slice of the publish pipeline.
Extend the script's per-language LangResult to include
falsePositiveEdges and falseNegativeEdges so the gate test has
everything it needs for the existing precision/recall threshold
assertions and failure messages. Refactor the gate test to consume
that artifact when RESOLUTION_RESULT_JSON is set, falling back to the
build-from-fixtures path when unset so devs can still run
`npx vitest run tests/benchmarks/resolution/...` standalone. Wire the
env var through the workflow's Gate step.
Verified locally: gate test in artifact mode passes 170/170 in ~0.5s
against an artifact produced by scripts/resolution-benchmark.ts, and
the legacy build-from-fixtures path still passes for the javascript
fixture.
Closes #1052
* fix(ci): preserve full precision and guard malformed resolution artifacts (#1167)
- scripts/resolution-benchmark.ts: stop rounding precision/recall to 3
decimals before writing the artifact. The rounding let a near-miss like
0.8497 round up to 0.850 and silently clear a 0.85 threshold in CI
artifact mode while failing in fixture mode.
- tests/benchmarks/resolution/resolution-benchmark.test.ts: validate
numeric fields in metricsFromArtifact so a stale or malformed artifact
surfaces a clear 'regenerate' error instead of a confusing TypeError at
the threshold assertions.
- tests/benchmarks/resolution/resolution-benchmark.test.ts: reject an
empty artifact in loadArtifact. Without this guard, an empty {} would
register zero describe blocks and vitest would exit 0 with '0 tests',
silently passing the gate.1 parent 0198c57 commit 383cbbe
3 files changed
Lines changed: 117 additions & 20 deletions
File tree
- .github/workflows
- scripts
- tests/benchmarks/resolution
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
336 | 342 | | |
337 | 343 | | |
338 | 344 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
126 | 133 | | |
127 | | - | |
128 | | - | |
| 134 | + | |
| 135 | + | |
129 | 136 | | |
130 | 137 | | |
131 | 138 | | |
132 | 139 | | |
133 | 140 | | |
134 | 141 | | |
| 142 | + | |
| 143 | + | |
135 | 144 | | |
136 | 145 | | |
137 | 146 | | |
| |||
Lines changed: 100 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
11 | 17 | | |
12 | 18 | | |
13 | 19 | | |
| |||
262 | 268 | | |
263 | 269 | | |
264 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
265 | 344 | | |
266 | 345 | | |
267 | 346 | | |
| |||
276 | 355 | | |
277 | 356 | | |
278 | 357 | | |
279 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
280 | 363 | | |
281 | 364 | | |
282 | 365 | | |
| |||
309 | 392 | | |
310 | 393 | | |
311 | 394 | | |
312 | | - | |
313 | | - | |
314 | | - | |
| 395 | + | |
315 | 396 | | |
316 | 397 | | |
317 | 398 | | |
318 | | - | |
319 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
320 | 404 | | |
321 | | - | |
| 405 | + | |
322 | 406 | | |
323 | | - | |
324 | | - | |
325 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
326 | 410 | | |
327 | | - | |
| 411 | + | |
| 412 | + | |
328 | 413 | | |
329 | 414 | | |
330 | 415 | | |
| |||
334 | 419 | | |
335 | 420 | | |
336 | 421 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
343 | 425 | | |
344 | 426 | | |
345 | 427 | | |
346 | | - | |
| 428 | + | |
347 | 429 | | |
348 | 430 | | |
349 | 431 | | |
| |||
0 commit comments