StatsdTestHarness
A test harness that captures output of various testing frameworks to post to statsd.
Installation
Add this line to your application's Gemfile:
gem 'statsd_test_harness'
And then execute:
$ bundle
Or install it yourself as:
$ gem install statsd_test_harness
Configuration
Set the following environment variables for statsd integration:
STATSD_HOST=192.168.42.10
STATSD_PORT=2003
STATSD_APP_NAME=my_app_name
Usage
You must specify a config file at runtime:
wrap run_suite --config path/to/config/file.rb
For an example of what the config file should look like, refer to config/sample_config.rb
Development
To add support for a new test suite, create a file in statsd_test_harness/postprocessors/ that will extract the duration output from the testing framework. Follow statsd_test_harness/postprocessors/rspec.rb for an example.
To register the postprocessor, add it to the config.tools array in your config file, e.g.
{
name: 'my_framework',
command: 'test',
label: 'my_framework',
options: '',
ignore_return_value: true,
postprocessor: StatsdTestHarness::Postprocessors::MyPostProcessor
}
Set the ignore_return_value flag to false if you don't want to report an unsuccessful test run (based on exit status).
Contributing
- Fork it ( https://github.com/[my-github-username]/statsd_test_harness/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request