For fun and profit (ok, skip the profit part), I’m developing a volume plugin for docker – specifically one to deal with volumes for swarm services.
However, I don’t really see a lot of discussion/best practices on how to best test plugins, and especially not when those plugins are in a distributed swarm environment (and the plugin needs to communicate between the swarm hosts).
I can, of course, create go unit tests for all of the pieces in my plugin, but what do folks do at the ‘integration’ level?
I could probably:
- “Mock” out all of the docker communication, intra-server communication, and volume-mounting (ugh, that’d be a fair bit of work)
– OR –
- Set up virtual docker servers (say, fully scripted qemu/kvm), install the plugin on each, and test it that way (a bit heavy, and definitely not as clean as a go test file – not to mention hard to do in any CI)
But I have to think that this is a problem others have encountered… How do others solve this? Is there some ‘best practices’ discussion elsewhere that I’ve missed?
(And on the same note, I can’t seem to find any docker forum for plugin development…?)
Thanks in advance!