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

Bug: Getting Error when using keyword arguments for allure step method #549

Closed
samuel-anbudaiyan opened this issue Apr 30, 2024 · 1 comment · Fixed by #550
Closed

Bug: Getting Error when using keyword arguments for allure step method #549

samuel-anbudaiyan opened this issue Apr 30, 2024 · 1 comment · Fixed by #550
Labels
bug Something isn't working

Comments

@samuel-anbudaiyan
Copy link

Getting the below error for the below function call

step("Get jobs")
def self.get_jobs(a: , b: , c: )
  puts a,b,c
end
ArgumentError:
       wrong number of arguments (given 1, expected 0; required keywords: a, b, c)
     # ./qe/service/s3.rb:24:in `get_jobs'
     # /Users/sam/.rvm/gems/ruby-3.0.0/gems/allure-ruby-commons-2.24.4/lib/allure_ruby_commons/step_annotation.rb:24:in `call'
     # /Users/sam/.rvm/gems/ruby-3.0.0/gems/allure-ruby-commons-2.24.4/lib/allure_ruby_commons/step_annotation.rb:24:in `block (2 levels) in singleton_method_added'
     # /Users/sam/.rvm/gems/ruby-3.0.0/gems/allure-ruby-commons-2.24.4/lib/allure-ruby-commons.rb:224:in `run_step'
     # /Users/sam/.rvm/gems/ruby-3.0.0/gems/allure-ruby-commons-2.24.4/lib/allure_ruby_commons/step_annotation.rb:24:in `block in singleton_method_added'
     # ./spec/platform/alr/alr_s3_spec.rb:72:in `block (4 levels) in <top (required)>'
     # /Users/sam/.rvm/gems/ruby-3.0.0/gems/allure-ruby-commons-2.24.4/lib/allure-ruby-commons.rb:224:in `run_step'
     # ./spec/platform/alr/alr_s3_spec.rb:66:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:109:in `block (2 levels) in <top (required)>'
     # /Users/sam/.rvm/gems/ruby-3.0.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in `block in run'
     # /Users/sam/.rvm/gems/ruby-3.0.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `loop'
     # /Users/sam/.rvm/gems/ruby-3.0.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `run'
     # /Users/sam/.rvm/gems/ruby-3.0.0/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
     # ./spec/spec_helper.rb:72:in `block (2 levels) in <top (required)>'
     # /Users/sam/.rvm/gems/ruby-3.0.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in `block in run'
     # /Users/sam/.rvm/gems/ruby-3.0.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `loop'
     # /Users/sam/.rvm/gems/ruby-3.0.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `run'
     # /Users/sam/.rvm/gems/ruby-3.0.0/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
     # /Users/sam/.rvm/gems/ruby-3.0.0/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in `block (2 levels) in setup'

Checked how the params is being taken using the below code

puts method(:get_jobs)

Output:
#<Method: get_jobs(*args, &block) /Users/sam/.rvm/gems/ruby-3.0.0/gems/allure-ruby-commons-2.24.4/lib/allure_ruby_commons/step_annotation.rb:23>

It seems that is taking *args and not a:, b:, c:. But commenting the step method works.

@andrcuns
Copy link
Collaborator

andrcuns commented May 6, 2024

Thanks, this is definitely a bug. Looks like nobody really ever used this functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants