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

Fix an json compile error for "bundle install" on Ruby 2.4. #1069

Merged

Conversation

junaruga
Copy link
Contributor

@junaruga junaruga commented Jan 9, 2017

Summary

Fix an json compile error for "bundle install" on Ruby 2.4.
Installed json-1.8.3 does not have a compatibility for Ruby 2.4.

Details

$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
$ bundle -v
Bundler version 1.13.7

On lastest master branch (commit hash: 8871da4)

$ pushd ../cucumber-ruby-core
$ git checkout v2.0.0
$ popd
$ pushd ../cucumber-ruby-wire
$ git checkout v0.0.1
$ popd
$ bundle install --path vendor/bundle
...
current directory:
/home/jaruga/git/cucumber-ruby/vendor/bundle/ruby/2.4.0/gems/json-1.8.3/ext/json/ext/generator
/usr/local/ruby-2.4.0/bin/ruby -r ./siteconf20170109-6691-15ef87j.rb extconf.rb
creating Makefile

current directory:
/home/jaruga/git/cucumber-ruby/vendor/bundle/ruby/2.4.0/gems/json-1.8.3/ext/json/ext/generator 
make "DESTDIR=" clean

current directory:
/home/jaruga/git/cucumber-ruby/vendor/bundle/ruby/2.4.0/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
generator.c: In function ‘generate_json’:
generator.c:861:25: error: ‘rb_cFixnum’ undeclared (first use in this function)
     } else if (klass == rb_cFixnum) {
                         ^~~~~~~~~~
generator.c:861:25: note: each undeclared identifier is reported only once for each
function it appears in
generator.c:863:25: error: ‘rb_cBignum’ undeclared (first use in this function)
     } else if (klass == rb_cBignum) {
                         ^~~~~~~~~~
generator.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
Makefile:241: recipe for target 'generator.o' failed
make: *** [generator.o] Error 1
...

Motivation and Context

We may want to run cucumber on Ruby 2.4.

How Has This Been Tested?

Screenshots (if appropriate):

I ran below command, and done successfully.

$ bundle install --path vendor/bundle

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I've added tests for my code
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Later I want to add ruby 2.4.0 to .travis.yml.
But right now I got an error for bundle exec rake cucumber.
I will inform it as a issue later.

cucumber.gemspec Outdated
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.add_dependency 'cucumber-wire', '~> 0.0.1'

s.add_development_dependency 'aruba', '~> 0.6.1'
s.add_development_dependency 'json', '~> 1.7'
s.add_development_dependency 'json', '>= 1.7', '< 2.1'
s.add_development_dependency 'nokogiri', '~> 1.5'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather bump to ~> 2.0, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nodo I agree with you. I will also prefer it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@node I updated my code adding new commit in the pull request. Feel free to do "rebase" of it.

@nodo
Copy link
Member

nodo commented Jan 29, 2017

Thanks for your help @junaruga!

@junaruga
Copy link
Contributor Author

You are welcome @nodo !

@nodo
Copy link
Member

nodo commented Jan 30, 2017

Looks like we hit this bug: ku1ik/rainbow#49 (comment) . Possibly we could modify .travis.yml adding gem update --system in before_install.

@junaruga
Copy link
Contributor Author

@nodo ok I saw your pull-request: #1074

@mattwynne
Copy link
Member

OK I merged #1074. @junaruga wanna rebase and see if that helps?

@junaruga junaruga force-pushed the feature/fix-bundle-install-error-on-ruby2.4 branch from c474647 to 1daf131 Compare February 1, 2017 19:28
@junaruga
Copy link
Contributor Author

junaruga commented Feb 1, 2017

@mattwynne ok, I did rebase right now. and checking Travis CI.

@jacobat
Copy link

jacobat commented Feb 1, 2017

json-1.8.6 is released and compatible with ruby-2.4.0 - forcing 2.x may cause issues for people dependent on the 1.8.x - see rails/rails#27450

@junaruga
Copy link
Contributor Author

junaruga commented Feb 1, 2017

@jacobat ok thanks for the information. So, finally this PR can be closed.

@nodo
Copy link
Member

nodo commented Feb 6, 2017

@jacobat Please, can you test and bump to json-1.8.6 then? I think @jacobat has a valid point, better not bump the major version if it is not absolutely needed.

Sorry for the hassle and thanks for investigating this.

@jacobat
Copy link

jacobat commented Feb 7, 2017

Did you mean @junaruga ?

@nodo
Copy link
Member

nodo commented Feb 7, 2017

yes, thanks @jacobat :-)

@junaruga
Copy link
Contributor Author

junaruga commented Feb 7, 2017

Hi @nodo ok, I will test it. Just moment!

@junaruga
Copy link
Contributor Author

junaruga commented Feb 7, 2017

@nodo

bump to json-1.8.6 then

What do you mean?
Current source 'json', '~> 1.7' in cucumber.gemspec means 1.7 <= x < 2.0 including 1.8.6. We do not need to change code to use json-1.8.6.
or do you want to update as 'json', '~> 1.8.6'? That means 1.8.6 <= x < 1.9.0.

See for detail of ~>
http://bundler.io/gemfile.html

@junaruga
Copy link
Contributor Author

junaruga commented Feb 7, 2017

@nodo
Installing on Ruby 2.40, is succeeded!
(But test was failed.)

$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]

$ bundle -v
Bundler version 1.14.3

$ pwd
/home/jaruga/git/cucumber-ruby

$ pushd ../cucumber-ruby-core
$ git checkout master
$ git clean -fdx
$ git pull
$ popd

$ pushd ../cucumber-ruby-wire
$ git checkout master
$ git clean -fdx
$ git pull
$ popd

$ git checkout master
$ git clean -fdx
$ git pull
$ bundle install --path vendor/bundle

$ bundle list
Gems included by the bundle:
  * addressable (2.5.0)
  * aruba (0.6.2)
  * ast (2.3.0)
  * backports (3.6.8)
  * bcat (0.6.2)
  * builder (3.2.3)
  * bundler (1.14.3)
  * capybara (2.12.0)
  * childprocess (0.6.1)
  * coderay (1.1.1)
  * coveralls (0.8.19)
  * cucumber (3.0.0.pre.1)
  * cucumber-core (2.0.0)
  * cucumber-pro (0.0.13)
  * cucumber-wire (0.0.1)
  * diff-lcs (1.3)
  * docile (1.1.5)
  * eventmachine (1.2.2)
  * faye-websocket (0.10.6)
  * ffi (1.9.17)
  * gherkin (4.0.0)
  * json (1.8.6)
  * kramdown (0.14.2)
  * method_source (0.8.2)
  * mime-types (2.99.3)
  * mini_portile2 (2.1.0)
  * multi_json (1.12.1)
  * multi_test (0.1.2)
  * nokogiri (1.7.0.1)
  * parser (2.4.0.0)
  * powerpack (0.1.1)
  * pry (0.10.4)
  * public_suffix (2.0.5)
  * rack (1.6.5)
  * rack-protection (1.5.3)
  * rack-test (0.6.3)
  * rainbow (2.2.1)
  * rake (12.0.0)
  * rspec (3.5.0)
  * rspec-core (3.5.4)
  * rspec-expectations (3.5.0)
  * rspec-mocks (3.5.0)
  * rspec-support (3.5.0)
  * rubocop (0.40.0)
  * ruby-progressbar (1.8.1)
  * simplecov (0.12.0)
  * simplecov-html (0.10.0)
  * sinatra (1.4.8)
  * slop (3.6.0)
  * syntax (1.2.1)
  * term-ansicolor (1.4.0)
  * thor (0.19.4)
  * tilt (2.0.6)
  * tins (1.13.2)
  * unicode-display_width (1.1.3)
  * websocket-driver (0.6.5)
  * websocket-extensions (0.1.2)
  * xpath (2.0.0)
  * yard (0.8.7.6)

$ bundle exec rake spec
...
568 examples, 0 failures

$ bundle exec rake cucumber
...
207 scenarios (18 failed, 189 passed)
1217 steps (18 failed, 1199 passed)
0m25.538s

@junaruga
Copy link
Contributor Author

junaruga commented Feb 7, 2017

Detail log of bundle exec rake cucumber

$ bundle exec rake cucumber
/usr/local/ruby-2.4.0/bin/ruby -S bundle exec cucumber
Using the default profile...
.................................F...........................................................................................................................F...............F....F.....................................F..................................................F...............................................................F.....F....F....F.........F..............................................................................................................................F......................................................................................................F.............................................................F........................................................F...............................................................................................F..........................................................................................................................................................................................................................................................................................................................................................................F.........F.........................................

(::) failed steps (::)

expected "Feature: test\n\n  Scenario:                      # features/test.feature:2\n    Given this step is ...fined$/) do\n  pending # Write code here that turns the phrase above into concrete actions\nend\n\n" to include "Feature: test\n\n  Scenario:                      # features/test.feature:2\n    Given this step is ...est.feature:3:in `Given this step is undefined'\n\n1 scenario (1 undefined)\n1 step (1 undefined)\n"
Diff:
@@ -1,2 +1,18 @@
-Feature: test\n\n  Scenario:                      # features/test.feature:2\n    Given this step is undefined # features/test.feature:3\n      Undefined step: "this step is undefined" (Cucumber::Undefined)\n      features/test.feature:3:in `Given this step is undefined'\n\n1 scenario (1 undefined)\n1 step (1 undefined)\n
+Feature: test
+
+  Scenario:                      # features/test.feature:2
+    Given this step is undefined # features/test.feature:3
+      Undefined step: "this step is undefined" (Cucumber::Undefined)
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
+      features/test.feature:3:in `Given this step is undefined'
+
+1 scenario (1 undefined)
+1 step (1 undefined)
+
+You can implement step definitions for undefined steps with these snippets:
+
+Given(/^this step is undefined$/) do
+  pending # Write code here that turns the phrase above into concrete actions
+end
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/cli/dry_run.feature:58:in `Then it should fail with:'

expected "Feature: Failing expectation\n\n  Scenario: Failing expectation\n    Given failing expectation\n    ...ios:\ncucumber features/failing_expectation.feature:3\n\n1 scenario (1 failed)\n1 step (1 failed)\n" to include "Feature: Failing expectation\n\n  Scenario: Failing expectation\n    Given failing expectation\n    ...arios:\ncucumber features/failing_expectation.feature:3\n\n1 scenario (1 failed)\n1 step (1 failed)"
Diff:
@@ -1,2 +1,21 @@
-Feature: Failing expectation\n\n  Scenario: Failing expectation\n    Given failing expectation\n      \n      expected: "that"\n           got: "this"\n      \n      (compared using ==)\n       (RSpec::Expectations::ExpectationNotMetError)\n      ./features/step_definitions/steps.rb:2:in `/^failing expectation$/'\n      features/failing_expectation.feature:4:in `Given failing expectation'\n\nFailing Scenarios:\ncucumber features/failing_expectation.feature:3\n\n1 scenario (1 failed)\n1 step (1 failed)
+Feature: Failing expectation
+
+  Scenario: Failing expectation
+    Given failing expectation
+      
+      expected: "that"
+           got: "this"
+      
+      (compared using ==)
+       (RSpec::Expectations::ExpectationNotMetError)
+      ./features/step_definitions/steps.rb:2:in `/^failing expectation$/'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
+      features/failing_expectation.feature:4:in `Given failing expectation'
+
+Failing Scenarios:
+cucumber features/failing_expectation.feature:3
+
+1 scenario (1 failed)
+1 step (1 failed)
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/cli/showing_differences.feature:23:in `Then it should fail with:'

expected "Feature: Missing\n\n  Scenario: Missing\n    Given this step passes\n      Undefined step: \"this st...s/missing.feature:3:in `Given this step passes'\n\n1 scenario (1 undefined)\n1 step (1 undefined)\n" to include "Feature: Missing\n\n  Scenario: Missing\n    Given this step passes\n      Undefined step: \"this st...res/missing.feature:3:in `Given this step passes'\n\n1 scenario (1 undefined)\n1 step (1 undefined)"
Diff:
@@ -1,2 +1,12 @@
-Feature: Missing\n\n  Scenario: Missing\n    Given this step passes\n      Undefined step: "this step passes" (Cucumber::Undefined)\n      features/missing.feature:3:in `Given this step passes'\n\n1 scenario (1 undefined)\n1 step (1 undefined)
+Feature: Missing
+
+  Scenario: Missing
+    Given this step passes
+      Undefined step: "this step passes" (Cucumber::Undefined)
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
+      features/missing.feature:3:in `Given this step passes'
+
+1 scenario (1 undefined)
+1 step (1 undefined)
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/cli/strict_mode.feature:22:in `Then it should fail with:'

expected "Feature: Pending\n\n  Scenario: Pending\n    Given this step is pending\n      TODO (Cucumber::Pendi...s/pending.feature:3:in `Given this step is pending'\n\n1 scenario (1 pending)\n1 step (1 pending)\n" to include "Feature: Pending\n\n  Scenario: Pending\n    Given this step is pending\n      TODO (Cucumber::Pendi...res/pending.feature:3:in `Given this step is pending'\n\n1 scenario (1 pending)\n1 step (1 pending)"
Diff:
@@ -1,2 +1,13 @@
-Feature: Pending\n\n  Scenario: Pending\n    Given this step is pending\n      TODO (Cucumber::Pending)\n      ./features/step_definitions/steps.rb:3:in `/^this step is pending$/'\n      features/pending.feature:3:in `Given this step is pending'\n\n1 scenario (1 pending)\n1 step (1 pending)
+Feature: Pending
+
+  Scenario: Pending
+    Given this step is pending
+      TODO (Cucumber::Pending)
+      ./features/step_definitions/steps.rb:3:in `/^this step is pending$/'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
+      features/pending.feature:3:in `Given this step is pending'
+
+1 scenario (1 pending)
+1 step (1 pending)
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/cli/strict_mode.feature:38:in `Then it should fail with:'


expected: "Feature: Calling undefined step\n\n  Scenario: Call directly\n    Given a step that calls an undefin...eatures/call_undefined_step_from_step_def.feature:6\n\n2 scenarios (2 failed)\n2 steps (2 failed)\n"
     got: "Feature: Calling undefined step\n\n  Scenario: Call directly\n    Given a step that calls an undefin...eatures/call_undefined_step_from_step_def.feature:6\n\n2 scenarios (2 failed)\n2 steps (2 failed)\n"

(compared using ==)

Diff:
@@ -4,6 +4,8 @@
     Given a step that calls an undefined step
       Undefined dynamic step: "this does not exist" (Cucumber::UndefinedDynamicStep)
       ./features/step_definitions/steps.rb:2:in `/^a step that calls an undefined step$/'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
       features/call_undefined_step_from_step_def.feature:4:in `Given a step that calls an undefined step'
 
   Scenario: Call via another
@@ -11,6 +13,8 @@
       Undefined dynamic step: "this does not exist" (Cucumber::UndefinedDynamicStep)
       ./features/step_definitions/steps.rb:2:in `/^a step that calls an undefined step$/'
       ./features/step_definitions/steps.rb:6:in `/^a step that calls a step that calls an undefined step$/'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
       features/call_undefined_step_from_step_def.feature:7:in `Given a step that calls a step that calls an undefined step'
 
 Failing Scenarios:
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/defining_steps/nested_steps.feature:153:in `Then it should fail with exactly:'


expected: "Feature: Tables\n\n  Scenario: Extra row         # features/tables.feature:2\n    Then the table sho...ures/tables.feature:2 # Scenario: Extra row\n\n1 scenario (1 failed)\n1 step (1 failed)\n0m0.012s\n"
     got: "Feature: Tables\n\n  Scenario: Extra row         # features/tables.feature:2\n    Then the table sho...ures/tables.feature:2 # Scenario: Extra row\n\n1 scenario (1 failed)\n1 step (1 failed)\n0m0.012s\n"

(compared using ==)

Diff:
@@ -11,6 +11,8 @@
         | (+) a | (+) c |
        (Cucumber::MultilineArgument::DataTable::Different)
       ./features/step_definitions/steps.rb:2:in `/the table should be:/'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
       features/tables.feature:3:in `Then the table should be:'
 
 Failing Scenarios:
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/defining_steps/table_diffing.feature:26:in `Then it should fail with exactly:'

expected "Feature: Sample\n\n  Scenario: Naughty Step                   # features/naughty_step_in_scenario.fe...ture:3 # Scenario: Naughty Step\n\n2 scenarios (1 failed, 1 passed)\n2 steps (2 passed)\n0m0.012s\n" to include "Feature: Sample\n\n  Scenario: Naughty Step                   # features/naughty_step_in_scenario.fe...enario.feature:3 # Scenario: Naughty Step\n\n2 scenarios (1 failed, 1 passed)\n2 steps (2 passed)\n"
Diff:
@@ -1,2 +1,20 @@
-Feature: Sample\n\n  Scenario: Naughty Step                   # features/naughty_step_in_scenario.feature:3\n    Given this step does something naughty # features/step_definitions/naughty_steps.rb:1\n      This step has been very very naughty (NaughtyStepException)\n      ./features/support/env.rb:4:in `AfterStep'\n      features/naughty_step_in_scenario.feature:4:in `Given this step does something naughty'\n\n  Scenario: Success        # features/naughty_step_in_scenario.feature:6\n    Given this step passes # features/step_definitions/steps.rb:1\n\nFailing Scenarios:\ncucumber features/naughty_step_in_scenario.feature:3 # Scenario: Naughty Step\n\n2 scenarios (1 failed, 1 passed)\n2 steps (2 passed)\n
+Feature: Sample
+
+  Scenario: Naughty Step                   # features/naughty_step_in_scenario.feature:3
+    Given this step does something naughty # features/step_definitions/naughty_steps.rb:1
+      This step has been very very naughty (NaughtyStepException)
+      ./features/support/env.rb:4:in `AfterStep'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
+      features/naughty_step_in_scenario.feature:4:in `Given this step does something naughty'
+
+  Scenario: Success        # features/naughty_step_in_scenario.feature:6
+    Given this step passes # features/step_definitions/steps.rb:1
+
+Failing Scenarios:
+cucumber features/naughty_step_in_scenario.feature:3 # Scenario: Naughty Step
+
+2 scenarios (1 failed, 1 passed)
+2 steps (2 passed)
+0m0.012s
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/exception_in_after_step_hook.feature:36:in `Then it should fail with:'

expected "Feature: Sample\n\n  Scenario Outline: Naughty Step # features/naughty_step_in_scenario_outline.feat...ne: Naughty Step, Examples (#2)\n\n4 scenarios (1 failed, 3 passed)\n4 steps (4 passed)\n0m0.012s\n" to include "Feature: Sample\n\n  Scenario Outline: Naughty Step # features/naughty_step_in_scenario_outline.feat...ario Outline: Naughty Step, Examples (#2)\n\n4 scenarios (1 failed, 3 passed)\n4 steps (4 passed)\n"
Diff:
@@ -1,2 +1,27 @@
-Feature: Sample\n\n  Scenario Outline: Naughty Step # features/naughty_step_in_scenario_outline.feature:3\n    Given this step <Might Work> # features/naughty_step_in_scenario_outline.feature:4\n\n    Examples: \n      | Might Work             |\n      | passes                 |\n      | does something naughty |\n      This step has been very very naughty (NaughtyStepException)\n      ./features/support/env.rb:4:in `AfterStep'\n      features/naughty_step_in_scenario_outline.feature:9:in `Given this step does something naughty'\n      features/naughty_step_in_scenario_outline.feature:4:in `Given this step <Might Work>'\n      | passes                 |\n\n  Scenario: Success        # features/naughty_step_in_scenario_outline.feature:12\n    Given this step passes # features/step_definitions/steps.rb:1\n\nFailing Scenarios:\ncucumber features/naughty_step_in_scenario_outline.feature:9 # Scenario Outline: Naughty Step, Examples (#2)\n\n4 scenarios (1 failed, 3 passed)\n4 steps (4 passed)\n
+Feature: Sample
+
+  Scenario Outline: Naughty Step # features/naughty_step_in_scenario_outline.feature:3
+    Given this step <Might Work> # features/naughty_step_in_scenario_outline.feature:4
+
+    Examples: 
+      | Might Work             |
+      | passes                 |
+      | does something naughty |
+      This step has been very very naughty (NaughtyStepException)
+      ./features/support/env.rb:4:in `AfterStep'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
+      features/naughty_step_in_scenario_outline.feature:9:in `Given this step does something naughty'
+      features/naughty_step_in_scenario_outline.feature:4:in `Given this step <Might Work>'
+      | passes                 |
+
+  Scenario: Success        # features/naughty_step_in_scenario_outline.feature:12
+    Given this step passes # features/step_definitions/steps.rb:1
+
+Failing Scenarios:
+cucumber features/naughty_step_in_scenario_outline.feature:9 # Scenario Outline: Naughty Step, Examples (#2)
+
+4 scenarios (1 failed, 3 passed)
+4 steps (4 passed)
+0m0.012s
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/exception_in_after_step_hook.feature:76:in `Then it should fail with:'


expected: "Feature: \n\n  Scenario: \n  this should be reported (RuntimeError)\n  ./features/support/env.rb:2:i...Around'\n\nFailing Scenarios:\ncucumber features/test.feature:2\n\n1 scenario (1 failed)\n0 steps\n"
     got: "Feature: \n\n  Scenario: \n  this should be reported (RuntimeError)\n  ./features/support/env.rb:2:i...<main>'\n\nFailing Scenarios:\ncucumber features/test.feature:2\n\n1 scenario (1 failed)\n0 steps\n"

(compared using ==)

Diff:
@@ -3,6 +3,8 @@
   Scenario: 
   this should be reported (RuntimeError)
   ./features/support/env.rb:2:in `Around'
+  /usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+  /usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
 
 Failing Scenarios:
 cucumber features/test.feature:2
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/exception_in_around_hook.feature:31:in `Then it should fail with exactly:'


expected: "Feature: \n\n  Scenario: \n    Given this step passes\n      this should be reported (RuntimeError)\...nFailing Scenarios:\ncucumber features/test.feature:2\n\n1 scenario (1 failed)\n1 step (1 passed)\n"
     got: "Feature: \n\n  Scenario: \n    Given this step passes\n      this should be reported (RuntimeError)\...nFailing Scenarios:\ncucumber features/test.feature:2\n\n1 scenario (1 failed)\n1 step (1 passed)\n"

(compared using ==)

Diff:
@@ -4,6 +4,8 @@
     Given this step passes
       this should be reported (RuntimeError)
       ./features/support/env.rb:3:in `Around'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
 
 Failing Scenarios:
 cucumber features/test.feature:2
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/exception_in_around_hook.feature:63:in `Then it should fail with exactly:'


expected: "Feature: Sample\n\n  Background:              # features/naughty_step_in_before.feature:3\n  I canno...ore.feature:6 # Scenario: Run a good step\n\n1 scenario (1 failed)\n2 steps (2 skipped)\n0m0.012s\n"
     got: "Feature: Sample\n\n  Background:              # features/naughty_step_in_before.feature:3\n  I canno...ore.feature:6 # Scenario: Run a good step\n\n1 scenario (1 failed)\n2 steps (2 skipped)\n0m0.012s\n"

(compared using ==)

Diff:
@@ -3,6 +3,8 @@
   Background:              # features/naughty_step_in_before.feature:3
   I cannot even start this scenario (SomeSetupException)
   ./features/support/env.rb:4:in `Before'
+  /usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+  /usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
     Given this step passes # features/step_definitions/steps.rb:1
 
   Scenario: Run a good step # features/naughty_step_in_before.feature:6
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/exception_in_before_hook.feature:56:in `Then it should fail with exactly:'


expected: [{"id"=>"a-docstring-feature", "uri"=>"features/doc_string.feature", "keyword"=>"Feature", "name"=>"A...hould fail with/'\nfeatures/doc_string.feature:4:in `Then I should fail with'", "duration"=>1}}]}]}]
     got: [{"uri"=>"features/doc_string.feature", "id"=>"a-docstring-feature", "keyword"=>"Feature", "name"=>"A...le:22:in `<main>'\nfeatures/doc_string.feature:4:in `Then I should fail with'", "duration"=>1}}]}]}]

(compared using ==)

Diff:






@@ -1,25 +1,25 @@
-[{"id"=>"a-docstring-feature",
-  "uri"=>"features/doc_string.feature",
+[{"uri"=>"features/doc_string.feature",
+  "id"=>"a-docstring-feature",
   "keyword"=>"Feature",
   "name"=>"A DocString feature",
-  "line"=>1,
   "description"=>"",
+  "line"=>1,
   "elements"=>
    [{"id"=>"a-docstring-feature;",
      "keyword"=>"Scenario",
      "name"=>"",
-     "line"=>3,
      "description"=>"",
+     "line"=>3,
      "type"=>"scenario",
      "steps"=>
       [{"keyword"=>"Then ",
         "name"=>"I should fail with",
         "line"=>4,
-        "doc_string"=>{"content_type"=>"", "value"=>"a string", "line"=>5},
+        "doc_string"=>{"value"=>"a string", "content_type"=>"", "line"=>5},
         "match"=>{"location"=>"features/step_definitions/steps.rb:1"},
         "result"=>
          {"status"=>"failed",
           "error_message"=>
-           "a string (RuntimeError)\n./features/step_definitions/steps.rb:2:in `/I should fail with/'\nfeatures/doc_string.feature:4:in `Then I should fail with'",
+           "a string (RuntimeError)\n./features/step_definitions/steps.rb:2:in `/I should fail with/'\n/usr/local/ruby-2.4.0/bin/bundle:22:in `load'\n/usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'\nfeatures/doc_string.feature:4:in `Then I should fail with'",
           "duration"=>1}}]}]}]
 (RSpec::Expectations::ExpectationNotMetError)
./features/lib/step_definitions/json_steps.rb:6:in `/^it should (pass|fail) with JSON:$/'
features/docs/formatters/json_formatter.feature:307:in `Then it should fail with JSON:'


expected: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<testsuite failures=\"2\" errors=\"0\" skipped=\"0\" tes...]>\n  </system-out>\n  <system-err>\n    <![CDATA[]]>\n  </system-err>\n</testcase>\n</testsuite>\n"
     got: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<testsuite failures=\"2\" errors=\"0\" skipped=\"0\" tes...]>\n  </system-out>\n  <system-err>\n    <![CDATA[]]>\n  </system-err>\n</testcase>\n</testsuite>\n"

(compared using ==)

Diff:
@@ -10,6 +10,8 @@
 ]]>
     <![CDATA[TODO (Cucumber::Pending)
 ./features/step_definitions/steps.rb:3:in `/^this step is pending$/'
+/usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+/usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
 features/pending.feature:4:in `Given this step is pending']]>
   </failure>
   <system-out>
 (RSpec::Expectations::ExpectationNotMetError)
./features/lib/step_definitions/junit_steps.rb:5:in `/^the junit output file "(.*?)" should contain:$/'
features/docs/formatters/junit_formatter.feature:184:in `And the junit output file "tmp/TEST-features-pending.xml" should contain:'

expected "Feature: \n\n  Scenario: \n      Before hook\n    Given this step passes\n      AfterStep hook\n    ...nFailing Scenarios:\ncucumber features/test.feature:2\n\n1 scenario (1 failed)\n1 step (1 passed)\n" to include "Feature: \n\n  Scenario: \n      Before hook\n    Given this step passes\n      AfterStep hook\n    ...n\nFailing Scenarios:\ncucumber features/test.feature:2\n\n1 scenario (1 failed)\n1 step (1 passed)"
Diff:
@@ -1,2 +1,18 @@
-Feature: \n\n  Scenario: \n      Before hook\n    Given this step passes\n      AfterStep hook\n      After hook\n      error (RuntimeError)\n      ./features/step_definitions/output_steps.rb:11:in `After'\n\nFailing Scenarios:\ncucumber features/test.feature:2\n\n1 scenario (1 failed)\n1 step (1 passed)
+Feature: 
+
+  Scenario: 
+      Before hook
+    Given this step passes
+      AfterStep hook
+      After hook
+      error (RuntimeError)
+      ./features/step_definitions/output_steps.rb:11:in `After'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
+
+Failing Scenarios:
+cucumber features/test.feature:2
+
+1 scenario (1 failed)
+1 step (1 passed)
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/formatters/pretty_formatter.feature:56:in `Then it should fail with:'

expected "No such file or directory @ rb_sysopen - features. You can use `cucumber --init` to get started.\n" to include "No such file or directory - features. You can use `cucumber --init` to get started."
Diff:
@@ -1,2 +1,2 @@
-No such file or directory - features. You can use `cucumber --init` to get started.
+No such file or directory @ rb_sysopen - features. You can use `cucumber --init` to get started.
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/getting_started.feature:10:in `Then it should fail with:'


expected: "Feature: Pending background sample\n\n  Background: \n    Given this step is pending\n      TODO (Cu...und\n    Then I should have '10' cukes\n\n2 scenarios (2 pending)\n4 steps (2 skipped, 2 pending)\n"
     got: "Feature: Pending background sample\n\n  Background: \n    Given this step is pending\n      TODO (Cu...und\n    Then I should have '10' cukes\n\n2 scenarios (2 pending)\n4 steps (2 skipped, 2 pending)\n"

(compared using ==)

Diff:
@@ -4,6 +4,8 @@
     Given this step is pending
       TODO (Cucumber::Pending)
       ./features/step_definitions/steps.rb:3:in `/^this step is pending$/'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
       features/pending_background.feature:4:in `Given this step is pending'
 
   Scenario: pending background
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/gherkin/background.feature:365:in `Then it should pass with exactly:'


expected: "Feature: With and without hooks\n\n  Scenario: using hook     # features/f.feature:2\n  boom (Runtim...eatures/f.feature:2 # Scenario: using hook\n\n1 scenario (1 failed)\n1 step (1 skipped)\n0m0.012s\n"
     got: "Feature: With and without hooks\n\n  Scenario: using hook     # features/f.feature:2\n  boom (Runtim...eatures/f.feature:2 # Scenario: using hook\n\n1 scenario (1 failed)\n1 step (1 skipped)\n0m0.012s\n"

(compared using ==)

Diff:
@@ -3,6 +3,8 @@
   Scenario: using hook     # features/f.feature:2
   boom (RuntimeError)
   ./features/support/hooks.rb:2:in `Before'
+  /usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+  /usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
     Given this step passes # features/step_definitions/steps.rb:1
 
 Failing Scenarios:
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/writing_support_code/tagged_hooks.feature:36:in `Then it should fail with exactly:'


expected: "Feature: With and without hooks\n\n  Scenario Outline: omitting hook on specified examples # feature... hook on specified examples, Examples (#1)\n\n1 scenario (1 failed)\n1 step (1 skipped)\n0m0.012s\n"
     got: "Feature: With and without hooks\n\n  Scenario Outline: omitting hook on specified examples # feature... hook on specified examples, Examples (#1)\n\n1 scenario (1 failed)\n1 step (1 skipped)\n0m0.012s\n"

(compared using ==)

Diff:
@@ -7,6 +7,8 @@
       | Value      |
       boom (RuntimeError)
       ./features/support/hooks.rb:2:in `Before'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `load'
+      /usr/local/ruby-2.4.0/bin/bundle:22:in `<main>'
       | Irrelevant |
 
 Failing Scenarios:
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/writing_support_code/tagged_hooks.feature:71:in `Then it should fail with exactly:'

Failing Scenarios:
cucumber features/docs/cli/dry_run.feature:50 # Scenario: In strict mode with an undefined step
cucumber features/docs/cli/showing_differences.feature:8 # Scenario: Run single failing scenario with default diff enabled
cucumber features/docs/cli/strict_mode.feature:20 # Scenario: Fail with --strict due to undefined step
cucumber features/docs/cli/strict_mode.feature:35 # Scenario: Fail with --strict due to pending step
cucumber features/docs/defining_steps/nested_steps.feature:131 # Scenario: Undefined nested step
cucumber features/docs/defining_steps/table_diffing.feature:7 # Scenario: Extra row
cucumber features/docs/exception_in_after_step_hook.feature:24 # Scenario: Handle Exception in standard scenario step and carry on
cucumber features/docs/exception_in_after_step_hook.feature:57 # Scenario: Handle Exception in scenario outline table row and carry on
cucumber features/docs/exception_in_around_hook.feature:15 # Scenario: Exception before the test case is run
cucumber features/docs/exception_in_around_hook.feature:47 # Scenario: Exception after the test case is run
cucumber features/docs/exception_in_before_hook.feature:44 # Scenario: Handle Exception in Before hook for Scenario with Background
cucumber features/docs/formatters/json_formatter.feature:289 # Scenario: DocString
cucumber features/docs/formatters/junit_formatter.feature:178 # Scenario: pending and undefined steps with strict option should fail
cucumber features/docs/formatters/pretty_formatter.feature:31 # Scenario: Hook output should be printed before hook exception
cucumber features/docs/getting_started.feature:7 # Scenario: Run Cucumber in an empty directory
cucumber features/docs/gherkin/background.feature:363 # Scenario: run a feature with a background that is pending
cucumber features/docs/writing_support_code/tagged_hooks.feature:34 # Scenario: omit tagged hook
cucumber features/docs/writing_support_code/tagged_hooks.feature:69 # Scenario: Omit example hook

@brasmusson
Copy link
Contributor

It looks like 9c857e5 made the backtrace filter a bit too specific.

@nodo
Copy link
Member

nodo commented Feb 7, 2017

Yes, it looks like. Filtering only bin/bundle would do the trick, I think.

@junaruga
Copy link
Contributor Author

junaruga commented Feb 8, 2017

@brasmusson @nodo ok, thanks for the information.

Now below situation after this patch junaruga@344d030 .

$ bundle exec rake spec
...
568 examples, 0 failures

$ bundle exec rake cucumber
...
(::) failed steps (::)

expected "No such file or directory @ rb_sysopen - features. You can use `cucumber --init` to get started.\n" to include "No such file or directory - features. You can use `cucumber --init` to get started."
Diff:
@@ -1,2 +1,2 @@
-No such file or directory - features. You can use `cucumber --init` to get started.
+No such file or directory @ rb_sysopen - features. You can use `cucumber --init` to get started.
 (RSpec::Expectations::ExpectationNotMetError)
features/docs/getting_started.feature:10:in `Then it should fail with:'

Failing Scenarios:
cucumber features/docs/getting_started.feature:7 # Scenario: Run Cucumber in an empty directory

207 scenarios (1 failed, 206 passed)
1217 steps (1 failed, 1216 passed)

This is same with #1071

Now checking the solution.

@junaruga junaruga mentioned this pull request Feb 8, 2017
5 tasks
@junaruga
Copy link
Contributor Author

junaruga commented Feb 8, 2017

@nodo I sent PR #1077 to fix above tests.

@nodo
Copy link
Member

nodo commented Feb 10, 2017

@junaruga great! Please ,can you update the PR to use json-1.8.6?

@junaruga
Copy link
Contributor Author

junaruga commented Feb 10, 2017

@nodo

@junaruga great! Please ,can you update the PR to use json-1.8.6?

What do you mean? I am using json-1.8.6.

  • json (1.8.6)

Could you explain how do you want to update it more detail?

Did you see this past comment of mine?
#1069 (comment)

@junaruga junaruga force-pushed the feature/fix-bundle-install-error-on-ruby2.4 branch from 1daf131 to 2993818 Compare February 10, 2017 19:03
@junaruga
Copy link
Contributor Author

@nodo I updated (did rebase) my PR to indicate using json-1.8.6 expressly.

@nodo nodo merged commit 8870cd3 into cucumber:master Feb 11, 2017
@nodo
Copy link
Member

nodo commented Feb 11, 2017

Sorry for the late reply, thanks for your help @junaruga 👍

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants