Skip to content

test(cli): golden-test the apps get panel and drop stale fixtures - #96

Merged
jonoirwinrsa merged 3 commits into
mainfrom
test/cli-restore-apps-get-goldens
Aug 12, 2026
Merged

test(cli): golden-test the apps get panel and drop stale fixtures#96
jonoirwinrsa merged 3 commits into
mainfrom
test/cli-restore-apps-get-goldens

Conversation

@jonoirwinrsa

Copy link
Copy Markdown
Contributor

Stacked on #95 — base is fix/cli-drop-dead-instance-section. Merging that will retarget this to main. Stacked rather than parallel because both touch apps/testdata.

Why

#95 turned up four golden files under apps/testdata that no test referenced. They were never compared, and -update never touched them.

Three of them describe the detail panel apps get prints on success. So the main output of the command had no golden coverage at all — only the loading, error and not-found states were checked. That's also why the removed section in #95 sat there unnoticed: the file depicting it was inert.

They were orphaned for a real reason. The panel reaches the terminal through tea.Println for scrollback rather than through View(), so once details load View() returns empty and the harness has nothing to compare. Re-attaching ViewGolden to those steps would have golden-tested an empty string.

What

Renders formatAppDetailsTable directly, over the same four fixtures the goldens were built from: GPU, CPU-only, unparseable numeric fields, and empty hardware fields.

The three existing goldens pass unmodified. Their content still matches the current renderer byte for byte — the only discrepancy was trailing whitespace, which the harness strips via normalizeView and a direct call doesn't. Trimming the same way makes them pass as-is.

Only get_success_gpu.golden is newly generated, because #95 deleted it. Worth eyeballing: it is identical to the old file minus the section that PR removes, which is a decent end-to-end check on that change.

Also deletes internal/ui/commands/testdata/logs_initial_loading.golden — byte-identical to the referenced logs_initial.golden, left behind when the step was renamed. Confirmed with diff before removing.

After this, no golden file anywhere in the repo is unreferenced. I checked every testdata directory, not just this one.

Testing

go build, go vet, go test ./... clean.

On golden regeneration: I ran -update scoped to the single new GPU fixture. The other three were never regenerated — git status showed them unmodified throughout, which is the point.

The plain-text path (formatAppDetailsSimple) still has only assert.Contains coverage via the existing Test_formatAppDetailsSimple. I left that alone rather than converting it — happy to golden it too if you'd prefer the symmetry.

Base automatically changed from fix/cli-drop-dead-instance-section to main August 10, 2026 19:04
Four golden files under apps/testdata were not referenced by any test, so they
were never compared and `-update` never touched them. Three of them describe the
detail panel `apps get` prints on success — which means that panel, the main
output of the command, had no golden coverage at all. Only the loading, error
and not-found states were checked.

They were orphaned because the panel reaches the terminal through tea.Println
for scrollback rather than through View(), so View() is empty once details load
and the harness has nothing to compare.

Render formatAppDetailsTable directly instead, over the fixtures the goldens were
built from: GPU, CPU-only, unparseable numeric fields and empty hardware fields.
The three existing goldens pass unmodified — the output matches byte for byte
once trimmed the way the harness trims View(). Only the GPU fixture is newly
generated, since its file was removed as stale in the parent change.

Also deletes internal/ui/commands/testdata/logs_initial_loading.golden, a
byte-identical duplicate of logs_initial.golden left behind by a step rename.

No golden file under apps/ or elsewhere is unreferenced after this.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jonoirwinrsa
jonoirwinrsa force-pushed the test/cli-restore-apps-get-goldens branch from b335dbe to 1c667ac Compare August 10, 2026 19:09
@jonoirwinrsa
jonoirwinrsa merged commit 486043c into main Aug 12, 2026
4 checks passed
@jonoirwinrsa
jonoirwinrsa deleted the test/cli-restore-apps-get-goldens branch August 12, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants