Repository navigation
Commit 618fd23
test: add a coverage report that names where the suites are blind (#146)
Tier 4 of #128, which asked for `--enable-code-coverage` to find blind spots
objectively rather than by eye. This runs it and aggregates the result into
something readable: coverage per area, plus the largest files no test executes.
Both suites are measured, because reading either alone misleads. From the
umbrella package the model architectures look like 0%, which is not because they
are untested but because their tests live in the submodule. Measured separately:
SwiftLM package server 24.4%, inference core 57.7%, SwiftBuddy 5.3%
mlx-swift-lm submodule LLM models 24.1%, VLM models 0.3%, MLXLMCommon 41.3%
Two findings worth acting on.
#128 named `MLXVLM/Models/Gemma4.swift` as having no tests despite being where
SharpAI/mlx-swift-lm#45's changes landed. Measurement confirms it and adds that
it is the single largest untested file in the model layer, at 1771 lines.
More striking is the pattern around it: the VLM half of the model layer is at
**0.3% over 13,304 lines** — Qwen3VL, Qwen35, LFM2VL, GlmOcr, Qwen25VL, Gemma3,
Pixtral, FastVLM are all at zero. CI does run vision and omni end-to-end tests,
so these paths are exercised; nothing touches them at unit level, which is why a
shape or dtype mistake inside one surfaces only as a wrong image answer.
Deliberately not wired into CI. A coverage gate rejects work for touching an
already-thin file and invites tests written to raise a number, and the run costs
a full debug rebuild of both packages. This is a tool to answer "where are we
blind" when someone asks, not a check to pass.
The script says so itself: coverage measures execution, not correctness — a
covered line may be asserted on by nothing at all.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent a08ffd1 commit 618fd23
1 file changed
Lines changed: 126 additions & 0 deletions
| 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 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 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 | + | |
| 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 | + | |
0 commit comments