auxesis / cucumber-nagios

Systems testing plugin for Nagios with Cucumber + Webrat + Mechanize + Net::SSH
http://cucumber-nagios.org/
MIT License
257 stars 43 forks source link

Expose time to complete scenarios as perfdata #11

Closed tauboy closed 13 years ago

tauboy commented 14 years ago

Hi mate

am doing some fairly in-depth testing of cucumber-nagios and linking it back into nagios with a lot of success but I was wondering if I could push my luck and ask for another feature

it would be really useful if we could get the time a feature took to run passed back as part of the perfdata, I was going to see if I could make the change myself but I’m not a ruby programmer (I come from a nagios background) so I thought I’d ask the expert

I’m also interested in the best way to upgrade nagios-cucumber, would you run a gem update and then recreate the projects and copy over existing features or is there a way to upgrade an existing project on the fly?

Hope you had a great time in Paris, sorry I couldn’t get over but I was stuck in South Wales with a cold

Cheers

Mike

auxesis commented 13 years ago

Hey Mike, I've implemented this in cucumber-nagios 0.8.3.

The time it took to run the features shows up a time:

CUCUMBER OK - Critical: 0, Warning: 0, 28 okay | passed=28; failed=0; nosteps=0; total=28; time=2

Apologies for the long delay getting this into cucumber-nagios!

tauboy commented 13 years ago

Hi mate

getting an error running feature tests under 0.8.3

/home/cucumber/cucumber/infrastructure-tests/features/steps/http_header_steps.rb:16: warning: parenthesize argument(s) for future version /home/cucumber/cucumber/infrastructure-tests/features/steps/http_header_steps.rb:20: warning: parenthesize argument(s) for future version

to fix it I've had to hash out these 2 steps in http_header_steps.rb

### header contains checks Then /^the "(._)" header should contain "(._)"$/ do | header_name, header_contains | @url_headers[header_name].should match header_contains end Then /^the "(._)" header should not contain "(._)"$/ do | header_name, header_contains | @url_headers[header_name].should_not match header_contains end