enkessler / cuke_linter

A linting tool for Cucumber
MIT License
32 stars 8 forks source link

error running cucumber tests #20

Closed mjnohai closed 4 years ago

mjnohai commented 4 years ago

I get the following error when running cucumber tests.

bundle exec cucumber features/imedidata/smoke_imedidata_nav.feature Knapsack time offset warning enabled! undefined methodkeys' for # (NoMethodError) /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/gems/cucumber-core-3.2.1/lib/cucumber/core/gherkin/ast_builder.rb:81:in rubify_keys' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/gems/cucumber-core-3.2.1/lib/cucumber/core/gherkin/ast_builder.rb:32:ininitialize' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/gems/cucumber-core-3.2.1/lib/cucumber/core/gherkin/ast_builder.rb:125:in initialize' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/gems/cucumber-core-3.2.1/lib/cucumber/core/gherkin/ast_builder.rb:106:innew' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/gems/cucumber-core-3.2.1/lib/cucumber/core/gherkin/ast_builder.rb:106:in feature' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/gems/cucumber-core-3.2.1/lib/cucumber/core/gherkin/ast_builder.rb:17:infeature' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/gems/cucumber-core-3.2.1/lib/cucumber/core/gherkin/parser.rb:32:in document' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/gems/cucumber-core-3.2.1/lib/cucumber/core.rb:30:inblock in parse' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/gems/cucumber-core-3.2.1/lib/cucumber/core.rb:29:in each' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/gems/cucumber-core-3.2.1/lib/cucumber/core.rb:29:inparse' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/gems/cucumber-core-3.2.1/lib/cucumber/core.rb:21:in compile' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/gems/cucumber-3.2.0/lib/cucumber/runtime.rb:75:inrun!' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/gems/cucumber-3.2.0/lib/cucumber/cli/main.rb:34:in execute!' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/gems/cucumber-3.2.0/bin/cucumber:9:in<top (required)>' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/bin/cucumber:23:in load' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/bin/cucumber:23:in

' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/bin/ruby_executable_hooks:24:in eval' /Users/mnohai/.rvm/gems/ruby-2.6.6@mist/bin/ruby_executable_hooks:24:in
'`

mjnohai commented 4 years ago

removing the cuke_linter gem, I was able to run the tests again.

enkessler commented 4 years ago

Off hand, cuke_linter does not appear to be the problem because it is not anywhere in that stack trace. That being said, I am curious what the difference is between the two different lockfiles generated by Bundler when you have CukeLinter listed as a dependency vs when you don't. My guess is that the inclusion of the cuke_linter in your gemset causes Bundler to generate different transitive dependencies and it is in those transitive dependencies that the problem lies.

enkessler commented 4 years ago

@mnohai-mdsol Which version of cuke_modeler is Bundler pulling in as a dependency for cuke_linter? Newer versions of CukeModeler use the cucumber-gherkin gem, which does not work with earlier versions of the cucumber gem (according to that stack trace, you are using 3.2) due to the transition from gherkin to cucumber-gherkin that Cucumber underwent recently. In other words, I think that you may be running into this.

Try either upgrading to Cucumber 4.x+ or limiting CukeModeler to < 3.x and see if that allows you to have CukeLinter in your bundle without encountering errors.

enkessler commented 4 years ago

Given that the root cause of this issue in with another gem and a workaround exists, I'm going to close this issue.