cornichon v0.17.0 Release Notes

Release Date: 2019-02-19 // almost 4 years ago
  • βœ… Property based testing support

    πŸš€ This is the big new feature of that release, a brand-new module to enable property based testing of HTTP API

    βœ… It offers two flavors of testing, the classical forAll approach and a way to explore API interactions randomly.

    πŸ“š For more information please refer to the documentation of the cornichon-check module: http://agourlay.github.io/cornichon/modules/module-check.html

    πŸš€ The release also contains the usual batch of breaking changes and improvements.

    πŸ’₯ Breaking changes

    DebugStep now requires an explicit title

    🚚 ResourceStep was moved to com.github.agourlay.cornichon.steps.wrapped.ResourceStep

    RepeatConcurrently has an additional parallelism parameter to work as a stream processor.

    In the following example, the nested block will be executed 500 times by groups of 10 in a streaming fashion.

    RepeatConcurrently(times = 500, parallelism = 10, maxTime = 10.seconds) { Given I get("https://github.com/agourlay/cornichon") Then assert status.is(200) }
    

    JsonPath.run now returns an Option

    • None instead of JNull if the path is not present

    - use JsonPath.runStrict to return an error if absent

    The json body assertions are not conflating a null field with an absent field anymore.

    given the following response body
    { β€œdata” : null }

    in 0.16.x

    body.path(β€œdata”).isAbsent is correct
    body.path(β€œdata”).isPresent is incorrect

    in 0.17.x
    body.path(β€œdata”).isAbsent is incorrect
    body.path(β€œdata”).isPresent is correct

    and additional matcher has been added for that case
    body.path(β€œdata”).isNull

    AttachStep/AttachAsStep now requires Session β‡’ List[Step] instead of a List[Step]

    - it enables FlatMap-like behavior.

    EffectStep.chainEffects is gone because it promoted the direct usage of the effect function which breaks encapsulation and error reporting.

    • use AttachStep instead to bind steps together.

    πŸ‘Œ Improvements

    πŸ‘Œ improve error reporting and logging for cornichon-test-framework

    • the final message reported now contains the full log

    - ignored features will not create noise in the logs

    πŸ†• new cats.EffectStep which is not using Future but interop with the cats-effects Effect instead

    import com.github.agourlay.cornichon.steps.cats.EffectStepval myTaskEffect = EffectStep("identity task", s =\> Task.now(Right(s)))
    
    • βž• add oscillation detection to Eventually in order to fail if the final successful state is not reached with oscillation of errors.

      Given I send_async_command_updating_search_indexEventually(maxDuration = 1.seconds, interval = 100.ms, oscillationAllowed = false) { Given I search_for_new_state Then assert status.is(200) }

    πŸ‘€ Here, an oscillation could be seen in the status with something like 404 -> 500 -> 404 -> 200.
    βœ… The oscillation detector would fail the test because of the 404 oscillation.

    This flag can come in handy when dealing with eventually consistent system that should converge to a final state without oscillation.

    ⚑️ Dependency updates

    • monix 3.0.0-RC2
    • cats 1.6.0
    • circe 0.11.1
    • http4s 0.20.0-M5
    • πŸ”§ moved from ficus to PureConfig to manage configuration