Skip to content

Making hegel-java usable as a library #12

Description

@aphyr

I'd like to write a Clojure client that uses this library, but there are some parts that make that hard.

  1. Hegel used to return a map that told you if the test passed, how many cases were executed, number of cases, how many were interesting, whether health checks failed, etc. I can't figure out how to get that information any more. Could we have a structure returned by Hegel.test()? Bonus points if it includes (e.g.) a map of labels to generated values for the minimal failing case(s).

  2. It's not clear what the Consumer passed to test() should do. I'm guessing that any non-exceptional return value is a valid test case. Is it OK to throw any exception? Any throwable (e.g. InterruptedException?) Do the exceptions specifically need to be JUnit ones? Is there special JUnit state that Hegel relies on, or is it OK to construct and throw the exceptions ourselves?

  3. Does Hegel do anything with the fields of the assertions thrown, or is it just a pass/fail signal?

  4. Hegel takes over printing to stderr/stdout, which fights with other logging/printing and does not play well with concurrency. Having a return value for TestCase might fix this, but you might also consider having a Reporter interface with callbacks for various Hegel events.

  5. It would be very helpful to have something like testCase.isFinal(), so you could do your own debugging/logging on the final cases.

  6. How should we signal spans?

Activity

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