mardi 2 février 2016

BDD testing REST/JSON-RPC API

At the present time, I work on a project, which represents a mix of REST and JSON-RPC back-end API for mobile APPs. Application servers are built on node.js (express,cluster,pm2) + redis (ioredis) + mysql (node-mysql) + rabbitmq (amqp). Now we face a heavy refactoring, but there are no tests! Undoubtedly, it's a huge trouble :(
In the beginning, we have the plan to cover it with BDD tests. It sounds quite easy, but there is one obstacle that is preparation environment before test start. For instance, some tests change data in storage and we have to reload database dump every time. Frankly, it is extremely inconvenient. Moreover, keeping it in actual (up-to-date) condition isn't easy, e.g. when I change the code, I have to change dump too.

So, I'm interesting in ways/tools/paradigms, which can be used for preparing state (content) of data storage (MySQL and Redis).

Thank you in advance for any piece of advice.

Aucun commentaire:

Enregistrer un commentaire