howeyc/fsnotify

Cross-platform testing with Vagrant

nathany opened this issue · 6 comments

Before doing any big changes (#56), I would like to have an environment setup to test the kqueue/inotify/etc. implementations. I've looked into various CI solutions, but nothing has been that promising (outside of the tools used by Go itself). Testing locally with Vagrant could work quite well during development.

We should be able to run vagrant ssh -c "go test ./..." and have it run tests against multiple operating systems in VirtualBox.

  • Ubuntu 12.04 LTS (provided)
  • BSD, I have yet to find an existing BSD box that has the VirtualBox tools setup properly and mounts a shared folder (checked those on http://www.vagrantbox.es and did some Googling).
  • Windows, I suspect we could use these VMs provided by Microsoft, and there appear to be some "plugins" for Vagrant to support Windows, but I haven't figured them out yet.

There probably isn't a good solution for testing OS X from other operating systems, but right now it's kind've the same as BSD (until #54) and at least some of us (myself included) are using OS X for development.

I was experimenting with GVM, which Travis CI uses to support testing against multiple versions of Go (eg. tip and release). I'm not sure how valuable this is in development, and downloading the source code is quite slow.

One handy feature of GVM is called linkthis, which we should borrow if not using GVM. With it, we can symlink the shared /vagrant folder into a /src/vagrant folder somewhere in the GOPATH. That should allow us to build & test the code we're editing on our primary OS, so long as we also fix #57.

Maybe some experts would like to contribute :-) @mitchellh @fnichol

Looks like github ate my comment from last night. In short, I would look at using packer.io to build any custom baseboxes you might need. Upshot is packer is also written in Go.

However windows baseboxes are obviously a bit painful so I would suggest using an alternate provider like the digital ocean or AWS provider to test those specific platforms. If you leverage environment variables in your vagrant file you can conditionally execute those platforms as needed.

@nathany Ah, now that I read this for context I can totally help you get started with this! If you're interested in any pairing/hacking this week I should be able to help 😄

Everything that @lusis said for sure. Yes, loving packer so far

@fnichol Thanks for pointing me to some BSD boxes. Shouldn't be too difficult to switch apt-get to pkg_add.

Windows, yah, I don't know. I'm setting Go up on Windows 7 + VMWare Fusion to at least be able to test by hand.