Coder Social home page Coder Social logo

lecaillon / cassette Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 4.0 92 KB

An HTTP Client handler that caches successful responses and replays them for improving the stability of your testing environment and speeding up your test suite.

License: MIT License

C# 68.13% PowerShell 23.10% Shell 8.77%
cassette cassette-http integration-tests continuous-integration httpclient middleware message-handler cache distributed-cache

cassette's People

Contributors

atifaziz avatar lecaillon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cassette's Issues

Add a CassetteOption

Allow to set a:

  • KeyPrefix: string
  • KeySeparator: string
  • CacheEntryOption: DistributedCacheEntryOptions

Limited to HTTP text-based requests & responses

The project intro reads as if this is designed for general-purpose HTTP recording and playback:

Records and replays successful HTTP responses in your testing environment.

In a micro-service context, where your integration tests depend on a lot of external HTTP resources, Cassette is an ideal tool to improve the stability of your CI pipeline. It is based on a very simple idea: uniquely identify all the requests that pass through and record succesfull reponses. After recording, replay the same responses without actually calling the real REST endpoint.

To create that unique request identifier, Cassette computes an hash from the HTTP method, the uri and the body.

There is no mention of it being limited to textual HTTP resources, which is somewhat misleading. On close inspection, one see that Request.Body and Response.Body are typed as string. If the scope of the project is API endpoints accepting and returning textual entities then the README should be updated to mention the limitation/scope.

Having said that, I didn't see any reason for the limitation. A quick spike showed that a few tweaks can have the library can working without regard to he content media type. I'd be happy to submit the results as a PR if you'd welcome that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.