Hello,

I wrote my first Vagrant plugin relatively recently, 
https://github.com/jantman/vagrant-r10k ; it's a middleware plugin that 
deploys puppet modules into the vagrant directory on the host, for use with 
the built-in puppet provisioner (I suppose it's vaguely similar to 
vagrant-berkshelf for Chef, in intent, but not implementation).

I've only ever used Vagrant with VirtualBox, so that's all that I (and my 
company) have tried the plugin with.

I have rspec unit tests for my plugin, and I'm relatively confident that 
they're more-or-less accutate (in terms of code coverage and what they're 
actually testing). However, I've been getting a few bug reports lately that 
revolve around action_hooks, and specifically some providers other than 
VirtualBox, and my plugin "provisioning" more than once, or provisioning on 
ssh commands, etc.

(1) Is there a recommended way that I should be testing these? I know about 
mitchellh/vagrant-spec, but it appears to be very young code; it has 
support for acceptance testing, but none of the built-in plugins in Vagrant 
appear to have acceptance tests. I've only been able to find about half a 
dozen plugins that have acceptance tests which actually use vagrant-spec 
(based on searching GitHub for "vagrant-spec.config.rb" files).
(2) Is there any way to test providers that I can't actually use, such as 
the paid-for VMWare provider or Rackspace (which I don't have an account 
for)? My plugin is a middleware that doesn't actually *need* the box to 
run; it hooks in *before* Vagrant::Action::Builtin::Provision and Vagrant::
Action::Builtin::ConfigValidate and just deploys puppet modules into a 
directory on the host, which the Puppet provisioner then uses. Is there any 
builtin way of running a "dummy" provisioner command, i.e. all the way up 
to actually starting the box up? The only other thing I can think of is 
setting up the provisioners with fake API credentials, etc., running with 
`VAGRANT_LOG=debug` and hoping that it won't fail until after my plugin 
runs.
(3) I seem to be getting reports of different providers using hooks 
differently, i.e. when I hook in before Provision and ConfigValidate, I'm 
getting reports of some providers running my hook three times, or running 
when ssh'ing to an already-provisioned box. Any thoughts on how to test 
this, or whether it's just a problem with the provider?

Many thanks for any advice that the community can provide. Ruby isn't my 
strongest language, and while getting my plugin functional wasn't terribly 
difficult, getting it tested and working (ideally automated, via Travis) 
across all user environments seems to be a lot more complicated that I'd 
originally thought, given the differing provider implementations.

Thanks,
Jason Antman

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to