Bug#953673: ITP: meeshkan -- Meeshkan is a mock server that generates realistic HTTP responses by analyzing recorded HTTP traffic, OpenAPI schemas and API documentation. It is used for testing (CI/CD) and prototyping.
Owner: Mike Solomon <firstname.lastname@example.org>
* Package name : meeshkan
Version : 0.2.16
Upstream Author : Mike Solomon <email@example.com>
* URL : https://github.com/meeshkan/meeshkan
* License : MIT
Programming Lang: Python
Description : Meeshkan is a mock server that generates realistic HTTP responses by analyzing recorded HTTP traffic, OpenAPI schemas and API documentation. It is used for testing (CI/CD) and prototyping.
Meeshkan is a tool that mocks HTTP APIs for use in sandboxes as
well as for automated and exploratory testing. It uses a combination
of API definitions, recorded traffic and code in order to make crafting
mocks as enjoyable as possible.
When getting started with Meeshkan, the basic flow is *collect*,
*build* and *mock*.
1. To start, collect data from various representations and artifacts
of an API (recorded traffic, OpenAPI specifications, documentation).
2. Then, build a schema that unifies these various data sources.
3. Finally, use this schema to create a mock server of an API.
To record API traffic, the Meeshkan CLI provides a record mode that
captures API traffic using a proxy. First, run:
$ meeshkan record
Then, you can capture traffic by appending the desired URL to
the URL of the meeshkan server. The general syntax is
http://[meeshkan-host]/[url]. For example:
$ curl http://localhost:8000/http://time.jsontest.com
Meeshkan will call http://time.jsontest.com. All recorded server
traffic is written to a .jsonl log file in the http-types format.
To build a spec from recordings, run the following command:
$ meeshkan build -i path/to/recordings.jsonl
The spec is an intermediary representation of an API used
downstream for mocking.
Lastly, to spin up the mock server, run:
$ meeshkan mock -s path/to/generated/spec.json
There are several alternatives to Meeshkan, although none of them
are distributed on Debian AFAIK. Wiremock, Prism, and Hoverfly are
all good alternatives. Where Meeshkan is different is that it
infers an API's behavior by analyzing various sources (server logs,
OpenAPI schemas and documentation) and generates responses
based on the inferred behavior. This is useful for fuzz-testing,
property-based testing and corner-case testing.
Myself and my colleagues use Meeshkan extensively for creating
mock APIs. Our proposal to add it to Debian comes after a GitLab
conference where many GitLab users reported that they only use
dependencies in their CI/CD pipelines that can be installed
using apt install. In general, we see that most companies use
bash scripts for CI/CD pipelines that make heavy use of apt
install, and we would like to make Meeshkan available to them.
Meeshkan is currently maintained by the Helsinki-based company
Meeshkan Oy in addition to a community of users, and Meeshkan Oy
will be maintaining Meeshkan for the foreseeable future.