test(cli): golden-test the apps get panel and drop stale fixtures - #96
Merged
Conversation
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
force-pushed
the
test/cli-restore-apps-get-goldens
branch
from
August 10, 2026 19:09
b335dbe to
1c667ac
Compare
wesrobin
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
#95 turned up four golden files under
apps/testdatathat no test referenced. They were never compared, and-updatenever touched them.Three of them describe the detail panel
apps getprints 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.Printlnfor scrollback rather than throughView(), so once details loadView()returns empty and the harness has nothing to compare. Re-attachingViewGoldento those steps would have golden-tested an empty string.What
Renders
formatAppDetailsTabledirectly, 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
normalizeViewand a direct call doesn't. Trimming the same way makes them pass as-is.Only
get_success_gpu.goldenis 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 referencedlogs_initial.golden, left behind when the step was renamed. Confirmed withdiffbefore removing.After this, no golden file anywhere in the repo is unreferenced. I checked every
testdatadirectory, not just this one.Testing
go build,go vet,go test ./...clean.On golden regeneration: I ran
-updatescoped to the single new GPU fixture. The other three were never regenerated —git statusshowed them unmodified throughout, which is the point.The plain-text path (
formatAppDetailsSimple) still has onlyassert.Containscoverage via the existingTest_formatAppDetailsSimple. I left that alone rather than converting it — happy to golden it too if you'd prefer the symmetry.