Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    s3ni0r
    @s3ni0r
    @agourlay so yeah, in order to be aligned with the specs, the redirect over post methods should not be implicit but user defined via configuration or code
    here is a post explaining it using Apache httpClient https://www.baeldung.com/httpclient-redirect-on-http-post
    Arnaud Gourlay
    @agourlay
    Thank you for the follow up.
    Just did a quick investigation and I could not find a redirect configuration on the http4s client.
    I recommend that you upgrade to the latest version of cornichon in order document the behaviour again :)
    s3ni0r
    @s3ni0r
    Yeah i finally managed to upgrade to latest 19.0 version, it's all good, thanks a lot again for this awesome library.
    Gabriel Francisco
    @gabfssilva

    @agourlay, sorry for the delay.

    first of all, thanks for all this effort, this library is amazing!

    answering about my concern about deprecating scalatest: how is running the tests inside the IDE going to work from now on? besides that, what about other scalatest goodies?

    Arnaud Gourlay
    @agourlay
    @s3ni0r Happy to hear that. Do not hesitate to create an issue regarding HTTP redirect if you think the library is not doing a good job there.

    @gabfssilva No worries for the delay :)
    Regarding the deprecation of Scalatest and the lost goodies and I can only see:

    • running the tests in the IDE
    • having an HTML report

    Those two things are not something that my team and I are using so it will have to be contributed by the community I guess.
    Do see other goodies missing?
    How unhappy are you about this answer?

    s3ni0r
    @s3ni0r
    @agourlay i don't have the HTTP redirect issue anymore, and it was not related to Cornichon, and regarding @gabfssilva remarks on scalatest and IDE integration, it's true that my team also use the Intellij scalatest integration to run integration tests locally, but it does not bother me as i use sbt instead.
    what i'm facing now as a challenge is to run all integration test in gitlab-ci against neo4j and some Rest Api service, i'm trying to use testcontainers-scala to spin up these two services, but i can't figure out how to integrate it with cornichon to spin them once for all Features and Scenarios.
    s3ni0r
    @s3ni0r
    well, i think i'll have to use this sbt configuration combined with docker/compose image to handle docker instances creation and cleanup in gitlabci
    testOptions in IntegrationTest += Tests.Setup { () => ??? }
    testOptions in IntegrationTest += Tests.Cleanup { () => ?? }
    Arnaud Gourlay
    @agourlay
    I usually recommend separating setting up the env. from running the tests.
    In my build pipeline at work, we have different steps like
    1- setup env. (bash script, docker whatever)
    2- run tests
    3- shutdown env.
    In the future I'd like to offer a global hook for BeforeAllTheThings and this will be easier to do using cornichon-test-framework over the scalatest flavor.
    Something similar to agourlay/cornichon#71 so that one could setup things in the Session in one place.
    For the time being I am afraid you are stuck with the SBT trick you described.
    Or you put all your scenarios in a single feature and use BeforeFeature.
    s3ni0r
    @s3ni0r
    @agourlay Yep, and yeah a BeforeAllTheThings global hook would be a great addition to Cornichon.
    Arnaud Gourlay
    @agourlay
    FYI I finally took the time to look at the HTTP redirect feature.
    As http4s supports it I decided to add it quickly.
    https://github.com/agourlay/cornichon/commit/07ed909bfbf9a852be0f6ff0c92ffd18fe18d535#diff-8a1e382d78e038c177490bbf2922a02aR65
    The next release will ship a new configuration knob called followRedirect which is false by default.
    I used arbitrarily 10 as maxRedirects
    s3ni0r
    @s3ni0r
    @agourlay nice work! Thanks a lot again!
    Arnaud Gourlay
    @agourlay
    Srepfler Srdan
    @schrepfler
    👏👏👏
    s3ni0r
    @s3ni0r
    Hello,
    @agourlay, i would like to discuss an annoying problem i'm facing with transitive dependencies in cornichon 1.19.0
    we are using sangria version 1.4.2, and i've noticed that version 2.0.0-M3 is being pulled and chosen over the 1.4.2 due to cornichon
    in Ivy and Coursier, the default dependency conflict resolver choses the latest version and i was forced to use dependencyOverride to use the wanted sangria version
    we don't have a problem with using the latest version of a transitive dependency, but it need to be a stable one (not an M or RC)
    s3ni0r
    @s3ni0r
    how do you manage that in your production?
    Arnaud Gourlay
    @agourlay
    @s3ni0r the way I fix this is by having the cornichon tests and the production code not sharing their classpath. A.k.a different projects.
    Sangria 2.0.0 was released yesterday, you could try to upgrade your application as well.
    I can also plan a release of 0.19.1 soon as it would ship the dependency update agourlay/cornichon@81eebe7
    s3ni0r
    @s3ni0r
    @agourlay i see, thanks!
    Arnaud Gourlay
    @agourlay
    @s3ni0r this release ships with a stable version of Sangria :point_up:
    s3ni0r
    @s3ni0r
    Great 🥳, thanks!
    Arnaud Gourlay
    @agourlay
    0.19.3 is out with important bug fixes :fire_engine:
    https://github.com/agourlay/cornichon/releases/tag/v0.19.3
    Peter Gerhard
    @peter-gerhard
    Hey, I wanted to set up for contribution: the link to the instructions to build the documentation locally is broken https://github.com/agourlay/cornichon/blob/master/CONTRIBUTING.md
    Arnaud Gourlay
    @agourlay
    @peter-gerhard Good catch :thumbsup:
    I fixed here agourlay/cornichon@8541ad1
    Peter Gerhard
    @peter-gerhard
    This message was deleted
    Arnaud Gourlay
    @agourlay
    0.19.4 is out with new assertions to validate changes in session :tada:
    https://github.com/agourlay/cornichon/releases/tag/v0.19.4
    sahil anand
    @anandsahil
    Hi, I am struggling to find a way to save text/plan body in the session, it always error's out. Is there a way to do it ?
    Arnaud Gourlay
    @agourlay

    @anandsahil this is a bug in the httpDsl which wrongly expects a JSON body in that case.
    In the meantime you could hack the internals using

    And I get("/foo/bar")
    Then I save(s"<${HttpService.lastResponseBodyKey}>" -> "my-plain-text-body" )

    Can you please open a ticket so I do not forget to fix it :)

    sahil anand
    @anandsahil
    yes, I will open a ticket and try to solve it also :-).
    Arnaud Gourlay
    @agourlay
    @anandsahil I found the bug and the fix is rather straight forward (given my knowledge of the internals).
    So either I push my fix or you try to solve it yourself as a learning exercise. :smile:
    Arnaud Gourlay
    @agourlay
    FYI I am trying again to support more than JSON in cornichon.
    I think I finally found an encoding that seems to work without destroying the current DSL.
    Do not hesitate to share ideas, feedback and wishes :grinning:
    agourlay/cornichon#422
    Arnaud Gourlay
    @agourlay
    0.19.5 is out with bug fixes, performance improvements and increased support for non JSON payload :tada:
    https://github.com/agourlay/cornichon/releases/tag/v0.19.5
    Srepfler Srdan
    @schrepfler
    👏👏👏
    ldeck
    @ldeck

    @gabfssilva No worries for the delay :)
    Regarding the deprecation of Scalatest and the lost goodies and I can only see:

    • running the tests in the IDE
    • having an HTML report

    Those two things are not something that my team and I are using so it will have to be contributed by the community I guess.
    Do see other goodies missing?
    How unhappy are you about this answer?

    @agourlay For me running / debugging individual tests in the IDE is pretty crucial to efficiency and broader adoption. I do typically use IntelliJ, as do most of my colleagues across my company.

    Reading the messages here over the last 6-12 months it does seem there’s an increasing number of features being requested that duplicate what’s already available with scalatest. (e.g., tagging tests, running scenarios inside an IDE, reporting, etc).

    I’m curious why Cornichon couldn’t happily extend scalatest’s FeatureSpec or similar, providing what’s unique to cornichon? i.e., without def feature =.

    Srepfler Srdan
    @schrepfler
    I agree, being part of scalatest kind of allows integrating with all the things that work with scalatest
    Arnaud Gourlay
    @agourlay

    @ldeck @schrepfler Thank you for sharing your concerns and raising valid points :thumbsup:

    I understand that the integration with Scalatest has definitely upsides, however it does not offer enough control for Cornichon to implement all the desired features around test lifecycles in a clean fashion.

    Of course, it could be done technically but the strong reliance on side effects to register hooks is not ideal and is simply not something I want to maintain in the future.
    The initial vision was to replace Cucumber by targeting more than Scala devs by offering a simple UX and a powerful DSL abstracting away the complexity of real life testing.
    From that perspective, the custom cornichon-test-framework has served me very well in the past.

    I am currently not in position to commit a significant amount of energy towards developing this library further - outside of regular maintenance and bug fixes.

    Unless the desired integrations with various test frameworks come from the community, it might be better to look for another tool for the time being if this represents a critical aspect of your work.
    I hope this does not come across as too direct, thank you for using Cornichon :love_letter:

    Srepfler Srdan
    @schrepfler
    Ah, the side-effects thing. I understand your concerns better now too 🙏. There are now test frameworks which make test results first order citizens and getting traction in the scala community no? Maybe we can lean on them, just to continue taking advantage of the wider ecosystem?
    Arnaud Gourlay
    @agourlay
    I heard good things about munit and weaver-test but I do not know yet if it is possible to interface with them programmatically.
    I recommend to have a look at how it is done for scalatest and to give it a try :thumbsup:
    Arnaud Gourlay
    @agourlay
    Happy to review any experiment!
    ldeck
    @ldeck
    Thanks for the explanation @agourlay. All good.