Closed itsjohncs closed 10 years ago
The vmfactory component test needs access to Redis (at least to make the core connection object) so I'd like to reuse the redis plugin/fixture I made for py.test. I will have to change it up a bit or somehow address the issue of making sure the vmfactory uses the same db and server as the test is using, despite the fact that the vmfactory will be running in a seperate process.
A simple way to do that will probably just be to use the config file within the plugin instead of the command line option, or provide a choice? This will require some thought. I will of course want to also be wary of blowing away production data on accident, so some guarding will be necessary here.
I made the redis plugin available throughout the testing tree, but didn't make it run entirely off of the configuration yet. Still not sure of the best way to do that.
I think I'm going to make the redis test just pull from the configuration, and I'll let the configuration file be swappable via an environmental variable which will let sysadmins switch between production and test configurations. At some point I should also add a guard into Redis to mark a set of data as production.
As I mentioned in the other issues in this milestone, we don't have complete coverage of all of the VMFactory's features but we have enough for now. Moving on!
Just like how the bootstrapper can be automatically tested now, so should the VMFactory. This can be achieved by spinning up a process and then feeding things into Redis and watching to see if the correct actions occur.