http-rs / http-rs/surf

Proposal: VCR-style request/response mocking middleware for testing

Open
#299 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.5k
Forks
128
PR merge metrics
No merged PRs in 30d

Description

This would entail an external crate that provides a surf middleware with two modes (or potentially two different middlewares)

When it's in recording mode, it transparently writes all requests and responses to disk in a configurable well-known location in a human-readable and editable format of some sort. When it's in playback mode, instead of making requests against external servers, it responds with the data from disk

references:
* [Bypass](https://hexdocs.pm/bypass/Bypass.html)
* [ExVCR](https://github.com/parroty/exvcr)
* [VCR](https://github.com/vcr/vcr)
* [sepia](https://github.com/LinkedInAttic/sepia)
* [node-vcr](https://github.com/mbaertschi/node-vcr)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing Surf's middleware API and the referenced VCR-style projects, including Bypass, ExVCR, VCR, sepia, and node-vcr. Define how an external crate would provide recording and playback modes, configurable on-disk storage, and a human-readable editable format. Done means requests are recorded with responses and playback avoids external servers.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.