GithubHelp home page GithubHelp logo

auxesis / cucumber-nagios Goto Github PK

View Code? Open in Web Editor NEW
256.0 256.0 43.0 10.76 MB

Systems testing plugin for Nagios with Cucumber + Webrat + Mechanize + Net::SSH

Home Page: http://cucumber-nagios.org/

License: MIT License

Ruby 99.81% Shell 0.19%

cucumber-nagios's People

Contributors

adamhjk avatar auxesis avatar beezly avatar bendilley avatar bjoernalbers avatar deanwilson avatar garethr avatar hedgehog avatar jnewland avatar josephholsten avatar jrisch avatar luizoz avatar pmenglund avatar terryp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cucumber-nagios's Issues

Multiline output

Hi auxesis

I was wondering if you had any plans to extend the output returned via cucumber-nagios? As Nagios allows multiline output from plugins, I was thinking it would good to cat the type of response you get when you run a Cucumber test against a feature or group of features, e.g. instead of:-

 Critical: 0, Warning: 0, 4 okay | passed=4, failed=0, nosteps=0, total=4

it could return:-

Critical: 0, Warning: 0, 4 okay\n 2 scenarios (2 passed)\n 4 steps (4 passed) | passed=4, failed=0, nosteps=0, total=4

Then the main view in Nagios would display the first line of the response (Critical: 0, Warning: 0, 4 okay) but if you clicked on the check you would be able to see the extra data:

Critical: 0, Warning: 0, 4 okay
2 scenarios (2 passed)
4 steps (4 passed)

Cheers,
Mike

Can't install?

Using Ruby 1.9.1, latest stable build on windows XP. When I run "gem install cucumber-nagios", I get the following text:

Building native extensions.  This could take a while...
ERROR:  Error installing cucumber-nagios:
        ERROR: Failed to build gem native extension.

C:/Ruby191/bin/ruby.exe extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.  Check the mkmf.log file for more details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby191/bin/ruby
C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:364:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:427:in `try_compile'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:545:in `try_var'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:793:in `block in have_var'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:670:in `block in checking_for'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:276:in `block (2 levels) in postpone'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:250:in `open'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:276:in `block in postpone'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:250:in `open'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:272:in `postpone'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:669:in `checking_for'
        from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:792:in `have_var'
        from extconf.rb:16:in `'


Gem files will remain installed in C:/Ruby191/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10 for inspection.
Results logged to C:/Ruby191/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/ext/gem_make.out

Am I missing something here? It's a fresh Ruby install with cucumber added using gem install.

Use Aruba to describe SSH steps

I now have the following passing:

Feature: SSH steps
  In order to specify remote command execution
  As a developer using Cucumber
  I want to use Aruba steps to describe SSH session steps

  Background:
    Given that "cuken/ssh" is required
    And the Gem "ssh-forever" has been required
    And a user
    And a hostname
    And the SSH hostname alias "cuken"
    And I initialize password-less SSH access

    Scenario: Aruba steps for remote commands via password-less SSH access
      Given I successfully run "ssh cuken 'echo Supercalifragilisticexpialidocious;'"
      Then the output should contain "Supercalifragilisticexpialidocious"

I'm waiting some (substantial) changes being pulled into ssh-forever, and an update being released. As mentioned the changes are substantial so it might take a while.

In the mean time... thoughts on the suitability of the above.

If the above is a feature you'll add I'll tidy up a branch, then issue a pull request.
Appreciate any feedback.

cucumber-nagios-gen should not require 'gem bundle' to be run

While bundling the gems might be a good approach in some cases, it won't work well for everyone so making it required is perhaps a bit too opinionated, especially when still experimenting. I've simply removed the 'exit 1' in cucumber-nagios-gen in my local copy.

Improve install documentation for Windows

Per #20:

On a fresh ruby install on windows, you need to download and install the Ruby Installer AND the development kit, otherwise "gem install" will fail. They are both located in RubyForge in the same project (Ruby Installer for Windows).

cucumber-nagios 0.7.2 gen feature not working

hi all

Just playing around with cucmber nagios after upgrading it to 0.7.2 and I've noticed the automatic method of creating features no longer works

so following the steps in the read me file I've:-

created a project

cucumber-nagios-gen project test
Generating with project generator:
     [ADDED]  .gitignore
     [ADDED]  .bzrignore
     [ADDED]  bin/cucumber-nagios-gen
     [ADDED]  bin/cucumber-nagios
     [ADDED]  Gemfile
     [ADDED]  lib/generators/feature/%feature_name%.feature
     [ADDED]  README
     [ADDED]  lib/generators/feature/%feature_name%_steps.rb
     [ADDED]  features/steps
     [ADDED]  features/support
Your new cucumber-nagios project is set up

then I did a gem bundle


cd test
gem bundle

Calculating dependencies...
Updating source: http://gems.rubyforge.org
Caching: amqp-0.6.7.gem
Caching: builder-2.1.2.gem
Caching: bundler08-0.8.5.gem
Caching: cucumber-0.6.1.gem
Downloading cucumber-nagios-0.7.0.gem
Caching: diff-lcs-1.1.2.gem
Caching: eventmachine-0.12.10.gem
Downloading extlib-0.9.15.gem
Caching: highline-1.5.2.gem
Caching: json_pure-1.4.3.gem
Caching: mechanize-0.9.3.gem
Caching: net-ssh-2.0.18.gem
Downloading nokogiri-1.4.2.gem
Downloading polyglot-0.3.1.gem
Caching: rack-1.1.0.gem
Caching: rack-test-0.5.3.gem
Caching: rake-0.8.7.gem
Caching: rspec-1.3.0.gem
Caching: templater-1.0.0.gem
Downloading term-ansicolor-1.0.5.gem
Downloading treetop-1.4.5.gem
Caching: webrat-0.7.0.gem
Installing term-ansicolor (1.0.5)
Installing builder (2.1.2)
Installing json_pure (1.4.3)
Installing net-ssh (2.0.18)
Installing eventmachine (0.12.10)
Building native extensions.  This could take a while...
Installing rack (1.1.0)
Installing rack-test (0.5.3)
Installing amqp (0.6.7)
Installing polyglot (0.3.1)
Installing rake (0.8.7)
Installing bundler08 (0.8.5)
Installing diff-lcs (1.1.2)
Installing rspec (1.3.0)
**************************************************

  Thank you for installing rspec-1.3.0

  Please be sure to read History.rdoc and Upgrade.rdoc
  for useful information about this release.

**************************************************
Installing extlib (0.9.15)
Installing nokogiri (1.4.2)
Building native extensions.  This could take a while...
Installing webrat (0.7.0)
Installing mechanize (0.9.3)
Installing treetop (1.4.5)
Installing cucumber (0.6.1)

(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)

                     (::)   U P G R A D I N G    (::)

Thank you for installing cucumber-0.6.1.
Please be sure to read http://wiki.github.com/aslakhellesoy/cucumber/upgrading
for important information about this release. Happy cuking!

(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)

Installing highline (1.5.2)
Installing templater (1.0.0)
Installing cucumber-nagios (0.7.0)

then tried to create a feature directory

bin/cucumber-nagios-gen feature test_feature browse
Usage: cucumber-nagios-gen generator_name [options] [args]

Generate a cucumber-nagios project.

Available generators
project Generate a new self-contained cucumber-nagios project.

General options:
-p, --pretend Run, but do not make any changes.
-f, --force Overwrite files that already exist.
-s, --skip Skip files that already exist.
-d, --delete Delete files that have previously been generated with this generator.
--no-color Don't colorize the output
-h, --help Show this message
--debug Do not catch errors


it looks like the cucumber-nagios-gen file in <PROGECT>/bin is not correct

cheers

Mike

Getting "Error creating formatter: Nagios::NagiosFormatter (RuntimeError)" using cucumber > 0.3.95

I had to make sure I had cucumber 0.3.95 installed or I would get a NagiosFormatter error. Here's the full text:

Cucumber::Ast::Visitor is deprecated and will be removed. You no longer need to inherit from this class.
Error creating formatter: Nagios::NagiosFormatter (RuntimeError)
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.104/lib/cucumber/ast/visitor.rb:7:in `initialize'
./features/support/nagios.rb:4:in `initialize'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.104/lib/cucumber/cli/configuration.rb:146:in `new'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.104/lib/cucumber/cli/configuration.rb:146:in `formatters'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.104/lib/cucumber/cli/configuration.rb:131:in `map'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.104/lib/cucumber/cli/configuration.rb:131:in `formatters'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.104/lib/cucumber/cli/configuration.rb:62:in `build_runner'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.104/lib/cucumber/cli/main.rb:53:in `execute!'
/usr/lib/ruby/gems/1.8/gems/cucumber-0.3.104/lib/cucumber/cli/main.rb:24:in `execute' bin/cucumber:15

Abreviate project/module name/namespace

cucumber-nagios wears thin quickly, and isn't suitable namespace for re-usable modules.

Is a name change is feasible for 1.0 release?

cunag | cumnag
cuken

If not for the project/gemnames then maybe for any reusable modules namespace?

http_header steps aren't parenthesized, throw warnings

@tauboy wrote in #11:

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

Missing feature file returns 4

bin/cucumber-nagios features/nonexistant.feature returns 4

It should probably return something a bit more meaningful.

Switch to jeweler

It handles all the mundane gemspec and release management tasks. cucumber-nagios should use it.

Default feature doesn't work

In cucumber-nagios 0.88, when you generate a new feature with:

cucumber-nagios-gen feature www.google.com foo

the scaffolding file features/www.google.com/foo.feature contains:

Feature: www.google.com
It should be up

Scenario: Visiting home page
When I visit "http://www.google.com"
Then the request should succeed

This actually fails under Cucumber, since the 'visit' step isn't defined. It should be 'go to' instead of 'visit'. If you make this change, the feature passes.

ssh steps will pass with SocketError

If you have a step like:

Then I can ssh to "example.org" with the following credentials

but example.org is unreachable, the step will pass because it is only looking for the absence of Net::SSH::AuthenticationFailed and is perfectly happy with the presence of a SocketError

Getting an "uninitialized constant Webrat::MechanizeSession (NameError)" when I run bin/cucumber-nagios

I follow the instructions provided, but every time I end up with the following error:

"uninitialized constant Webrat::MechanizeSession (NameError)"

I have searched for that error and come up with nothing. I have inspected the env.rb file in my porject directory and it definitely require rubygems, webrat, and webrat/mechanize, but it's still complaining about this line:

class MechanizeWorld < Webrat::MechanizeSession

And I'm not sure why. I have tried edtiing the env.rb file to look more like the older webrat mechanize stuff like this:

Webrat.configure do |config|
  config.mode = :mechanize
end

But that didn't work either. Both my self and a co-worker have tried this on OSX 10.5, OSX 10.6, and Fedora 8 and all with the exact same results. Any help is greatly appreciated :)

Nokogiri error with 0.6.5

Hello,

With a project created with the latest version of cucumber-nagios (0.6.5), I get an error with nokogiri :

ubuntu-dotcloud:0:~/institut-telecom% bin/nokogiri                                                                               
/usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- nokogiri/nokogiri (LoadError)
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /home/louis/institut-telecom/vendor/gems/gems/nokogiri-1.4.0/lib/nokogiri.rb:13
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from ./bin/../vendor/gems/gems/nokogiri-1.4.0/bin/nokogiri:7
    from bin/nokogiri:3:in `load'
    from bin/nokogiri:3

It works correctly with 0.6.3. I'm not a ruby apps writer, and I wasn't able to find the issue. (I have tried to add require 'rubygems' at some places without success).

Best Regards

`gem bundle` does not generate cucumber-nagios.bat on Windows

Hi,

Ok, last issue report for today :-). Still using Ruby 1.9.1 on Windows XP. I managed to get my first tests running this morning, cucumber-nagios is really a wonderful tool and I am looking forward to experiment a lot with it. There is one thing though. I am running windows XP (no choice here, it's my work PC).

I generated a project following those instructions:

$ cucumber-nagios-gen project ebay.com.au
$ cd ebay.com.au
$ gem bundle

However, after doing this and creating my first test cases, I discovered that the command line:

$ bin/cucumber-nagios features/ebay.com.au/bidding.feature

would not run. As a matter of fact, there was no "cucumber-nagios.bat" in the bin directory. So I wrote one myself and then it works all right. The code looks like this:

@ECHO OFF
IF NOT "%~f0" == "~f0" GOTO :WinNT
@"ruby.exe" "C:/my_project_directory/bin/cucumber-nagios" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@"ruby.exe" "%~dpn0" %*

Is it possible to add the code generation for this file in the project?

Kind regards,

Mathieu

(it's the same code as for cucumber-nagios-gen.bat).

Extracting Nagios part of this library to make it useful for development mode

Hi,

I have been in search for a library that can help me with the (behaviour driven) development of a system setup with Chef cookbooks. So far this library has been the best I have come accross, but it is not exactly what I want.

What I would like to do is test my Chef Recipes by describing the expected outcome in Cucumber features (like with Cucumber-Nagios), but instead of having to use a remote server and having integration with Nagios I would like to use Vagrant and just see whether my test pass or not. Later I would like to plug these tests into Cucumber-Nagios to reuse them for monitoring.

I'm guessing that we are almost there. I think it is just a matter of extracting the server connecting part (not remote, but localhost) and the output part (no Nagios but just plain Cucumber output). The step definitions and such are probably already in the form they should be.

In the near future I would like to work on this if you also agree that this would be a worthwhile expansion of the current library. WDYT?

Regards,

Jeroen

Make steps in webrat_steps.rb consistent

Hi,

There's an extra space in the file upload regexp in webrat_steps.rb :

When /^I attach the file at "(.*)" to "(.*)" $/ do |path, field|
--------------------------------------------^
  attach_file(field, path)
end

This may bork some test code.

Also, I think it would be nice to add an HTTP digest authentification mechanism like this:

Given /^I am logged in as "(.*)":"(.*)"$/ do |login, password|
        basic_auth(login, password)
end 

So that it is available in all test cases :).

Cheers,

mathieu

Documentation on cucumber-nagios doesn't match steps distributed with cucumber-nagios

Hi,

There is a problem on the main example on http://auxesis.github.com/cucumber-nagios/ : it reads

Feature: google.com
  It should be up
  And I should be able to search for things

  Scenario: Searching for things
    When I visit "http://www.google.com"
    And I fill in "q" with "wikipedia"
    And I press "Google Search"
    Then I should see "www.wikipedia.org"

But it should be:

Feature: google.com
  It should be up
  And I should be able to search for things

  Scenario: Searching for things
    When I go to http://www.google.com
    And I fill in "q" with "wikipedia"
    And I press "Google Search"
    Then I should see "www.wikipedia.org"

At least according to webrat_steps.rb...

I believe this would be worth a change on the main page.

Cheers,

mathieu

Problem with xmlParseDoc

Hello !

When I install cucumber-nagios on a RHEL system, I have this error :

[root@rens ~]# gem install cucumber-nagios
Building native extensions. This could take a while...
ERROR: Error installing cucumber-nagios:
ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
checking for iconv.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes
checking for libxml/parser.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes
checking for libxslt/xslt.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes
checking for libexslt/exslt.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes
checking for xmlParseDoc() in -lxml2... no
libxml2 is missing. try 'port install libxml2' or 'yum install libxml2'
*** extconf.rb failed ***

Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
--with-xslt-dir
--without-xslt-dir
--with-xslt-include
--without-xslt-include=${xslt-dir}/include
--with-xslt-lib
--without-xslt-lib=${xslt-dir}/lib
--with-xml2lib
--without-xml2lib

Gem files will remain installed in /usr/lib64/ruby/gems/1.8/gems/nokogiri-1.4.1 for inspection.
Results logged to /usr/lib64/ruby/gems/1.8/gems/nokogiri-1.4.1/ext/nokogiri/gem_make.out

[root@rens ~]# yum list libxml2*
Loaded plugins: rhnplugin, security
Installed Packages
libxml2.i386 2.6.26-2.1.2.8 installed
libxml2.x86_64 2.6.26-2.1.2.8 installed
libxml2-devel.i386 2.6.26-2.1.2.8 installed
libxml2-devel.x86_64 2.6.26-2.1.2.8 installed
libxml2-python.x86_64 2.6.26-2.1.2.8 installed

And the content of mkmf.log

find_library: checking for xmlParseDoc() in -lxml2... -------------------- no

"gcc -o conftest -I/usr/include/libxml2 -I/usr/include -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -I/opt/local/include/ -I/opt/local/include/libxml2 -I/opt/local/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline conftest.c -L. -L/usr/lib64 -L/opt/local/lib -L. -rdynamic -Wl,-export-dynamic -lruby-static -lxml2 -lpthread -lrt -ldl -lcrypt -lm -lc "
conftest.c: In function ‘t’:
conftest.c:3: error: ‘xmlParseDoc’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
checked program was:
/* begin /
1: /top/
2: int main() { return 0; }
3: int t() { void ((volatile p)()); p = (void (()()))xmlParseDoc; return 0; }
/
end */

Where is the problem ? :/

idiots guide to xml parsing

hi all

not sure if this is the correct place to raise this but I'm looking for an beginners guide to parsing xml

the problem I have is I need to write a step that will take a xpath and a value and search an xml document (web page) for a string

so for example say the webpage returns this xml stub

OK

I would want to pass in resource-status/status as the xpath and a value of OK and get the step to pass

But I cant find any examples of doing a search like this using nokogiri in cucumber-nagios so any help would be really appreciated (even if you tell me to go to another forum)

cheers

Mike

no such file to load -- lib/cucumber/nagios/version

This may be a Ruby 1.9/Rubygems thing...

$ git clone [email protected]:hedgehog/cucumber-nagios.git
$ pushd cucumber-nagios/
$ rake -T --trace
(in /usr/src/cucumber-nagios)
rake aborted!
no such file to load -- lib/cucumber/nagios/version
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/usr/src/cucumber-nagios/Rakefile:5:in `<top (required)>'
/home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev/gems/rake-0.8.7/lib/rake.rb:2017:in `block in load_rakefile'
/home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev/gems/rake-0.8.7/lib/rake.rb:2000:in `block in run'
/home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev/bin/rake:19:in `load'
/home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-dev/bin/rake:19:in `<main>'
$ ls -la lib/cucumber/nagios/version.rb 
-rw-r--r-- 1 hedge src 65 2011-02-23 21:35 lib/cucumber/nagios/version.rb

Best practice is to remove rubygems - end users should require it if that is how they manage their Gems - considered impolite for lib devs to impose their choices... :)

$ git diff
diff --git a/Rakefile b/Rakefile
index b2044ad..6484c2d 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,8 +1,7 @@
 #!/usr/bin/env ruby

-require 'rubygems'
 require 'rake'
-require 'lib/cucumber/nagios/version'
+require './lib/cucumber/nagios/version'

 begin
   require 'jeweler'

invalid nagios output

Hi mate

I just relaised the output string you are sending is invalid for nagios 3.02

plugins should return an output as described here

http://nagios.sourceforge.net/docs/3_0/pluginapi.html

e.g.

OK Critical: 0, Warning: 0, 6 okay
or
WARNING Critical: 0, Warning: 1, 5 okay

also perfdata needs to be seperated with a semi colon not a comma as yours does currently

so I guess the output should be something like

OK Critical: 0, Warning: 0, 6 okay | passed=6; failed=0; nosteps=0; total=6

it's only a minor thing but I know the guys in Nagios land are very strict on plugin output

Expose time to complete scenarios as perfdata

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

Project creation issue

Hello
I just install cucumber-Nagios and I have an issue when I try to create project
Due to my OS system (Centos 5.4). I have install cucumber-nagios with Jruby - Install run well

But with project creation I have following issue:

cucumber-nagios-gen project test
You don't appear to have directory installed.
Perhaps run gem bundle or gem install directory?

Thks for your help

Xavier

Feature: Cuken::Helper module

Refactor contents of steps into helper methods that Cucumber-Nagios (Cuken?) users can also use in their own steps by adding Cuken::Helper into Cucumber's World or Rspec's config.
To disambiguate what methods come from here, these methods should have some refix such as: cn_... or cuken_... (preferred, since it is short but more descritive than cn_...)

Example:
This:
When /^I ssh to "([^\"]*)" with the following credentials:$/ do |hostname, table|
@keys = []
@auth_methods ||= %w(password)
session = table.hashes.first
session_keys = Array.new(@keys)
session_auth_methods = Array.new(@auth_methods)
if session["keyfile"]
session_keys << session["keyfile"]
session_auth_methods << "publickey"
end

  lambda {
    @connection = Net::SSH.start(hostname, session["username"], :password => session["password"], 
                                                                :auth_methods => session_auth_methods,
                                                                :keys => session_keys)
  }.should_not raise_error
end

Would become this:

When /^I ssh to "([^\"]*)" with the following credentials:$/ do |hostname, table|
  session = cuken_ssh_session(table)
  lambda {
    @connection = Net::SSH.start(hostname, 
                           session["username"], 
                           :password => session["password"],
                           :auth_methods => session["auth_methods"],
                           :keys => session["keys"])
  }.should_not raise_error
end

Abend: cucumber-nagios-gen project --pretend private.org

$ cucumber-nagios-gen project --pretend private.org
Generating with project generator (just pretending):
     [ADDED]  .gitignore
     [ADDED]  .bzrignore
     [ADDED]  Gemfile
     [ADDED]  features/steps
     [ADDED]  features/support
     [ADDED]  README
/home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-bdd-sys/gems/cucumber-nagios-0.8.10/bin/cucumber-nagios-gen:54:in `chdir': No such file or directory - /usr/src/bigbluebutton/labs/bdd/system/private.org (Errno::ENOENT)
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-bdd-sys/gems/cucumber-nagios-0.8.10/bin/cucumber-nagios-gen:54:in `git_init'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-bdd-sys/gems/cucumber-nagios-0.8.10/bin/cucumber-nagios-gen:48:in `after_run'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-bdd-sys/gems/templater-1.0.0/lib/templater/cli/generator.rb:78:in `run'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-bdd-sys/gems/templater-1.0.0/lib/templater/cli/manifold.rb:24:in `run'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-bdd-sys/gems/templater-1.0.0/lib/templater/manifold.rb:80:in `run_cli'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-bdd-sys/gems/cucumber-nagios-0.8.10/bin/cucumber-nagios-gen:127:in `<top (required)>'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-bdd-sys/bin/cucumber-nagios-gen:19:in `load'
    from /home/hedge/.rvm/gems/ruby-1.9.2-p136@bbb-bdd-sys/bin/cucumber-nagios-gen:19:in `<main>'

scripts in bin should have execute permissions

I've just created a new project with cucumber-nagios 0.6.7 and noticed that the scripts in the bin directory don't have execute permissions. This means that following along with the example on the homepage doesn't work since it suggests to run bin/cucumber-nagios-gen which does not work out of the box.

Easy to fix by adding the permissions, but would be nice to have that out of the box.

Use selenium-client in tests

hi chaps

I'm not sure if you can help here so feel free to tell me to go away, but as I'm still trying to learn ruby I kind of thought I'd ask on here

currently I'm trying to create some cucumber-nagios feature tests that need to use various selenium features (waiting for a javascript to display test that sort of thing)

from my reading it looks like I need to define the selenium_javascript_framework in my env.rb

something like:-

Webrat.configure do |config|
config.mode = :selenium
config.selenium_javascript_framework = :jquery
end

adding this causes cucumber-nagios to error so going back to some research it looked like I need to use the selenium-client gem, so I've added gem "selenium-client", "1.2.18" to the GemFile and done a new gem bundle

I've also added a require 'selenium-client' to the env.rb

but I still get errors saying webrat doesn't have that method

undefined method `selenium_javascript_framework=' for #<Webrat::Configuration:0xb79c7540> (NoMethodError)
/home/cucumber/NetBeansProjects/Cucumber/test/cucumber/nagios/features/support/env.rb:15
.......

so I'm guessing I need to tell the bundled version of Webrat to use the methods in selenium-client, but I don't know how to do that so can anyone help?

cheers

Mike

cant get basic tests to run

hi all

just started with cucumber-nagios and have installed it on a basic centos 5.4 machine

to install I did the following

yum install ruby libxml2-devel libxslt-devel ruby-devel ruby-docs ruby-ri ruby-irb ruby-rdoc

cd /tmp
wget http://gemcutter-production.s3.amazonaws.com/rubygems/rubygems-1.3.5.tgz
tar zxfv rubygems-1.3.5.tgz
cd rubygems-1.3.5
ruby setup.rb
gem install gemcutter
gem install cucumber-nagios

gem install --version '= 0.8.0' bundler

cd ~
cucumber-nagios-gen project google
cd google/
gem bundle

bin/cucumber-nagios-gen feature google.co.uk browse
bin/cucumber-nagios features/google.co.uk/browse.feature

when I run the test it fails
Critical: 1, Warning: 0, 0 okay | passed=0, failed=1, nosteps=0, total=1

running a cucumber feature test gives me

Feature: google.co.uk
It should be up

Scenario: Visiting home page # features/google.co.uk/browse.feature:4
When I go to http://google.co.uk # features/steps/webrat_steps.rb:1
undefined method instance_variable_defined?' for #<Net::HTTP google.co.uk:80 open=false> (NoMethodError) ./features/steps/webrat_steps.rb:2:in/^I go to (.*)$/'
features/google.co.uk/browse.feature:5:in `When I go to http://google.co.uk'
Then the request should succeed # features/steps/result_steps.rb:13

Failing Scenarios:
cucumber features/google.co.uk/browse.feature:4 # Scenario: Visiting home page

1 scenario (1 failed)
2 steps (1 failed, 1 skipped)

as this is the most basic of tests I really would like to work out why it's failing can anyone help?

Make cucumber-nagios features parameterised

If you want to run the same scenario across multiple hosts, you can write a scenario outline. But what if you don't know the host you want to run it against? What if you want to specify the host on the command line like this:

cucumber-nagios features/backups.feature backup1.example.org
cucumber-nagios features/backups.feature backup33.example.org

This would be awesome.

produce ssh steps explicitly without password authentication

The generator should produce steps with descriptions indicating where auth is explicitly passwordful and passwordless.
Passwordless tends to be the preferred auth in many testing setups (e.g. Writing features/steps for Capistrano usage).
Testing keys (for localhost testing phases) can be generated and discarded.

Define the issue with bundler ~> 0.9

I'd definitely like bundler to meet the needs of cucumber-nagios. But "Until the bundler guys sort their shit out, I refuse to release software that uses it," isn't exactly a bug I can reproduce. I can't seem to find any bug created by you in their issue tracker, but that was just a quick skim.

What's the problem you're seeing? Is it technical? Or maybe a philosophical difference with the release schedule and backward compatibility issues? Something else entirely?

Distribute cucumber-nagios command as part of gem

Now that we've switched to vanilla bundler, the cucumber-nagios command should be part of the cucumber-nagios gem itself, and be removed from the generated project.

This makes projects more lightweight, and will make upgrades between cucumber-nagios versions easier.

You could invoke cucumber-nagios from anywhere:

cucumber-nagios /path/to/my.feature

...instead of:

/path/to/project/bin/cucumber-nagios /path/to/my.feature

gem bundle not working

I've seen your demo at Fosdem, couldn't wait to go home and make my monitoring more delicious now I'm already stuck at 3rd step of your howto:

argnagios:/ebay.com.au # gem install bundler
Due to a rubygems bug, you must uninstall all older versions of bundler for 0.9 to work
Successfully installed bundler-0.9.5
1 gem installed
Installing ri documentation for bundler-0.9.5...
Installing RDoc documentation for bundler-0.9.5...
argnagios:
/ebay.com.au # gem bundle
ERROR: While executing gem ... (RuntimeError)
Unknown command bundle

any help really appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.