Skip to content

Add verbose modes for easier handler debugging #6

Closed

Description

@stickies-v

With the runner spawning the handler process, debugging test failures is currently a bit involved. Since handlers take input from stdin, they can very easily be manually tested on command line with echo <request> | <handler-bin>.

I propose adding -v (verbose on failure) and -vv (always verbose) args (potentially also a --verbosity={0,1,2}), where:

  • -v will print the full request and response for each failed test
  • -vv will print the full request and response for each test

This way, the failed tests can easily be replicated manually with a simple copy-paste.

Activity

  1. stringintech commented on Dec 4, 2025

    @stringintech
    Owner

    Cool! That should be helpful indeed.
    I wanted to address this after opening #11. Do you think this feature could evolve to also support stateful tests?

  2. stickies-v commented on Dec 4, 2025

    @stickies-v
    ContributorAuthor

    Do you think this feature could evolve to also support stateful tests?

    statefulness was not yet on my radar when I opened this issue, so I haven't thought about it much yet.

    Consider the scenario: func A produces ref $a through request req_a. func B then takes the $a reference parameter through request req_b, and fails. Ideally, -v would unwind this stack trace by first printing req_b, and then recursively going through its reference parameters and printing all those requests too?

    If that proves too complicated to implement, I think just printing the top-level failed request would already provide a lot of benefit though.

  3. stringintech commented on Dec 4, 2025

    @stringintech
    Owner

    The recursive approach makes sense. I will work on it. Thanks!

  4. stringintech commented on Dec 8, 2025

    @stringintech
    Owner

    Last commit in #11 addresses this. It got a bit more involved since state mutations had to be taken into account too (i.e., btck_chainstate_manager_process_block has an effect on the result of btck_chain_get_height), so I introduced a separate entity for it (DependencyTracker) along with unit tests. Also, README.md has been updated to explain the verbose flags, including a sample output.

    I propose adding -v (verbose on failure) and -vv (always verbose) args (potentially also a --verbosity={0,1,2}), where:

    I implemented -v and -vv. Internally, three enum levels are introduced, so adding another flag for verbosity should be straightforward. Let me know if you think having that as well would be helpful.

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