lundi 1 décembre 2014

Should you mock key-value stores/aggregators


I've always been taught that your tests should run in isolations and that other than a db for ActiveRecord etc your tests should not rely on any external software/services. e.g. I always mock my other web-service responses but what about responses from web based key-value stores and aggregators like elasticsearch, redis, and statsd? My intuition would be to mock those as well as I am not testing if they work I am testing my apps IO with them. However I see examples around where people uses namespace strategies to test their elasticsearch and statsd related code.


How much should I mock when it comes to web based services?


thanks!





Aucun commentaire:

Enregistrer un commentaire