Changelog History
Page 1
-
v0.19.5 Changes
October 15, 2020π new features and improvements
π¦ Exposed
body_raw
to assert non JSON bodies (#421) @agourlayAnd assert body_raw.containsString("xml")
π¨ Optimization & refactoring of
BodyElementCollectorMacro
(#416) @agourlay
π bug fixes
save_body
does not expect JSON #419 (#420) @agourlayBodyElementCollectorMacro
handles identifier #409 (#410) @agourlay
β‘οΈ dependency updates
- β‘οΈ Update caffeine to 2.8.6 (#423) @scala-steward
- β‘οΈ Update sangria to 2.0.1 (#418) @scala-steward
- β‘οΈ Update sbt to 1.4.0 (#417) @scala-steward
- β‘οΈ Update pureconfig to 0.14.0 (#415) @scala-steward
- β‘οΈ Update parboiled to 2.2.1 (#414) @scala-steward
- β‘οΈ Update scala-xml to 2.0.0-M2 (#412) @scala-steward
- β‘οΈ Update decline to 1.3.0 (#406) @scala-steward
- β‘οΈ Update sbt-jmh to 0.4.0 (#407) @scala-steward
- β‘οΈ Update kafka-clients to 2.6.0 (#398) @scala-steward
- β‘οΈ Update utest to 0.7.5 (#405) @scala-steward
- β‘οΈ Update scalatest-wordspec to 3.2.2 (#404) @scala-steward
- β‘οΈ Update http4s to 0.21.7 (#400) @scala-steward
-
v0.19.4 Changes
July 31, 2020π new features and improvements
Introduce
compareWithPreviousValue
for Json and Stringsession_value
using anAssertion
(#396, #394) @agourlayAnd assert session_value("my-key").asJson.path("product.price").compareWithPreviousValue[Int] { case (prev, current) => LessThanAssertion(prev, current) }And assert session_value("my-key").compareWithPreviousValue { case (prev, current) => LessThanAssertion(prev.length, current.length) }
β Add JsonPath support to
JsonValuesStep
(#395) @agourlayAnd assert session_values("k1", "k2").asJson.path("a.b.c").areEquals
π Improve error reporting for
cornichon-http-mock
(#393) @agourlayπ Split
cornichon-check
documentation in several pages for readability 410dcc5 @agourlayπ bug fixes
β‘οΈ dependency updates
- β‘οΈ Update diffson-circe to 4.0.3 (#397) @scala-steward
-
v0.19.3 Changes
July 13, 2020π new features and improvements
- π§ Introduce
scenarioExecutionParallelismFactor
configuration (#385) @agourlay- the default behaviour is unchanged
π bug fixes
- π Do not remove
Content-Type
but only override it (#388) @agourlay - Harden before/after feature hooks (#384) @agourlay
- π Fix a
MatchError
incornichon-http-mock
server start (4f7e039) @agourlay
β‘οΈ dependency updates
- β‘οΈ Update caffeine to 2.8.5 (#382) @scala-steward
- β‘οΈ Update http4s-blaze-client, ... to 0.21.6 (#381) @scala-steward
- β‘οΈ Update sbt to 1.3.13 (#380) @scala-steward
- β‘οΈ Update pure-config to 0.13.0 (6bc5982) @agourlay
- π§ Introduce
-
v0.19.2 Changes
June 26, 2020π new features and improvements
- β
Use a more precise Scalatest dependency in
cornichon-scalatest
74fbf80 - π Various performance improvements:
save_body_path
parses session value only once- optimise
DataTable
rendering - reduce allocations across the board
π bug fixes
- 0οΈβ£ Do not override
Content-Type
by default #377
β‘οΈ dependency updates
- β‘οΈ Update http4s-blaze-client, ... to 0.21.5 (#378) @scala-steward
- β‘οΈ Update scalatest to 3.2.0 (#376) @scala-steward
- β‘οΈ Update sangria to 2.0.0 (#375) @scala-steward
- β‘οΈ Update monix-execution, monix-reactive to 3.2.2 (#373) @scala-steward
- β‘οΈ Update sbt to 1.3.12 (#372) @scala-steward
- β‘οΈ Update scala to 2.13.3
- β
Use a more precise Scalatest dependency in
-
v0.19.1 Changes
May 26, 2020π new features and improvements
- β Add
containsExactly
matcher for arrays (#370) @agourlay - β Add support for HTTP redirect @agourlay
- the new configuration field
followRedirect
is false by default - see reference configuration https://agourlay.github.io/cornichon/reference-configuration.html
- the new configuration field
π bug fixes
- π Fix typos in documentation (#361) @lauraluiz
- π Fix error reporting for
isNull
(#356) @agourlay
β‘οΈ dependency updates
- β‘οΈ Update monix-execution, monix-reactive to 3.2.1 (#364) @scala-steward
- β‘οΈ Update http4s to 0.21.4 (#363) @scala-steward
- β‘οΈ Update sangria to 2.0.0-RC2 (#362) @scala-steward
- β‘οΈ Update kafka-clients to 2.5.0 (#351) @scala-steward
- β‘οΈ Update decline to 1.2.0 (#350) @scala-steward
- β‘οΈ Update parboiled to 2.2.0 (#341) @scala-steward
- β‘οΈ Update pureconfig to 0.12.3 (#340) @scala-steward
- β‘οΈ Update cats-core, cats-macros to 2.1.1 (#339) @scala-steward
- β Add
-
v0.19.0 Changes
February 11, 2020π₯ breaking changes
π the
cornichon-check
module has been moved intocornichon-core
- no need to mix
with CheckDsl
anymore
- generators moved to
com.github.agourlay.cornichon.core
RandomContext
does not expose itsscala.util.Random
object anymore.π new features and improvements
cross compiled to scala 2.13
π main runner for
cornichon-test-framwork
to execute tests without SBTUsage: cornichon-test-framework --packageToScan <string> [--featureParallelism <integer>] [--seed <integer>] [--scenarioNameFilter <string>] Run your cornichon features without SBT. Options and flags: --help Display this help text. --packageToScan <string> Package containing the feature files. --reportsOutputDir <string> Output directory for junit.xml files (default to current). --featureParallelism <integer> Number of feature running in parallel (default=1). --seed <integer> Seed to use for starting random processes. --scenarioNameFilter <string> Filter scenario to run by name.
introduce
<scenario-unique-number>
and<global-unique-number>
placeholder generators.π improve error reporting for
Matcher
pointing to nothingπ show initial request in case of status error assertion
gql.withVariables
can use different json encoders for each variable #278 by @yannsβ‘οΈ dependency updates
- cats 2.1.0
- http4s 0.21.0
- circe 0.13.0
- monix 3.1.0
- pure-config 0.12.2
- no need to mix
-
v0.18.1 Changes
September 04, 2019π This release contains minor change around the global configuration file.
β e.g for a file
/src/test/resources/reference.conf
cornichon { executeScenariosInParallel = false traceRequests = false warnOnDuplicateHeaders = true failOnDuplicateHeaders = false disableCertificateVerification = true }
π₯ breaking change
baseUrl
has been renamed toglobalBaseUrl
for more claritybaseUrl
can still be defined at theFeature
level otherwise it falls back toglobalBaseUrl
π improvement
π§ introduce a new configuration field named
disableCertificateVerification
to interact with servers with malformed certificate.- false by default.
π fix
addAcceptGzipByDefault
configuration field which was not working properly- true by default
β‘οΈ dependency updates
- Monix
3.0.0-RC5
-
v0.18.0 Changes
August 29, 2019π There are quite a few breaking changes in this release, however it should only impact users who are:
- defining custom steps
- using the
cornichon-kafka
module
π± If you are only using the built-in DSL you should be fine π€
π± Deterministic tests π²
π The goal of this release is to have deterministic runs via a fixed seed.
class DeterministicFeature extends CornichonFeature { override lazy val seed: Option[Long] = Some(1L) def feature =Feature("demo deterministic feature") { Scenario("always the same") { Given I save("my-uuid" -\> "\<random-uuid\>") Then assert session\_value("my-uuid").is("bb1ad573-19b8-9cd8-68fb-0e6f684df992") } } }
π This test will be valid as long as the fixed seed stays the same.
π It is also possible to pass the seed via a command argument and not change the code (only in
cornichon-test-framework
).testOnly *DeterministicFeature -- "always the same" "--seed=1"
π On a failure the initial seed will be provided in the error reporting, enabling you to replay the exact same test even if it contains a source of randomness such as:
- randomized placeholders (
random-uuid
,random-string
,random-boolean
etc.) cornichon-check
value generators & transitions- custom steps using
ScenarioContext.randomContext
RandomMapper
as extractor
π₯ breaking changes
EffectStep
andAssertion
steps now consume aScenarioContext
instead of aSession
.example for the
effect
field:effect: Sessionβ Either[CornichonError, Session] effect: ScenarioContext β Either[CornichonError, Session]
ScenarioContext
is a new concept encapsulating all the states of a given scenario.trait ScenarioContext { val randomContext: RandomContextval session: Session// uses randomContext to resolve randomized placeholdersdef fillPlaceholders(input: String): Either[CornichonError, String] }
π disclaimer: mutation still exists within
RandomContext
- it will be tackled in a future release.placeholderResolver
is now gone, to resolve placeholders usefillPlaceholders
in theScenarioContext
.the underlying
Step
contract was changed to accommodate the propagation of state.trait Step { def run(engine: Engine)(initialRunState: RunState): Task[(RunState, FailedStep Either Done)] }
to
trait Step { val stateUpdate: StateT[Task, RunState, FailedStep Either Done] def runStep(runState: RunState): Task[(RunState, FailedStep Either Done)] = stateUpdate.run(runState) }
π
CornichonJson.parseJsonUnsafe
has been renamed toCornichonJson.parseDslJsonUnsafe
.a
DslJson
String can either represent:- a JSON object - a JSON array - a JSON string - a datatable
π If you want to parse regular JSON use
CornichonJson.parseString
.π
RandomContext
was moved tocom.github.agourlay.cornichon.core.RandomContext
.various changes to the
cornichon-kafka
DSL #244 .0οΈβ£ Gzip is now enabled by default.
0οΈβ£ http4s client is now the default http client, replacing akka-http client.
- The configuration line
useExperimentalHttp4sClient
must be removed if you were using it as experimental client.
- the
akka
dependency has been removed completely.π
check_model
does not take a seed as an input anymore.π improvements
π deterministic run via fixed seed on the feature and command line argument.
π new matcher on JSON body to check that a field is present and not null.
body.path("myKey").isNotNull
π€‘ the noisy stack trace appearing when shutting down servers in
cornichon-http-mock
is now gone.π bug fixes
- thread safe date matchers #259 by @michalmela
β‘οΈ dependency updates
- scala
2.12.9
- http4s
0.20.10
- pureConfig
0.11.1
- monix
3.0.0-RC3
- β
scalatest
3.0.8
- caffeine
2.780
- parboiled
2.1.8
- π akka-http has been removed
-
v0.17.1 Changes
May 07, 2019π₯ breaking changes
- header assertions are now case-insensitive on the field name
The following assertions are now equivalent
headers.name("X-Served-Config").isPresent headers.name("x-served-config").isPresent
- π
ResourceStep
renamed toScenarioResourceStep
to clarify that resources are released at the end of a scenario
π improvements
andThen
onStep
to offer a simplerchain
APIdef chain(others: Session β List[Step]): Stepdef andThen(others: List[Step]): Stepdef andThen(other: Step): Step
π bug fixes
- http4s error with debug level #228
β‘οΈ dependency updates
- http4s
0.20.0
- β
scalatest
3.0.7
- akka-http
10.1.8
- caffeine
2.7.0
- parboiled
2.1.6
-
v0.17.0 Changes
February 19, 2019β 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 exploreAPI
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 tocom.github.agourlay.cornichon.steps.wrapped.ResourceStep
RepeatConcurrently
has an additionalparallelism
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 anOption
None
instead ofJNull
if the path is not present
- use
JsonPath.runStrict
to return an error if absentThe 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 incorrectin
0.17.x
body.path(βdataβ).isAbsent
is incorrect
body.path(βdataβ).isPresent
is correctand additional matcher has been added for that case
body.path(βdataβ).isNull
AttachStep
/AttachAsStep
now requiresSession β List[Step]
instead of aList[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
π new
ConcurrentlyStep
to perform a series of steps in parallelConcurrently(maxTime = 1.seconds) { Given I get("https://github.com/agourlay/cornichon") Given I get("https://github.com/agourlay/cornichon") }
π new assertions for the size of JSON arrays
body.asArray.size.isLesserThan(x) body.asArray.size.isGreaterThan(x) body.asArray.size.isBetween(x, y)
π 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 usingFuture
but interop with thecats-effects
Effect
insteadimport 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 the404
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
toPureConfig
to manage configuration