guard / guard-rspec

Guard::RSpec automatically run your specs (much like autotest)
https://rubygems.org/gems/guard-rspec
MIT License
1.31k stars 241 forks source link

Error: Guard::RSpecFormatter #405

Open davidalejandroaguilar opened 6 years ago

davidalejandroaguilar commented 6 years ago

Getting this error when running a headless driver (tried on Poltergeistand headless Chrome). Specs run fine but I get the error at the end.

I'm running Windows 10 WSL (Ubuntu).

Any ideas what the cause might be?

/home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/childprocess-0.8.0/lib/childprocess/unix/process.rb:32:in `waitpid2': Invalid argument (Errno::EINVAL)
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/childprocess-0.8.0/lib/childprocess/unix/process.rb:32:in `exited?'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.8.0/lib/selenium/webdriver/common/service.rb:136:in `process_exited?'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.8.0/lib/selenium/webdriver/common/service.rb:121:in `stop_process'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.8.0/lib/selenium/webdriver/common/service.rb:81:in `ensure in stop'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.8.0/lib/selenium/webdriver/common/service.rb:81:in `stop'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.8.0/lib/selenium/webdriver/chrome/driver.rb:57:in `quit'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/capybara-2.17.0/lib/capybara/selenium/driver.rb:268:in `quit'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/capybara-2.17.0/lib/capybara/selenium/driver.rb:31:in `block in browser'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:171:in `fork'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:171:in `serve'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from -e:1:in `<main>'
/home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/childprocess-0.8.0/lib/childprocess/unix/process.rb:32:in `waitpid2': Invalid argument (Errno::EINVAL)
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/childprocess-0.8.0/lib/childprocess/unix/process.rb:32:in `exited?'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.8.0/lib/selenium/webdriver/common/service.rb:136:in `process_exited?'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.8.0/lib/selenium/webdriver/common/service.rb:121:in `stop_process'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.8.0/lib/selenium/webdriver/common/service.rb:81:in `ensure in stop'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.8.0/lib/selenium/webdriver/common/service.rb:81:in `stop'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.8.0/lib/selenium/webdriver/common/service.rb:67:in `block in start'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.8.0/lib/selenium/webdriver/common/platform.rb:136:in `block in exit_hook'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:171:in `fork'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:171:in `serve'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /home/david/.rbenv/versions/2.4.2/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from -e:1:in `<main>'
20:31:48 - ERROR - Failed: "bin/rspec -f progress -r /home/david/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/guard-rspec-4.7.3/lib/guard/rspec_formatter.rb -f Guard::RSpecFormatter --failure-exit-code 2  spec/features/admin/admin_guest_search_spec.rb" (exit code: 1)

Guardfile

guard :rspec, cmd: "bin/rspec" do
  require "guard/rspec/dsl"
  dsl = Guard::RSpec::Dsl.new(self)

  # Feel free to open issues for suggestions and improvements

  # RSpec files
  rspec = dsl.rspec
  watch(rspec.spec_helper) { rspec.spec_dir }
  watch(rspec.spec_support) { rspec.spec_dir }
  watch(rspec.spec_files)

  # Ruby files
  ruby = dsl.ruby
  dsl.watch_spec_files_for(ruby.lib_files)

  # Rails files
  rails = dsl.rails(view_extensions: %w(erb haml slim))
  dsl.watch_spec_files_for(rails.app_files)
  dsl.watch_spec_files_for(rails.views)

  watch(rails.controllers) do |m|
    [
      rspec.spec.call("routing/#{m[1]}_routing"),
      rspec.spec.call("controllers/#{m[1]}_controller"),
      rspec.spec.call("acceptance/#{m[1]}"),
      rspec.spec.call("requests/#{m[1]}"), # Watch requests
      rspec.spec.call("controllers/#{m[1]}") # Watch controllers
    ]
  end

  # Rails config changes
  watch(rails.spec_helper)     { rspec.spec_dir }
  watch(rails.routes)          { "#{rspec.spec_dir}/routing" }
  watch(rails.app_controller)  { "#{rspec.spec_dir}/controllers" }

  # Capybara features specs
  watch(rails.view_dirs)     { |m| rspec.spec.call("features/#{m[1]}") }
  watch(rails.layouts)       { |m| rspec.spec.call("features/#{m[1]}") }

  # Turnip features and steps
  watch(%r{^spec/acceptance/(.+)\.feature$})
  watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
    Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
  end
end

Gemfile

source 'https://rubygems.org'

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end

gem 'haml'
gem 'pg'
gem 'bcrypt'
gem 'sucker_punch'
gem 'bootstrap', '~> 4.0.0.beta3'
gem 'jquery-rails'
gem "bootstrap_form",
    git: "https://github.com/bootstrap-ruby/rails-bootstrap-forms.git",
    branch: "master"
gem 'poltergeist'
gem 'capybara-webkit'

gem 'rails', '~> 5.1.4'
gem 'sqlite3'
gem 'puma', '~> 3.7'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'

group :development, :test do
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  gem 'capybara', '~> 2.13'
  gem 'selenium-webdriver'
  gem 'rspec-rails'
  gem 'fabrication'
  gem 'faker'
end

group :test do
  gem 'shoulda-matchers'
end

group :development do
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
  gem 'guard-rspec'
  gem 'spring-commands-rspec'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]