cucumber / aruba

Test command-line applications with Cucumber-Ruby, RSpec or Minitest.
MIT License
948 stars 163 forks source link

Cannot load aruba/in_process and aruba/spawn_process #630

Closed jasnow closed 5 years ago

jasnow commented 5 years ago
  1. @jasnow: Getting this error for rake on one of my repos after upgrading to alpha.4:

    cannot load such file -- aruba/in_process (LoadError)

    Run fine on current aruba gem release.

  2. @mvz: Hm .. that file is deprecated in the current release. Are you using the InProcess runner or just requiring that file somewhere?

  3. @jasnow: "in_process" still works (no error or message) in gem release 0.14.9.

  4. @mvz: That means you're not actually using the InProcess class defined there. I indeed noticed that requiring that file in 0.14.9 won't print a deprecation message, whereas instantiating Aruba::InProcess will. It probably should complain when required, but for using the alpha.4 release, you can just remove the require.

To help me find out where we need to improve deprecation messaging, do you know why you added a require for this particular file?

  1. Steps to reproduce: a. Clone my repo: https://github.com/jasnow/advice-grabber a. Add 1.0.0.pre.alpha to aruba gem in advice.gemspec. a. Run bundle then rake and you get:
    /Users/USER/.rvm/rubies/ruby-2.6.3/bin/ruby -S bundle exec cucumber features --format pretty
    cannot load such file -- aruba/in_process (LoadError)
    /Users/USER/Projects/advice-grabber/features/support/env.rb:5:in `require'
    /Users/USER/Projects/advice-grabber/features/support/env.rb:5:in `<top (required)>'
    /Users/USER/.rvm/gems/ruby-2.6.3@ruby2.6-no-rails/gems/cucumber-3.1.2/lib/cucumber/glue/registry_and_more.rb:107:in `load'
    /Users/USER/.rvm/gems/ruby-2.6.3@ruby2.6-no-rails/gems/cucumber-3.1.2/lib/cucumber/glue/registry_and_more.rb:107:in `load_code_file'
    /Users/USER/.rvm/gems/ruby-2.6.3@ruby2.6-no-rails/gems/cucumber-3.1.2/lib/cucumber/runtime/support_code.rb:144:in `load_file'
    /Users/USER/.rvm/gems/ruby-2.6.3@ruby2.6-no-rails/gems/cucumber-3.1.2/lib/cucumber/runtime/support_code.rb:85:in `block in load_files!'
    /Users/USER/.rvm/gems/ruby-2.6.3@ruby2.6-no-rails/gems/cucumber-3.1.2/lib/cucumber/runtime/support_code.rb:84:in `each'
    /Users/USER/.rvm/gems/ruby-2.6.3@ruby2.6-no-rails/gems/cucumber-3.1.2/lib/cucumber/runtime/support_code.rb:84:in `load_files!'
    /Users/USER/.rvm/gems/ruby-2.6.3@ruby2.6-no-rails/gems/cucumber-3.1.2/lib/cucumber/runtime.rb:272:in `load_step_definitions'
    /Users/USER/.rvm/gems/ruby-2.6.3@ruby2.6-no-rails/gems/cucumber-3.1.2/lib/cucumber/runtime.rb:68:in `run!'
    /Users/USER/.rvm/gems/ruby-2.6.3@ruby2.6-no-rails/gems/cucumber-3.1.2/lib/cucumber/cli/main.rb:34:in `execute!'
    /Users/USER/.rvm/gems/ruby-2.6.3@ruby2.6-no-rails/gems/cucumber-3.1.2/bin/cucumber:9:in `<top (required)>'
    /Users/USER/.rvm/gems/ruby-2.6.3@ruby2.6-no-rails/bin/cucumber:23:in `load'
    /Users/USER/.rvm/gems/ruby-2.6.3@ruby2.6-no-rails/bin/cucumber:23:in `<main>'
    /Users/USER/.rvm/gems/ruby-2.6.3@ruby2.6-no-rails/bin/ruby_executable_hooks:24:in `eval'
    /Users/USER/.rvm/gems/ruby-2.6.3@ruby2.6-no-rails/bin/ruby_executable_hooks:24:in `<main>'
    Coverage report generated for Cucumber Features to /Users/USER/Projects/advice-grabber/coverage. 0 / 19 LOC (0.0%) covered.
  1. So I commented out these two lines in features/support/env.rb file, but still get errors:
    
    #require 'aruba/in_process'
    #require 'aruba/spawn_process
    '``
olleolleolle commented 5 years ago

If you could add the follow-up errors, too, it'd help diagnosing.

<details> is a tag you can use around long listings, if you have many of them and want to keep legibility.

Hope this helps!

olleolleolle commented 5 years ago

The paths seem to have changed:

require 'aruba/spawn_process' => require 'aruba/processes/spawn_process'

There is a documentation warning on this line, about usage of this private API:

https://github.com/cucumber/aruba/blob/master/lib/aruba/processes/spawn_process.rb#L15

mvz commented 5 years ago

I took a look at the offending file, and it looks like those lines were added by Aruba's installer. I'll try to verify this later, but I think we should update these files in 0.14.x to emit deprecation messages when they're required.

jasnow commented 5 years ago

@mvz - OK

mvz commented 5 years ago

The 0.14.10 release will now warn about requiring these files.