diff options
author | Matthew Draper <matthew@trebex.net> | 2019-02-06 01:20:06 +1030 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2019-02-06 01:20:06 +1030 |
commit | 287920ca7d06c8f51198ec750d65ba703835b257 (patch) | |
tree | fa38811f965fa873d02bc7df3317583ada076ff1 /ci | |
parent | 44232b485485634d681c60868c619323f882e59f (diff) | |
download | rails-287920ca7d06c8f51198ec750d65ba703835b257.tar.gz rails-287920ca7d06c8f51198ec750d65ba703835b257.tar.bz2 rails-287920ca7d06c8f51198ec750d65ba703835b257.zip |
Respect ENV variables when finding DBs etc for the test suite
If they're not set we'll still fall back to localhost, but this makes it
possible to run the tests against a remote Postgres / Redis / whatever.
Diffstat (limited to 'ci')
-rw-r--r-- | ci/qunit-selenium-runner.rb | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/ci/qunit-selenium-runner.rb b/ci/qunit-selenium-runner.rb index 132b3d17eb..1df6aedb36 100644 --- a/ci/qunit-selenium-runner.rb +++ b/ci/qunit-selenium-runner.rb @@ -1,14 +1,20 @@ # frozen_string_literal: true require "qunit/selenium/test_runner" -require "chromedriver-helper" -driver_options = Selenium::WebDriver::Chrome::Options.new -driver_options.add_argument("--headless") -driver_options.add_argument("--disable-gpu") -driver_options.add_argument("--no-sandbox") +if ARGV[1] + driver = ::Selenium::WebDriver.for(:remote, url: ARGV[1], desired_capabilities: :chrome) +else + require "chromedriver-helper" + + driver_options = Selenium::WebDriver::Chrome::Options.new + driver_options.add_argument("--headless") + driver_options.add_argument("--disable-gpu") + driver_options.add_argument("--no-sandbox") + + driver = ::Selenium::WebDriver.for(:chrome, options: driver_options) +end -driver = ::Selenium::WebDriver.for(:chrome, options: driver_options) result = QUnit::Selenium::TestRunner.new(driver).open(ARGV[0], timeout: 60) driver.quit |