From 951017e1f995e1cc141725eae6f91651546c512c Mon Sep 17 00:00:00 2001 From: Manas Srivastava Date: Sat, 23 May 2026 09:34:46 +0530 Subject: [PATCH] test(extras): cover RECEIVE_URL branch in runResourceDetail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The golangci-lint patch (#9) touched cmd/extras.go:195 (the `detail.ReceiveURL != ""` Fprintf branch), which the 100%-patch-coverage gate then flagged as uncovered — the human-output success test sent a payload without `receive_url`, and the JSON test takes the early encode-return path before reaching that line. Add `receive_url` to the human-output success fixture so the branch executes. No production code change. Co-Authored-By: Claude Opus 4.7 (1M context) --- cmd/extras_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/extras_test.go b/cmd/extras_test.go index 42f833b..c3b3c66 100644 --- a/cmd/extras_test.go +++ b/cmd/extras_test.go @@ -97,8 +97,9 @@ func TestRunResourceDetail_Success_HumanOutput(t *testing.T) { _, _ = w.Write([]byte(`{ "token":"tok","id":"id-1","resource_type":"postgres","name":"app", "env":"production","tier":"pro","status":"active", - "connection_url":"postgres://u:p@x/db","created_at":"2026-01-01", - "expires_at":"2026-12-31" + "connection_url":"postgres://u:p@x/db", + "receive_url":"https://hooks.instanode.dev/tok", + "created_at":"2026-01-01","expires_at":"2026-12-31" }`)) })) defer srv.Close()