Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while executing features. #86

Closed
varunwy opened this issue Jul 12, 2012 · 12 comments
Closed

Error while executing features. #86

varunwy opened this issue Jul 12, 2012 · 12 comments

Comments

@varunwy
Copy link

varunwy commented Jul 12, 2012

I executed the below steps:

  1. gem install cucumber-nagios
  2. cucumber-nagios-gen mytest
  3. cd mytest
  4. bundle install
  5. cucumber-nagios-gen feature google.com home

The file 'features/google.com/home.feature' contains:

feature: google.co.in
It should be up

Scenario: Visiting home page
When I go to "http://www.google.co.in"
Then the request should succeed

  1. Now when I execute

"cucumber-nagios features/google.com/home.feature"

it prints the following error:

wrong number of arguments (8 for 7) (ArgumentError)

/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:173:in after_step_result' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:173:insend'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:173:in send_to_all' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:171:ineach'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:171:in send_to_all' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:164:inbroadcast'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:104:in visit_step_result' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/step_invocation.rb:43:invisit_step_result'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/step_invocation.rb:39:in accept' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:99:invisit_step'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:163:in broadcast' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:98:invisit_step'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/step_collection.rb:15:in accept' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/step_collection.rb:14:ineach'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/step_collection.rb:14:in accept' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:93:invisit_steps'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:163:in broadcast' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:92:invisit_steps'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/scenario.rb:55:in accept' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/runtime.rb:80:inwith_hooks'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/runtime.rb:96:in before_and_after' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/runtime.rb:79:inwith_hooks'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/runtime/support_code.rb:120:in call' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/runtime/support_code.rb:120:inaround'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/language_support/language_methods.rb:9:in around' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/language_support/language_methods.rb:91:incall'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/language_support/language_methods.rb:91:in execute_around' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/language_support/language_methods.rb:8:inaround'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/runtime/support_code.rb:119:in around' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/runtime/support_code.rb:117:incall'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/runtime/support_code.rb:117:in around' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/runtime.rb:91:inaround'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/runtime.rb:78:in with_hooks' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/scenario.rb:53:inaccept'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/scenario.rb:108:in with_visitor' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/scenario.rb:47:inaccept'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:51:in visit_feature_element' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:163:inbroadcast'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:50:in visit_feature_element' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/feature.rb:43:inaccept'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/feature.rb:42:in each' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/feature.rb:42:inaccept'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:20:in visit_feature' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:163:inbroadcast'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:19:in visit_feature' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/features.rb:29:inaccept'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/features.rb:17:in each' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/features.rb:17:ineach'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/features.rb:28:in accept' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:14:invisit_features'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:163:in broadcast' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb:13:invisit_features'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/runtime.rb:46:in run!' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/cli/main.rb:43:inexecute!'
/usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/cli/main.rb:20:in execute' /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/cucumber:14 /usr/bin/cucumber:23:inload'
/usr/bin/cucumber:23

What can I do to make it work? Is the project in a stable state and well tested?

@varunwy
Copy link
Author

varunwy commented Jul 13, 2012

I debugged this further and located the problem:
Method: visit_step_result in /usr/lib/ruby/gems/1.8/gems/cucumber-1.2.1/bin/../lib/cucumber/ast/tree_walker.rb calls 'broadcast' with 8 arguments
broadcast(keyword, step_match, multiline_arg, status, exception, source_indent, background, file_colon_line) which in turn calls Method: after_step_result in file: /usr/lib/ruby/gems/1.8/gems/cucumber-nagios-0.9.2/lib/cucumber/formatter/nagios.rb. The method after_step_result is defined with 7 arguments only.

def after_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background)
record_result(status, :step_match => step_match, :keyword => keyword)
end

I fave fixed this by adding an option argument to method after_step_result:
def after_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background, *tmp)
record_result(status, :step_match => step_match, :keyword => keyword)
end

I have no experience programming with Ruby and hence not sure if this is the correct way to fix, though it works for me now.

@bappelt
Copy link

bappelt commented Jul 24, 2012

I am experiencing this as well.

@bappelt
Copy link

bappelt commented Jul 24, 2012

The problem seems to be that an additional argument was added to visit_step_result method in This Commit

Since the cucumber-nagios gemspec file uses the open ended ">= 0.10.0" for it's cucumber dependency, the latest will get installed.

I just manually installed cucumber 1.1.2 and that seems to work.

@BenoitPoulet
Copy link

Thank you varunwy !!!

I got the same problem after a «gem update» and you quick fix do the trick.

It seems the cucumber-nagios gem is a dead project :/, 3 months after you post the fix, the bug is stil here.

@hedgehog
Copy link
Collaborator

hedgehog commented Oct 3, 2012

Can anyone confirm the suggestion of @bappelt:

  • works and is the least intrusive change?
  • Make a pull request?

@BenoitPoulet
Copy link

I'm sorry i'm a newbie in the rubby world.

  1. Did you suggests to downgrade Cucumber ? Not really a good way to solve the pb in my point of view.
  2. «Make a pull request?» sorry , i don't understand :(

@hedgehog
Copy link
Collaborator

hedgehog commented Oct 4, 2012

Yes I think @bappelt suggested 1.1.2 as the version so try using a Gem dep version of ~>1.1.2

@BenoitPoulet
Copy link

I removed «cucumber-1.2.1» and «gherkin-2.11.2» (dependency).
so that is installed (gem list) :
cucumber (1.1.9, 1.1.3)
cucumber-nagios (0.9.2)

I removed the hack of Varunwy and it works :
CUCUMBER OK - Critical: 0, Warning: 0, 8 okay | passed=8; failed=0; nosteps=0; total=8; time=12

@injcristianrojas
Copy link

Indeed it seems to be dead, @benoiteolas .

bendilley added a commit to bendilley/cucumber-nagios that referenced this issue Dec 31, 2012
Proposed fix for Issue auxesis#86

Current cucumber-nagios is not yet compatible with the latest versions
of cucumber, mechanize and amqp. Limiting version dependencies to known
compatible ones for now, until further development takes place.

I've committed changes to Gemfile.lock, though some suggest it shouldn't
be included in the repo for a gem.
(ref http://stackoverflow.com/a/4151540/418602)
@bendilley
Copy link
Contributor

Please see pull request #88 as a potential solution. @hedgehog would you be interested in this? It is along the lines of @bappelt's suggestion and works for me.

@hedgehog
Copy link
Collaborator

hedgehog commented Jan 3, 2013

Closed by #88

@hedgehog hedgehog closed this as completed Jan 3, 2013
@bendilley
Copy link
Contributor

Thanks @hedgehog!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants