Skip to content

Widen the sidecar's pure-logic tests and refresh CLAUDE.md - #15

Merged
blakebauman merged 1 commit into
mainfrom
test/widen-sidecar-coverage
Sep 8, 2026
Merged

blakebauman merged 1 commit into
mainfrom
test/widen-sidecar-coverage

Conversation

@blakebauman

Copy link
Copy Markdown
Owner

Follows on from 14fd7c4, taking the sidecar from 7 test files to 11.

Tests

Package Covers
audit Log/Tail round trip, Tail(n) windowing and clamping, a missing log isn't an error, truncated lines are skipped, the log is created 0600, a nil *Logger is a no-op
engine Defaults, SetMode coercing unknown modes to attach, embed recorded without claiming availability, persistence across stores, corrupt engine.json falling back to defaults
compose splitConfigFiles, existingFiles, composeArgs, resolveCompose/resolveComposeOptionalFile (including the inline-YAML temp tree and its cleanup), Discover (skip lists, depth bound, depth clamp, one project per directory), and both output parsers
helm parseReleaseList field mapping, maybeValuesFile (0600, -f wiring, cleanup), str

The picks are the same as the first pass: pure logic that is security-relevant or easy to get subtly wrong.

Parser extraction

To exercise the CLI-output parsing without a docker or helm binary on PATH, three parsers are split out of the methods that shell out — parseComposeLs, parseComposePs, parseReleaseList. No behaviour change.

One fix

helm.List mapped Revision with fmt.Sprint(item["revision"]), so a release whose JSON omits revision reached the UI as the literal string <nil>. str() renders numbers identically and maps an absent field to "".

CLAUDE.md

It claimed there were no tests and no TypeScript linter — both stopped being true in 14fd7c4 and 3f26f9d. It now describes the real gates, documents bun run lint / lint:fix, and records the split-parser convention.

Verification

gofmt -l . clean, go build ./..., go vet ./..., go test ./... — all pass. UI is untouched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ud4Wz8LSXsSuxRyRaJsb3X

Adds tests for audit, engine, compose, and helm, taking the sidecar from 7
test files to 11. The picks are the same as the first pass: pure logic that
is security-relevant or easy to get subtly wrong — audit log permissions and
tail behaviour, engine mode coercion and persistence, compose path/arg
resolution and discovery bounds, helm values-file handling.

To test the CLI-output parsing without a docker or helm binary on PATH, the
three parsers are split out of the methods that shell out — parseComposeLs,
parseComposePs, parseReleaseList — with no change in behaviour.

One fix falls out of the helm tests: List mapped Revision with
fmt.Sprint(item["revision"]), so a release whose JSON omits revision reached
the UI as the literal string "<nil>". str() renders numbers identically and
maps an absent field to "".

CLAUDE.md claimed there were no tests and no TypeScript linter. Both stopped
being true in 14fd7c4 and 3f26f9d respectively, so the file now describes the
real gates, documents bun run lint / lint:fix, and records the split-parser
convention.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ud4Wz8LSXsSuxRyRaJsb3X
@blakebauman
blakebauman merged commit 5c3846b into main Sep 8, 2026
3 checks passed
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.

1 participant