platinummonkey / rexpro-python

Python RexPro Interface
Other
5 stars 7 forks source link

Unit test without full titan server? #4

Closed hermanocabral closed 10 years ago

hermanocabral commented 10 years ago

Howdy,

Is it possible to run unit tests without actually having a full titan server? I was thinking about a way to run an embedded rexster server, with an in-memory TinkerGraph for unit testing, have you ever considered this?

Thanks

platinummonkey commented 10 years ago

You can't actually fully test rexpro without having some titan server available with an available rexpro connection.

I run the Titan Server (All + Rexster) with embedded cassandra and TinkerGraph for unit tests locally on my machine when doing development. Also I've setup wercker to automatically build and test.

I've setup a wercker box (which utilizes docker) https://app.wercker.com/#explore/boxes/platinummonkey/titan-stable The source for that docker setup is here: https://bitbucket.org/platinummonkey/box-titan-stable Inside is also the rexster.xml that I use during development.

hermanocabral commented 10 years ago

That's what I was afraid of, I really didn't want to add another 40+ mbs of dependencies to my project.

platinummonkey commented 10 years ago

Sorry, that's the nature of testing a database socket interface. You kinda need the I/O from the database. You're more than welcome to setup your wercker app to utilize the titan-stable box for CI testing, it's not "instant" and you have to use another system, but it won't require you to run it. Also, internally we have a dedicated VM for testing against a titan, VM's are cheap and easy to keep up. The box provides a basic init script so essentially just setup the VM as described in the wercker box scripts, then all should be hunky dory. I'm not sure if this is for personal or for work and what flexibility you might have.

hermanocabral commented 10 years ago

Yes, I'm afraid that's the nature of the beast. At work we do have tons of titan instances ranging from test servers to full qa/uat/prod clusters and each developer has a vagrant box with all the goodies neatly packed inside docker containers, but even with everything local you start to feel the pain when you have 300+ tests. If your test suite takes longer than 5 seconds to run, TDD starts to become a nuisance.

platinummonkey commented 10 years ago

Ah, yes, some of those slower tests are the concurrency tests - there are specific delays in there to verify proper handling and greenlet switching, I'm in the process of removing the 'unit' nose attribute tag and specifying those in additional specific concurrency tests, thus restoring the default socket implementation -- these unit tests run very fast.

The goal will be able to support default sockets, gevent sockets, and eventlet sockets (and anything else anyone wants to contribute).

hermanocabral commented 10 years ago

Oh, I was referring to my own set of tests. I used to have rexpro-python in my CI server but I removed it when you setup your own CI server :)