- dev auth flow (side-step OAuth) - db event processing integration tests - dev scripts (eg Makefile) - db / test db migration setup scripts.
2.6 KiB
Work Summary — 2026-08-04 22:53
Task
Investigate and, if fixable, fix the two pre-existing failing tests (ExampleBar, ExampleLineChart in server/ui/charts) flagged during the test-coverage work.
Investigation
Read bar.go/line.go (the renderers) and their tests. Both the source files and their tests were introduced in a single commit, c51ad80 "prototyped svg reports" (git log shows no other commits touching either) - so this wasn't drift accumulated over time, it was the renderer being finished after (or without) the test's expected output ever being filled in, then committed as-is (the commit message itself says "prototyped").
The renderer code itself looks intentional and coherent, not buggy:
Bar.SVG()draws value labels above each bar and a rotated per-barLabeltext, pluspadding/border-widthstyling androunded-lg border-borderclasses - all deliberate, readable code, not something that looks like an accident.LineChart.SVG()draws apolyline, anellipsemarker at each point, and a (here, empty, since the test fixture sets noLabel) text element per point viaupsideDownCenteredText- also coherent.
The old // Output: expectations were a bare, unstyled rect list (bar_test.go) and a completely empty <svg>...</svg> shell with no children at all (line_test.go) - clearly placeholders from before the labeling/styling/point-rendering features existed, not a description of intended behavior that the code regressed from.
Conclusion: fixable, and the fix is "update the stale expected output to match the current, correct renderer" - not a renderer bug to chase.
Change
Regenerated both expectations from the renderers' actual current output (captured via go test -v, substituted into the test files with a small Python script rather than hand-typing ~3KB single-line SVG strings, to avoid transcription errors) and replaced the // Output: line in each file. One line changed per file.
Verification
go build ./...clean.go test ./server/ui/charts/... -v: bothExampleBarandExampleLineChartpass.gofmt -lon both changed files: clean.make test: full suite now exits 0 (previously failed only on these two).go vet ./...: same two pre-existing, unrelatedunreachable codewarnings as before (domains/accounts/accounts.go:1472,server/sse/publisher.go:141) - untouched by this change.
Follow-ups / not done here
- None specific to this fix. The dev-iteration plan (secrets, dev auth,
make dev, test coverage, refresh-token bug, and now these) is fully closed out as of this session.