Skip to content

bug: CreateTestResult does not dump HTTP response under --verbose #640

Backlog

Description

@Vaishnav88sk

Describe the bug

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:

microcks test "MyAPI:1.0" http://localhost:8080 OPEN_API_SCHEMA --verbose

Microcks version or git rev

No response

Install method (docker-compose, helm chart, operator, docker-desktop extension,...)

No response

Additional information

Pointers for Contributors

  • pkg/connectors/microcks_client.go (CreateTestResult)
  • Add unit test coverage in pkg/connectors/microcks_client_test.go verifying response dumping when config.Verbose = true.

Activity

  1. ankushkhakale commented on Nov 25, 2026

    @ankushkhakale

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions