vagrant-rspec-ci

vagrant-rspec-ci is a Vagrant plugin for running integration tests against your VMs, and produces jUnit formatted reports for consumption by your CI server (travis and Jenkins and both can consume this).

It is based on a fork of Michael Paul Thomas Conigliaro's vagrant-test plugin, with some (very) breaking changes to make it rpsec-specific and integrate better with ci_reporter (the jUnit report formatter). I also removed the internal side of testing, as we didn't want to alter the test subject (by installing rspec internally in the VM, for example)

Installation (Vagrant v1.0.x)

vagrant gem install vagrant-rspec-ci

Configuration

The following options can be used within the Vagrant::Config.run block of your Vagrantfile:

Usage

vagrant rspec [vm-name]

Change Log

0.0.3 (2013-04-10)

  • Remove development dependency on pry-debugger

0.0.2 (2013-04-10)

  • Try to use rspec from vagrant gemset if possible

0.0.1 (2013-04-09)

  • Integrated with ci_reporter
  • Added directories as search paths, with defaults
  • Added globbing for test files
  • Removed internal testing support
  • Forked from v0.1.2 of vagrant-test

License

Copyright (C) 2013 Clinton Wolfe

Copyright (C) 2012 Michael Paul Thomas Conigliaro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Credits

Option Description Default value
config.rspec.enable_ci_reporter Boolean - whether to use ci_reporter to format rspec results as jUnit reports. true
config.rspec.suppress_ci_stdout ci_reporter improperly registers as a formatter, writes to files, but leaves the doc formatter in place. This makes for very noisy output. Set to true (default) to send all STDOUT formatter output from rspec to /dev/null ; set to false when diagnosing a problem, or if you like noise. true
config.rspec.dirs Array of directories (relative to vagrant project root) to be used as a search path for external tests. ['combined/spec_ext", "spec"]
config.rspec.tests List of tests (filenames or globs, expanded in the dirs paths) to be run outside the VM [ '*ext_spec.rb' ]
config.rspec.rspec_bin_path Path to rspec command, on VM host "rspec"
config.rspec.reports_dir If ci_reporter is enabled, path to write the jUnit XML reports. Relative to vagrant project dir. "rspec_reports"