Testing provy

5 views
Skip to first unread message

Jacek Bzdak

unread,
Jan 20, 2013, 12:45:36 PM1/20/13
to pr...@googlegroups.com
Hi! 

I'm trying to test some provy roles I recently wrote, but I find that unit tests are unsatisfactory, they detect erros like wrong funciton names and so on, but non trivial errors (like copying file to nonexistent directory) are left undetected. For now I rest this also using a virtualbox instance. 

Any insights how could I test provy roles better?

PS. As soon as I will write a these tests I'll do a pull request. 

JB

Diogo Baeder

unread,
Jan 20, 2013, 6:25:37 PM1/20/13
to pr...@googlegroups.com
Hi Jacek,

So, unit-testing a piece of software that relies on environment behaviour is a hard thing, and using virtual machines is not an efficient way to do unit-testing. For these reasons we rely a lot on mocks and on our knowledge of the underlying system behaviour. Sometimes what I do is test a certain low-level behaviour, say, the interaction between Fabric and a remote server (using Vagrant, for example), learn what's the result of this interaction and build a test double (mock, stub etc) for this, since I already know how it behaves in this situation.

So for the time being that's what we have available to do unit-testing. Also keep in mind that we use Travis CI as our CI system, which doesn't allow any kind of virtual machine instantiation.

I hope this helps you somehow.

Cheers,

Diogo
Reply all
Reply to author
Forward
0 new messages