Skip to content
CAI
Software that uses CAICheck a score

agourlay/cornichon

56.0

Adequate · 20 September 2026

7.6k

lines of production code

Scala

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a Scala-based behavioral testing framework that enables developers to write executable specifications for HTTP APIs, JSON payloads, and state machines. It provides a domain-specific language for defining scenarios, asserting responses, and managing session state, while supporting advanced features like property-based model checking and asynchronous effect handling. The framework includes built-in HTTP mocking capabilities to simulate server behaviors and integrates with standard test runners for execution and reporting.

How it got here

2015–2017 — Functional core and HTTP modernization

27 changes.

The project underwent a significant architectural overhaul, decoupling the core testing engine from Akka and migrating the HTTP client to http4s. This period introduced a structured, effect-based DSL with comprehensive error handling, new control flow steps, and native GraphQL support. Concurrently, HTTP mocking capabilities were extracted into a dedicated module with enhanced simulation features.

2018–2019 — framework consolidation and performance benchmarking

18 changes.

This period focused on consolidating the test framework's API by unifying traits and introducing a standalone runner with JUnit XML reporting. Significant effort was dedicated to performance optimization and Scala 3 compatibility, alongside the addition of extensive JMH benchmarks for core components. The work also expanded the framework's capabilities with model-based property checking and comprehensive example suites for HTTP and JSON testing.

2020–2026 — test coverage and benchmarking

4 changes.

This period focused on expanding test coverage for core model checking logic and adding comprehensive JMH benchmarks for JSON parsing, placeholder resolution, and string utility methods. The work established performance baselines and validation utilities to ensure the reliability and efficiency of the DSL components.

Features

HTTP mock server call verification steps

Users can now verify interactions with the HTTP mock server directly within test scenarios. This change introduces \HttpListenSteps\, providing two new capabilities: checking the number of received calls via \received\_calls(count)\ and retrieving the bodies of received requests via \received\_requests\. These steps allow for precise assertion of mock server activity during testing.

cornichon-http-mock/src/main/scala/com/github/agourlay/cornichon/http/steps · high confidence

HTTP mock server now supports response delays and error modes

The HTTP mock server implementation has been updated to allow test scenarios to simulate network latency and server errors. Users can now configure a response delay (in milliseconds) via the new \delayInMs\ endpoint, which pauses the mock's response by the specified duration. Additionally, two new toggle endpoints (\toggle-error-mode\ and \toggle-bad-request-mode\) allow tests to switch the mock into returning 500 Internal Server Error or 400 Bad Request responses, respectively, enabling more robust error-handling tests. The server also records all received requests in the session for verification.

cornichon-http-mock/src/main/scala/com/github/agourlay/cornichon/http/server · high confidence

Introduction of EffectStep and DebugStep with cats-effect and Future support

The regular steps package now includes new EffectStep and DebugStep implementations that leverage cats-effect IO and Scala Future for handling asynchronous and effectful operations. EffectStep provides factory methods (fromEitherT, fromSync, fromSyncE, fromAsync) to wrap various effect types into the step execution model, while DebugStep allows logging messages derived from ScenarioContext. These changes enable users to integrate side-effecting code and asynchronous operations directly into scenarios using modern functional programming patterns.

cornichon-core/src/main/scala/com/github/agourlay/cornichon/steps/regular · high confidence

JSON assertion DSL now supports matchers as top-level expected values

Users can now use matchers (such as those from cornichon-check) directly as the expected value in JSON assertions (e.g., \body.is(myMatcher)\), rather than only being able to apply them to specific fields or within array contexts. This change allows for more flexible and expressive validation of JSON payloads against complex matching logic at the top level of the assertion.

cornichon-core/src/main/scala/com/github/agourlay/cornichon/json · high confidence

New DSL entry points and session history tracking

The DSL now provides \session\_history(key)\ to assert against the full history of a session key (e.g., \containsExactly\), and \session\_values(k1, k2)\ to compare two keys directly. Additionally, \WithJsonDataInputs\ is available for loading JSON data inputs, and \BaseFeature\ exposes \beforeFeature\/\afterFeature\ hooks for resource management.

cornichon-core/src/main/scala/com/github/agourlay/cornichon/dsl · high confidence

New built-in JSON field matchers and assertion engine

The matchers module now provides a comprehensive set of built-in matchers for validating JSON fields, including checks for presence, nullity, type (string, array, object, number, integer, boolean, UUID), and format (alpha-numeric, date, date-time, time). These matchers are integrated into a new assertion engine that allows users to assert JSON structures using wildcard keys (e.g., \\is-present\\) in their test steps, with improved error reporting for undefined or duplicate matcher definitions.

cornichon-core/src/main/scala/com/github/agourlay/cornichon/matchers · high confidence

New model-based property checking capabilities

Added support for defining and verifying state-machine models through new steps in the check module. Users can now define properties with preconditions and invariants, specify weighted transitions between states, and run model checks that validate these properties across multiple runs and transition sequences. The implementation includes validation for transition definitions (ensuring weights sum to 100, no negative weights, no duplicates) and provides detailed error messages for invalid model configurations.

cornichon-core/src/main/scala/com/github/agourlay/cornichon/steps/check · high confidence

New standalone runner and SBT integration with JUnit XML reporting

The test framework now includes a new \MainRunner\ that allows executing Cornichon features directly from the command line without SBT, using \classgraph\ for feature discovery. It supports parallel feature execution, scenario filtering, and random seed configuration, and generates JUnit XML reports for every scenario in a feature. Additionally, the SBT integration has been refactored into a new \CornichonFramework\ and \CornichonSbtRunner\ that properly handle task execution and resource shutdown, ensuring that ignored and pending scenarios do not cause the standalone runner to fail.

cornichon-test-framework/src/main/scala/com/github/agourlay/cornichon/framework · high confidence

New wrapped step implementations for control flow and resource management

The \cornichon-core\ module introduces a comprehensive set of new step wrappers in the \steps.wrapped\ package to enhance test control flow and resource handling. These include \ConcurrentlyStep\ and \RepeatConcurrentlyStep\ for parallel execution with timeouts, \EventuallyStep\ for retrying steps with configurable intervals, and \RepeatStep\, \RepeatWithStep\, and \RepeatDuringStep\ for various iteration patterns. Additionally, \WithResourceStep\ and \ScenarioResourceStep\ provide explicit resource acquisition and release scopes, while \WithDataInputStep\ enables data-driven testing by resolving placeholders in input tables. Supporting steps like \AttachStep\, \FlatMapStep\, \RetryMaxStep\, and \WithinStep\ further refine step chaining, error handling, and duration constraints.

cornichon-core/src/main/scala/com/github/agourlay/cornichon/steps/wrapped · high confidence

Project initialization and license migration to Apache 2.0

The repository has been initialized with a new structure, including configuration files for the build tool (sbt), code formatting (scalafmt), and CI automation (Mergify). The project license has been changed from MIT to Apache License, Version 2.0, and the README has been updated to reflect this change along with Maven Central and license badges.

(repo-wide) · high confidence

Behavioural changes

Consolidated feature base trait with integrated DSLs

The test framework now provides a unified CornichonFeature trait that extends the base feature with core, HTTP, JSON, and check DSLs, simplifying test setup by removing the need to mix in multiple separate traits.

cornichon-test-framework/src/main/scala/com/github/agourlay/cornichon · high confidence

HTTP DSL restructured with http4s client and GraphQL support

The HTTP DSL has been rebuilt to use http4s as the default client, replacing the previous Akka-based implementation. This change introduces a new \HttpService\ and \HttpRequest\ model, enabling users to make HTTP requests via a cleaner, effect-based API. Additionally, native GraphQL support is now available through the \QueryGQL\ type and \query\_gql\ DSL step, allowing users to send GraphQL queries with variables and operation names. Response handling now includes dedicated steps for displaying headers and status codes on assertion failures, and the \WithHeaders\ mechanism has been refined to properly encode multiple headers in the session.

cornichon-core/src/main/scala/com/github/agourlay/cornichon/http · high confidence

HTTP mock functionality extracted to a dedicated module

The HTTP mock step and its underlying infrastructure have been moved from the core library into a new, separate module (cornichon-http-mock). This change introduces the HttpMockDsl trait, which provides the httpListen and HttpListenTo methods, allowing users to define and manage HTTP mock servers. This modularization decouples the mock server capabilities from the main cornichon core, potentially simplifying dependencies for users who do not require HTTP mocking features.

cornichon-http-mock/src/main/scala/com/github/agourlay/cornichon/http · high confidence

Introduce structured configuration and error handling in core engine

The core module now includes a new Config case class that loads and validates cornichon settings (such as parallel execution, timeouts, HTTP client options, and redirect handling) from a configuration source, rejecting unknown keys to prevent typos. A new CornichonError trait and associated error types (BasicError, StepExecutionError, hook errors) replace previous exception-based error handling, providing structured error reporting with cause chains. Additionally, new context classes (FeatureContext, ScenarioContext) and a RunState model centralize execution state, including random seed propagation, custom extractors, matchers, and log management, enabling more robust and traceable scenario execution.

cornichon-core/src/main/scala/com/github/agourlay/cornichon/core · high confidence

New HTTP client implementation using http4s Ember

The HTTP client layer has been replaced with a new implementation based on the http4s Ember client. This change introduces support for configurable HTTP/2, automatic gzip/deflate decompression, and redirect following, while also adding a URI cache to improve parsing performance. Users will now benefit from a more robust client with better memory management and support for Server-Sent Events (SSE).

cornichon-core/src/main/scala/com/github/agourlay/cornichon/http/client · high confidence

New HTTP header and status assertion steps with case-insensitive matching

Added HeadersSteps and StatusSteps to the HTTP testing DSL, allowing users to assert on response headers and status codes. Header assertions (is, hasSize, contain, name isPresent/isAbsent) are now case-insensitive for field names, aligning with HTTP standards, and provide detailed error messages showing actual headers when assertions fail. Status assertions support checking exact status codes or kinds (success, redirect, client error, server error), with improved error reporting that includes the response body, headers, and initial request description when a status mismatch occurs.

cornichon-core/src/main/scala/com/github/agourlay/cornichon/http/steps · high confidence

Performance optimizations and Scala 3 compatibility in core utilities

The core utility modules have been refactored to improve performance and ensure compatibility with Scala 3. StringUtils now uses single-pass, low-allocation algorithms for string replacement and arrow-pair printing, avoiding intermediate string creation. TraverseUtils replaces recursive traversals with iterative loops to eliminate non-local returns, which are problematic in Scala 3, and optimizes handling of Lists and Vectors. Additionally, a new CirceUtil provides an encoder for FiniteDuration, supporting JSON serialization of time durations.

cornichon-core/src/main/scala/com/github/agourlay/cornichon/util · high confidence

Refactored assertion engine to use non-blocking IO and improved diff reporting

The assertion step implementation has been refactored to run on the compute pool using IO.delay, ensuring that assertion actions remain non-blocking and pure. The underlying assertion logic now uses a validated approach (cats.data.Validated) to aggregate errors, and the error reporting for collections and JSON has been improved with better diff outputs (including moved elements for ordered collections and JSON patches). Additionally, the assertion DSL now supports infix syntax for combining assertions (and, or, andAll).

cornichon-core/src/main/scala/com/github/agourlay/cornichon/steps/regular/assertStep · high confidence

Removed Akka dependency from core resources

The Akka-specific configuration has been removed from the core module's resources, as evidenced by the deletion of the \resource.conf\ file. This change aligns with the project's shift to decouple the core testing framework from Akka, allowing for broader test framework support in the future.

cornichon-core/src/main/resources · medium confidence

Replaced placeholder parser and introduced Mapper types for session resolution

The placeholder resolution mechanism in the core resolver has been reworked: the previous parser is replaced by a new \PlaceholderParser\ (using parboiled2) that extracts \Placeholder\ objects, and \PlaceholderResolver\ now resolves placeholders via a set of \PlaceholderGenerator\ instances (e.g., random-uuid, scenario-unique-number, global-unique-number) and a new \Mapper\ hierarchy (SimpleMapper, RandomMapper, SessionMapper, TextMapper, HistoryMapper, JsonMapper). This changes how placeholders are parsed and resolved, including faster paths when no placeholders are present and improved error reporting for mappers and session keys.

cornichon-core/src/main/scala/com/github/agourlay/cornichon/resolver · high confidence

Test coverage

Add JMH benchmark for HTTP service request effects; Added JMH benchmark for scenario execution throughput; Added JMH benchmarks for Check and JSON steps; Added JMH benchmarks for JSON parsing and placeholder resolution; Added JMH benchmarks for Session.addValues and Session.show; Added SuperHeroes scenario tests for HTTP API and JSON assertions; Added benchmark for StringUtils.printArrowPairs; Added empty reference.conf for Cornichon test framework; Added empty reference.conf for cornichon namespace; Added empty test configuration file; Added example tests for scenario focus, feature ignoring, and unique number generation; Added math example scenarios and steps for the test framework; Added property-based and unit tests for JSON handling components; Added property-based and unit tests for StringUtils; Added property-based and unit tests for the PlaceholderResolver; Added property-based testing coverage for model checking and for-all steps; Added property-based testing examples for model checks and HTTP integration; Added property-based tests for matcher resolution and validation logic; Added super-heroes server example with GraphQL and SSE support; Added test examples for HTTP mock server capabilities; Added test helpers for scenario validation and property-based testing; Added tests for model transition probability and distribution logic; Added unit and property-based tests for core execution and session logic; Added unit tests for DSL components using Munit; Added unit tests for DebugStep and EffectStep error handling; Added unit tests for HTTP header, DSL, and client behavior; Added unit tests for assert step functionality; Added unit tests for wrapped step implementations.

Dependencies

Upgrade to Scala 3.9.0 and Java 17 bytecode target

The project has upgraded its primary Scala version to 3.9.0 and pinned the JVM bytecode target to Java 17. This change requires a JDK 17 or later to build and run the library, and it drops support for older Scala versions (such as 2.12 and 2.13) and Java versions. The build configuration also updates the documentation site generator to sbt-laika with a custom light-mode theme and migrates the test framework to Munit.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 56.

Lenses

  • Code Health 95
  • Architecture 83
  • Maturity 39
  • Readiness 64
  • Security 70

Changes since last survey

  • 300 commits — 274 feature/other, 26 fixes

By area

  • cornichon-core/src — 75 commits
  • (root) — 67 commits
  • (repo) — 66 commits
  • cornichon-docs/docs — 44 commits
  • .github/workflows — 14 commits
  • project/build.properties — 13 commits
  • project/plugins.sbt — 8 commits
  • cornichon-test-framework/src — 6 commits
  • cornichon-http-mock/src — 3 commits
  • benchmarks/src — 2 commits
  • .github/FUNDING.yml — 1 commit
  • cornichon-scalatest/src — 1 commit

Notable commits

  • fix: Fix JSON path removal through array projections
  • fix: Fix WithJsonDataInputs docs - it reads a data table, not JSON
  • fix: Fix numeric Matchers
  • fix: Fix off-by-one in the mock server port range step title
  • fix: Fix session key rendering in JSON array assertion titles
  • fix: Fix the stray space in array assertion titles with an unparsable expected value
  • fix: Revert "sbt.version=2.0.0-RC9"
  • fix: fix SSE accept header
  • fix: fix anyAlphaNum accepts empty strings
  • fix: fix cleanup steps propagation in wrapper steps
  • fix: fix contribution doc
  • fix: fix datatable detector
  • fix: fix doc icons
  • fix: fix docs
  • fix: fix docs
  • fix: fix get session can throw an IndexOutOfBoundsException
  • fix: fix landing page
  • fix: fix maven badges
  • fix: fix tests
  • fix: fix tests
  • …and 280 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

agourlay/cornichon was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 44fe88be63f157131c5130b7fe3cfb8c79b5e1a1 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.