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
bug: CreateTestResult does not dump HTTP response under --verbose #640
microcks supports a global --verbose flag to dump HTTP requests and responses for debugging.
In pkg/connectors/microcks_client.go, GetKeycloakURL, getJSON, UploadArtifact, and DownloadArtifact all call both config.DumpRequestIfRequired(...) and config.DumpResponseIfRequired(...).
However, CreateTestResult (pkg/connectors/microcks_client.go) calls config.DumpRequestIfRequired before c.httpClient.Do(req) and never calls config.DumpResponseIfRequired afterwards.
Expected behavior
CreateTestResult should call config.DumpResponseIfRequired("Microcks for creating test", resp, true) after c.httpClient.Do(req) (just like the other client methods), so response details are visible when --verbose is enabled.
Actual behavior
The outgoing POST /api/tests request is dumped, but the HTTP response status, headers, and body are not dumped.
How to Reproduce?
Run microcks test with --verbose against an endpoint/server that returns an error (e.g., HTTP 400/500) during POST /api/tests:
Hi @Vaishnav88sk!
I checked CreateTestResult in pkg/connectors/microcks_client.go and confirmed config.DumpResponseIfRequired("Microcks for creating test", resp, true) can safely run right after defer resp.Body.Close() and before io.ReadAll (since httputil.DumpResponse restores resp.Body).
If this is ready to be picked up, I'd be happy to open a small PR adding the call plus a unit test in pkg/connectors/microcks_client_test.go.
Activity
ankushkhakale commentedon Nov 25, 2026
Hi @Vaishnav88sk!
I checked
CreateTestResultinpkg/connectors/microcks_client.goand confirmedconfig.DumpResponseIfRequired("Microcks for creating test", resp, true)can safely run right afterdefer resp.Body.Close()and beforeio.ReadAll(sincehttputil.DumpResponserestoresresp.Body).If this is ready to be picked up, I'd be happy to open a small PR adding the call plus a unit test in
pkg/connectors/microcks_client_test.go.