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

ArgumentError: wrong first argument on rails webdrivers:chromedriver:update #144

Closed
alexanderadam opened this issue Jul 11, 2019 · 11 comments · Fixed by #146
Closed

ArgumentError: wrong first argument on rails webdrivers:chromedriver:update #144

alexanderadam opened this issue Jul 11, 2019 · 11 comments · Fixed by #146

Comments

@alexanderadam
Copy link

alexanderadam commented Jul 11, 2019

Summary

rails webdrivers:chromedriver:update results in error ArgumentError: wrong first argument.

Debug Info

Using webdrivers 4.1.0

$ RAILS_ENV=test bundle exec rails webdrivers:chromedriver:update

rails aborted!
ArgumentError: wrong first argument
/builds/some/app/vendor/ruby/2.5.0/gems/webdrivers-4.1.0/lib/webdrivers/system.rb:150:in `popen'
/builds/some/app/vendor/ruby/2.5.0/gems/webdrivers-4.1.0/lib/webdrivers/system.rb:150:in `call'
/builds/some/app/vendor/ruby/2.5.0/gems/webdrivers-4.1.0/lib/webdrivers/chrome_finder.rb:79:in `linux_version'
/builds/some/app/vendor/ruby/2.5.0/gems/webdrivers-4.1.0/lib/webdrivers/chrome_finder.rb:10:in `version'
/builds/some/app/vendor/ruby/2.5.0/gems/webdrivers-4.1.0/lib/webdrivers/chromedriver.rb:46:in `browser_version'
/builds/some/app/vendor/ruby/2.5.0/gems/webdrivers-4.1.0/lib/webdrivers/chromedriver.rb:106:in `release_version'
/builds/some/app/vendor/ruby/2.5.0/gems/webdrivers-4.1.0/lib/webdrivers/chromedriver.rb:32:in `latest_version'
/builds/some/app/vendor/ruby/2.5.0/gems/webdrivers-4.1.0/lib/webdrivers/common.rb:133:in `correct_binary?'
/builds/some/app/vendor/ruby/2.5.0/gems/webdrivers-4.1.0/lib/webdrivers/common.rb:89:in `update'
/builds/some/app/vendor/ruby/2.5.0/gems/webdrivers-4.1.0/lib/webdrivers/tasks/chromedriver.rake:23:in `block (3 levels) in <top (required)>'
/builds/some/app/vendor/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/builds/some/app/vendor/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/builds/some/app/vendor/ruby/2.5.0/gems/railties-5.2.3/lib/rails/command.rb:48:in `invoke'
/builds/some/app/vendor/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => webdrivers:chromedriver:update
(See full trace by running task with --trace)

Expected Behaviour

No exception should appear

Actual Behaviour

See above.

@twalpole
Copy link
Collaborator

Webdrivers queries your system for the version of Chrome installed on it and then downloads the matching version of chromedriver. If you don't have Chrome installed it won't work, which I assume is the case here since you say it should be connecting to a remote Chrome. For webdrivers to do anything here you'll need to specify the version of chromedriver you want it to get in the rake call as shown in the README

@twalpole
Copy link
Collaborator

twalpole commented Jul 11, 2019

@kapoorlakshya Assuming my guess as to the cause is correct, we should probably better error messages around not being able to find the browsers on the local system.

@kapoorlakshya
Copy link
Collaborator

kapoorlakshya commented Jul 11, 2019

@twalpole I think this was properly handled before we switched to IO.popen. Earlier nil (or an empty string from powershell) was returned if the binary was not found:

raise VersionError, 'Failed to find Chrome binary or its version.' if version.nil? || version.empty?

but now popen raises an error.

I'll try to fix it and add a unit test this week.

@kapoorlakshya
Copy link
Collaborator

@alexanderadam I have fixed this and released v4.1.1.

@nicolasmlv
Copy link

I have still the error, it was working on both Heroku CI and Circle CI, but when I update : rails from 6.0.0.rc1 to 6.0.0.rc2 and webdrivers from 4.1.0 to 4.1.1, then there is two similar errors :

Heroku error ``` -----> Running test command `bundle exec rails test && jest`... /app/vendor/bundle/ruby/2.6.0/gems/webdrivers-4.1.1/lib/webdrivers/system.rb:150:in `popen': wrong first argument (ArgumentError) from /app/vendor/bundle/ruby/2.6.0/gems/webdrivers-4.1.1/lib/webdrivers/system.rb:150:in `call' from /app/vendor/bundle/ruby/2.6.0/gems/webdrivers-4.1.1/lib/webdrivers/chrome_finder.rb:81:in `linux_version' from /app/vendor/bundle/ruby/2.6.0/gems/webdrivers-4.1.1/lib/webdrivers/chrome_finder.rb:10:in `version' from /app/vendor/bundle/ruby/2.6.0/gems/webdrivers-4.1.1/lib/webdrivers/chromedriver.rb:46:in `browser_version' from /app/vendor/bundle/ruby/2.6.0/gems/webdrivers-4.1.1/lib/webdrivers/chromedriver.rb:106:in `release_version' from /app/vendor/bundle/ruby/2.6.0/gems/webdrivers-4.1.1/lib/webdrivers/chromedriver.rb:32:in `latest_version' from /app/vendor/bundle/ruby/2.6.0/gems/webdrivers-4.1.1/lib/webdrivers/common.rb:136:in `correct_binary?' from /app/vendor/bundle/ruby/2.6.0/gems/webdrivers-4.1.1/lib/webdrivers/common.rb:92:in `update' from /app/vendor/bundle/ruby/2.6.0/gems/webdrivers-4.1.1/lib/webdrivers/chromedriver.rb:119:in `block in ' from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.0.rc2/lib/active_support/core_ext/object/try.rb:15:in `public_send' from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.0.rc2/lib/active_support/core_ext/object/try.rb:15:in `try' from /app/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_testing/browser.rb:50:in `preload' from /app/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_testing/driver.rb:13:in `initialize' from /app/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_test_case.rb:159:in `new' from /app/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_test_case.rb:159:in `driven_by' from /app/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_test_case.rb:162:in `' from /app/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_test_case.rb:114:in `' from /app/vendor/bundle/ruby/2.6.0/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_test_case.rb:16:in `' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `block in require' from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:288:in `load_dependency' from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `require' from /app/test/test_helper.rb:39:in `' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `block in require' from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:288:in `load_dependency' from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `require' from /app/test/controllers/admin/communautes_controller_test.rb:1:in `' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `block in require' from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:288:in `load_dependency' from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `require' from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.0.rc2/lib/rails/test_unit/runner.rb:50:in `block in load_tests' from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.0.rc2/lib/rails/test_unit/runner.rb:50:in `each' from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.0.rc2/lib/rails/test_unit/runner.rb:50:in `load_tests' from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.0.rc2/lib/rails/test_unit/runner.rb:39:in `run' from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.0.rc2/lib/rails/commands/test/test_command.rb:33:in `perform' from /app/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run' from /app/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command' from /app/vendor/bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch' from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.0.rc2/lib/rails/command/base.rb:65:in `perform' from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.0.rc2/lib/rails/command.rb:46:in `invoke' from /app/vendor/bundle/ruby/2.6.0/gems/railties-6.0.0.rc2/lib/rails/commands.rb:18:in `' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' from /app/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `block in require' from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:288:in `load_dependency' from /app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `require' from bin/rails:4:in `' ```
Circle CI error ``` bundle exec rake test rake aborted! ArgumentError: wrong first argument /home/circleci/project/vendor/bundle/gems/webdrivers-4.1.1/lib/webdrivers/system.rb:150:in `popen' /home/circleci/project/vendor/bundle/gems/webdrivers-4.1.1/lib/webdrivers/system.rb:150:in `call' /home/circleci/project/vendor/bundle/gems/webdrivers-4.1.1/lib/webdrivers/chrome_finder.rb:81:in `linux_version' /home/circleci/project/vendor/bundle/gems/webdrivers-4.1.1/lib/webdrivers/chrome_finder.rb:10:in `version' /home/circleci/project/vendor/bundle/gems/webdrivers-4.1.1/lib/webdrivers/chromedriver.rb:46:in `browser_version' /home/circleci/project/vendor/bundle/gems/webdrivers-4.1.1/lib/webdrivers/chromedriver.rb:106:in `release_version' /home/circleci/project/vendor/bundle/gems/webdrivers-4.1.1/lib/webdrivers/chromedriver.rb:32:in `latest_version' /home/circleci/project/vendor/bundle/gems/webdrivers-4.1.1/lib/webdrivers/common.rb:136:in `correct_binary?' /home/circleci/project/vendor/bundle/gems/webdrivers-4.1.1/lib/webdrivers/common.rb:92:in `update' /home/circleci/project/vendor/bundle/gems/webdrivers-4.1.1/lib/webdrivers/chromedriver.rb:119:in `block in ' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/core_ext/object/try.rb:15:in `public_send' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/core_ext/object/try.rb:15:in `try' /home/circleci/project/vendor/bundle/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_testing/browser.rb:50:in `preload' /home/circleci/project/vendor/bundle/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_testing/driver.rb:13:in `initialize' /home/circleci/project/vendor/bundle/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_test_case.rb:159:in `new' /home/circleci/project/vendor/bundle/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_test_case.rb:159:in `driven_by' /home/circleci/project/vendor/bundle/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_test_case.rb:162:in `' /home/circleci/project/vendor/bundle/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_test_case.rb:114:in `' /home/circleci/project/vendor/bundle/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_test_case.rb:16:in `' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `block in require' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:288:in `load_dependency' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `require' /home/circleci/project/test/test_helper.rb:39:in `' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `block in require' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:288:in `load_dependency' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `require' /home/circleci/project/test/controllers/admin/communautes_controller_test.rb:1:in `' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `block in require' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:288:in `load_dependency' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `require' /home/circleci/project/vendor/bundle/gems/railties-6.0.0.rc2/lib/rails/test_unit/runner.rb:50:in `block in load_tests' /home/circleci/project/vendor/bundle/gems/railties-6.0.0.rc2/lib/rails/test_unit/runner.rb:50:in `each' /home/circleci/project/vendor/bundle/gems/railties-6.0.0.rc2/lib/rails/test_unit/runner.rb:50:in `load_tests' /home/circleci/project/vendor/bundle/gems/railties-6.0.0.rc2/lib/rails/test_unit/runner.rb:39:in `run' /home/circleci/project/vendor/bundle/gems/railties-6.0.0.rc2/lib/rails/test_unit/runner.rb:35:in `rake_run' /home/circleci/project/vendor/bundle/gems/railties-6.0.0.rc2/lib/rails/test_unit/testing.rake:16:in `block in ' /home/circleci/project/vendor/bundle/gems/rake-12.3.3/exe/rake:27:in `' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start' /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:30:in `block in ' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors' /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:22:in `' /usr/local/bundle/bin/bundle:23:in `load' /usr/local/bundle/bin/bundle:23:in `' Tasks: TOP => test (See full trace by running task with --trace) Exited with code 1 ```

@Galilea-LM
Copy link

I have the similar error, I performed a migration of Rails 5.2 to 6.0.0.rc2 and the CI thunders when running the system tests

ArgumentError: wrong first argument
/usr/local/bundle/gems/webdrivers-4.1.1/lib/webdrivers/system.rb:150:in `popen'
/usr/local/bundle/gems/webdrivers-4.1.1/lib/webdrivers/system.rb:150:in `call'
/usr/local/bundle/gems/webdrivers-4.1.1/lib/webdrivers/chrome_finder.rb:81:in `linux_version'
/usr/local/bundle/gems/webdrivers-4.1.1/lib/webdrivers/chrome_finder.rb:10:in `version'
/usr/local/bundle/gems/webdrivers-4.1.1/lib/webdrivers/chromedriver.rb:46:in `browser_version'
/usr/local/bundle/gems/webdrivers-4.1.1/lib/webdrivers/chromedriver.rb:106:in `release_version'
/usr/local/bundle/gems/webdrivers-4.1.1/lib/webdrivers/chromedriver.rb:32:in `latest_version'
/usr/local/bundle/gems/webdrivers-4.1.1/lib/webdrivers/common.rb:136:in `correct_binary?'
/usr/local/bundle/gems/webdrivers-4.1.1/lib/webdrivers/common.rb:92:in `update'
/usr/local/bundle/gems/webdrivers-4.1.1/lib/webdrivers/chromedriver.rb:119:in `block in <top (required)>'
...
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => test:system
(See full trace by running task with --trace) ```

@kapoorlakshya
Copy link
Collaborator

kapoorlakshya commented Jul 24, 2019

@nicolasmlv @Galilea-LM - Thanks for reporting this. Looks like I had accidentally reverted a change during the final push in #146. I've re-added the fix for this (210d5dc) and also added Heroku specific Chrome locations to have webdirvers find the bin or shim from the buildpack (ad2d90d).

To confirm that this works perfectly, could either of you please load this gem from the master branch of this repo and test the fix? I would highly appreciate it.

# In Gemfile

gem 'webdirvers', git: 'https://github.com/titusfortner/webdrivers.git'

I'll prepare a release once this is completely resolved.

@3v0k4
Copy link

3v0k4 commented Jul 25, 2019

@kapoorlakshya I can confirm it works for me on Heroku CI. Thanks!!

Gemfile

gem 'rails', '~> 6.0.0.rc1'
gem 'webdrivers', git: 'https://github.com/titusfortner/webdrivers.git'

spec/rails_helper.rb

config.before(:each, type: :system, js: true) do
  driven_by :selenium_chrome_headless
end

app.json

{
  "environments": {
    "test": {
      "scripts": {
        "test-setup": "yarn && RAILS_ENV=test bin/rails webpacker:compile",
        "test": "bin/rails test && bin/rspec spec"
      },
      "buildpacks": [
        { "url": "heroku/ruby" },
        { "url": "heroku/nodejs" },
        { "url": "https://github.com/heroku/heroku-buildpack-google-chrome" }
      ],
      "addons": ["heroku-postgresql:in-dyno"]
    }
  }
}

@nicolasmlv
Copy link

Yes I confirm it works on Heroku CI thanks !!!! and for gem 'rails', '~> 6.0.0.rc2'

but there is still the bug in Circle CI

same bug ``` #!/bin/bash -eo pipefail bundle exec rake test rake aborted! Webdrivers::BrowserNotFound: Failed to find Chrome binary. /home/circleci/project/vendor/bundle/bundler/gems/webdrivers-ad2d90d22cca/lib/webdrivers/chrome_finder.rb:21:in `location' /home/circleci/project/vendor/bundle/bundler/gems/webdrivers-ad2d90d22cca/lib/webdrivers/chrome_finder.rb:10:in `version' /home/circleci/project/vendor/bundle/bundler/gems/webdrivers-ad2d90d22cca/lib/webdrivers/chromedriver.rb:46:in `browser_version' /home/circleci/project/vendor/bundle/bundler/gems/webdrivers-ad2d90d22cca/lib/webdrivers/chromedriver.rb:106:in `release_version' /home/circleci/project/vendor/bundle/bundler/gems/webdrivers-ad2d90d22cca/lib/webdrivers/chromedriver.rb:32:in `latest_version' /home/circleci/project/vendor/bundle/bundler/gems/webdrivers-ad2d90d22cca/lib/webdrivers/common.rb:136:in `correct_binary?' /home/circleci/project/vendor/bundle/bundler/gems/webdrivers-ad2d90d22cca/lib/webdrivers/common.rb:92:in `update' /home/circleci/project/vendor/bundle/bundler/gems/webdrivers-ad2d90d22cca/lib/webdrivers/chromedriver.rb:119:in `block in ' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/core_ext/object/try.rb:15:in `public_send' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/core_ext/object/try.rb:15:in `try' /home/circleci/project/vendor/bundle/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_testing/browser.rb:50:in `preload' /home/circleci/project/vendor/bundle/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_testing/driver.rb:13:in `initialize' /home/circleci/project/vendor/bundle/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_test_case.rb:159:in `new' /home/circleci/project/vendor/bundle/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_test_case.rb:159:in `driven_by' /home/circleci/project/vendor/bundle/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_test_case.rb:162:in `' /home/circleci/project/vendor/bundle/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_test_case.rb:114:in `' /home/circleci/project/vendor/bundle/gems/actionpack-6.0.0.rc2/lib/action_dispatch/system_test_case.rb:16:in `' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `block in require' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:288:in `load_dependency' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `require' /home/circleci/project/test/test_helper.rb:39:in `' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `block in require' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:288:in `load_dependency' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `require' /home/circleci/project/test/controllers/admin/communautes_controller_test.rb:1:in `' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi' /home/circleci/project/vendor/bundle/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `block in require' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:288:in `load_dependency' /home/circleci/project/vendor/bundle/gems/activesupport-6.0.0.rc2/lib/active_support/dependencies.rb:322:in `require' /home/circleci/project/vendor/bundle/gems/railties-6.0.0.rc2/lib/rails/test_unit/runner.rb:50:in `block in load_tests' /home/circleci/project/vendor/bundle/gems/railties-6.0.0.rc2/lib/rails/test_unit/runner.rb:50:in `each' /home/circleci/project/vendor/bundle/gems/railties-6.0.0.rc2/lib/rails/test_unit/runner.rb:50:in `load_tests' /home/circleci/project/vendor/bundle/gems/railties-6.0.0.rc2/lib/rails/test_unit/runner.rb:39:in `run' /home/circleci/project/vendor/bundle/gems/railties-6.0.0.rc2/lib/rails/test_unit/runner.rb:35:in `rake_run' /home/circleci/project/vendor/bundle/gems/railties-6.0.0.rc2/lib/rails/test_unit/testing.rake:16:in `block in ' /home/circleci/project/vendor/bundle/gems/rake-12.3.3/exe/rake:27:in `' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start' /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:30:in `block in ' /usr/local/bundle/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors' /usr/local/bundle/gems/bundler-2.0.2/exe/bundle:22:in `' /usr/local/bundle/bin/bundle:23:in `load' /usr/local/bundle/bin/bundle:23:in `' Tasks: TOP => test (See full trace by running task with --trace) Coverage report generated for MiniTest to /home/circleci/project/coverage. 227 / 16462 LOC (1.38%) covered. SimpleCov failed with exit 1Exited with code 1 ```

But it is ok for us as we are going to remove Circle CI in favor of Heroku CI...

@flipsasser
Copy link

@kapoorlakshya this fixed the same issue for me as well - thank you!

@kapoorlakshya
Copy link
Collaborator

⚠️ Please Note ⚠️

We (@titusfortner, @twalpole, and I) have decided to revert the addition of Heroku buildpack specific binary and shim locations from the gem (added by this commit: ad2d90d). We want to avoid having custom code for Heroku and also avoid future requests for support for other services, like Circle CI.

Please follow the instructions in this wiki to make this work on Heroku.

shimbaco added a commit to annict/annict that referenced this issue Oct 5, 2019
shimbaco added a commit to annict/annict that referenced this issue Oct 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants