You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pkg/hooks tests fail with a misleading assertion when jq is not installed #4052
jq is not part of the Go toolchain and is absent from stock container images
(golang:1.27 does not ship it). When it is missing the hook still runs and exits cleanly — it
just produces no output — so the test does not fail on "command not found". It fails later, on
its content assertion, with an error that points at the hook plumbing instead of at the machine.
Expected Behavior
A missing external tool is reported as a missing external tool: the test skips with a reason
naming jq, and the package still reports ok.
Nothing in that message mentions jq. It reads as "the stop hook is not receiving the response
content", i.e. a product defect in hook input plumbing.
Steps to Reproduce
Use a machine or container without jq (e.g. the stock golang:1.27 image).
go test ./pkg/hooks/
Observe the failure above.
Docker Agent version
No response
OS & terminal
No response
Model used
No response
Error output
=== RUN TestExecuteStopReceivesResponseContent
hooks_test.go:586:
Error Trace: pkg/hooks/hooks_test.go:586
Error: "" does not contain "final answer content"
Test: TestExecuteStopReceivesResponseContent
--- FAIL: TestExecuteStopReceivesResponseContent (0.00s)
FAIL github.com/docker/docker-agent/pkg/hooks 20.059s
Confirmed as environmental, not a regression — it reproduces on unmodified `main`
(`f2807d1bb`), 3 runs out of 3, and disappears the moment `jq` is installed.
Screenshots
No response
Additional context
The cost of this is diagnostic time spent in the wrong place. Found while verifying an unrelated
branch: the failure was initially read as a merge regression, and it took a baseline run against
untouched main plus tracing the helper to identify a missing package as the cause.
It also makes the package quietly hostile to contributors whose machines lack jq — the first
run of the suite reports what looks like a real bug.
Only one test uses the helper, so the blast radius is small and the fix is contained.
Activity