Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Arnaud Gourlay
    @agourlay
    @schrepfler I am waiting for a release of Sangria targeting 2.13.
    @mikhail-g I am not sure what you mean by a test management tool. Do you have some examples of products?
    FYI at work I am using TeamCity to run Cornichon tests and it gives a lot of metadata about the runs.
    mikhail-g
    @mikhail-g
    @agourlay I mean test management tool like qTest, TestRail, Zephyr, Rally etc the system that stores test cases and test run results.
    Basically what I need is to dynamically get the status, name, and parameters of feature/scenario/step in afterEachScenario or afterFeature in order to post them to test management tools API
    Arnaud Gourlay
    @agourlay
    Sorry I have zero experience with those tools.
    How do you talk with such systems? Via an HTTP API?
    mikhail-g
    @mikhail-g
    Yes, API of those tools is not a problem. The broblem is to get information about cornichon scenario dynamically and I don't know how could I do that
    Arnaud Gourlay
    @agourlay
    Ok one thing to try.
    SBT generates a junit.xml file containing a lot of information about the scenarios.
    You could check if those tools handle this format.
    Arnaud Gourlay
    @agourlay
    Second idea, if you are using cornichon-scalatest, it is possible to inject a custom reporter.
    I am not a big fan of this because I want to deprecated the cornichon-scalatest module.
    There is the backlog this issue that sounds similar agourlay/cornichon#232
    Otherwise I would need to develop a new system of hooks similar to the Scalatest reporter to expose internals to the users.
    But TBH this is currently not a priority for me so it would to be a contribution coming from the community.
    mikhail-g
    @mikhail-g
    Thank you for the clarification @agourlay
    Is there a way to run a subset of tests by tags or groups like in Cucumber or Junit?
    I found only testOnly *CornichonExamplesSpec, but it's not the desired solution if you want to run smoke or regression tests only
    Arnaud Gourlay
    @agourlay
    there is currently not official system for tagging tests
    it is a popular request though, so it is strongly gaining priority in the list of next development
    Michal Losiewicz
    @mlosiewicz-pl
    Hello @agourlay, is there a way to replace the http client in cornichon? or build it differently? I was going through the code and couldn't find an easy way to do it.
    Arnaud Gourlay
    @agourlay
    @mlosiewicz-pl no there is no way to to do that currently.
    The internal of http4s are slowly creeping in the HttpService.
    What are you trying to achieve?
    Michal Losiewicz
    @mlosiewicz-pl
    I wanted to check if the http client is causing issues with retries but it looks like the problem was elsewhere, thanks for the answer
    Arnaud Gourlay
    @agourlay
    Thanks for the update :)
    SStepanoFF
    @SStepanoFF
    Hello @agourlay . Is it possible to store in session List of objects inside the EffectStep?
    Arnaud Gourlay
    @agourlay
    @SStepanoFF Session stores String.
    This means you would like to have a List[String] instead?
    What are you trying to do exactly? :)
    SStepanoFF
    @SStepanoFF
    @agourlay yes, for example, I want to store List[String] or list of any other objects.
    Arnaud Gourlay
    @agourlay
    I don't feel good about saving random objects in the Session for the moment, don't expect String to go away soon.
    Are you using JSON for your payloads?
    You could serialize an array of JSON object and get it done.
    SStepanoFF
    @SStepanoFF
    It's not a JSON but anyway thank you for the answers
    Arnaud Gourlay
    @agourlay
    May I ask what type it is?
    SStepanoFF
    @SStepanoFF
    It is a list of objects of my custom class
    Arnaud Gourlay
    @agourlay
    is it coming from the network?
    SStepanoFF
    @SStepanoFF
    sorry, i think I made a misunderstanding. I don't need this session storage for the payloads. I just wont to store data
    Piotr Gawryś
    @Avasil
    Hi, is there any new release planned? Would it be possible to get a snapshot from master? I have some binary incompatibilities coming from other libraries using circe 0.12 and it would be the most convenient fix :D
    Arnaud Gourlay
    @agourlay
    The next release is 0.19.0 and it will be done as soon as all the dependencies are available for 2.13.
    Currently, only one library is missing embedded-kafka which should be done soon.
    embeddedkafka/embedded-kafka#33
    In the meantime, I have just published a snapshot release from master for you.
    published cornichon-core_2.12 to https://oss.sonatype.org/content/repositories/snapshots/com/github/agourlay/cornichon-core_2.12/0.19.0-SNAPSHOT/cornichon-core_2.12-0.19.0-SNAPSHOT.jar
    Please tell me if you have issues with it as I have not updated the docs yet.
    Piotr Gawryś
    @Avasil
    Thank you for superfast response! It looks like our codebase compiled without any errors
    Arnaud Gourlay
    @agourlay
    @/all I am happy to announce the release of cornichon 0.19.0 :tada:
    https://github.com/agourlay/cornichon/releases/tag/v0.19.0
    Gabriel Francisco
    @gabfssilva
    I see there's a plan to deprecate scalatest module. Does it mean it'll not work with Scalatest anymore in the future?
    olegulka
    @olrgolrg_twitter
    I can send file in body?
    Arnaud Gourlay
    @agourlay
    @gabfssilva the module cornichon-scalatest transform cornichon feature/scenario into Scalatest tests.
    There are some exception but it is mostly an implementation detail for the end user.
    Do you have some specific concerns in mind?
    @olrgolrg_twitter Uploading files is currently not supported by cornichon. There is an issue open agourlay/cornichon#140 but it is currently not a priority. A good area for contribution :)
    s3ni0r
    @s3ni0r
    Hi everyone,
    Thank you @agourlay for the awesome library that makes our work easier :)
    i'm trying to understand how cornichon handles redirects following Http response with status 307
    using a normal apache http client we can specify a redirect policy that can be strict which allows redirect only on some http methods and loose to allow redirect on POST method
    s3ni0r
    @s3ni0r
    in Cornichon i see two HttpClient implementations, one for Akka and the other for Http4s, so my questions are :
    which one is used by default? and is it possible to specify a redirect policy for POST requests on either of these two implementations?
    s3ni0r
    @s3ni0r
    for instance standalone play-ws has a config property for that
    play {
    
      # Configuration for Play WS
      ws {
    
        timeout {
    
          # If non null, the connection timeout, this is how long to wait for a TCP connection to be made
          connection = 2 minutes
    
          # If non null, the idle timeout, this is how long to wait for any IO activity from the remote host
          # while making a request
          idle = 2 minutes
    
          # If non null, the request timeout, this is the maximum amount of time to wait for the whole request
          request = 2 minutes
        }
    
        # Whether redirects should be followed
        followRedirects = true
    
        # Whether the JDK proxy properties should be read
        useProxyProperties = true
    s3ni0r
    @s3ni0r
    Finally it was an issue with Keycloak gatekeeper expecting an encrypted token, the log of gatekeeper was not explicit and kept telling me that the session header was not found in the request, it has nothing to do with cornichon. Thanks!
    Arnaud Gourlay
    @agourlay
    @s3ni0r thank you for the kind words :)
    I am glad you were able to figure out your issue, do you think Cornichon could have made it easier for you to find the root cause?
    Also there is only a single client implementation since a couple of versions which is the http4s one.
    TBH I don't know what the default behaviour is for redirect but in any case I guess we could make it configurable in the future if necessary.
    s3ni0r
    @s3ni0r
    No i don't think Cornichon would have helped with the issue i was facing, and i think we are using an older version of Cornichon that still have two HttpClient implementation, i will upgarde it :).
    s3ni0r
    @s3ni0r

    From : https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3
    10.3.8 307 Temporary Redirect
    The requested resource resides temporarily under a different URI. Since the redirection MAY be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field.

    The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s) , since many pre-HTTP/1.1 user agents do not understand the 307 status. Therefore, the note SHOULD contain the information necessary for a user to repeat the original request on the new URI.

    If the 307 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.

    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 :)