Commit fd1102a
test(cli): edge-case unit tests for pure helpers; raise coverage ratchet
internal/cli is the largest, least-covered package (orchestration) — but many
of its helpers are pure and were untested. Add hermetic, table-driven, edge-case
tests for 19 of them: version parsing (getFeatureIdWithoutVersion incl. digest
pins and registry ports, highestSatisfyingTag, majorOf), arg handling
(appPortPublishArgs, splitExecArgs with the `--`/value-flag rules, envSliceToMap
with `=`-in-value and last-wins), formatting (textTable ragged rows/trailing
trim, encloseStringInBox rune width), config (buildArgs/OptionsFromConfig nil
paths, featureKeyOrderFromFile order, orderedFeatureKeys never-drop invariant),
and misc (folderImageName determinism, addFeatureOption non-map, ociAnnotationID
bad JSON, appliedAny, proxyEnvFromEnviron).
internal/cli 29.1% -> 33.1%, total 50.3% -> 52.6% (hermetic lane). Raise the
ratchet floors accordingly (COVERAGE_MIN 48->52, cli 28->32).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent c8caff1 commit fd1102a
2 files changed
Lines changed: 414 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
0 commit comments