Skip to content

Commit

Permalink
Merge pull request #6168 from samvera/seleniarm
Browse files Browse the repository at this point in the history
switch docker-compose browser engines to multiarch `seleniarm`
  • Loading branch information
tpendragon authored Aug 22, 2023
2 parents 9d06f2b + 44d7e7e commit 9c4110d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
4 changes: 3 additions & 1 deletion docker-compose-koppie.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ services:
- koppie

chrome:
image: selenium/standalone-chrome:3.141
image: seleniarm/standalone-chromium:114.0
environment:
- START_XVFB=false
logging:
driver: none
volumes:
Expand Down
8 changes: 5 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,17 @@ services:
- hyrax

chrome:
image: selenium/standalone-chrome:3.141
image: seleniarm/standalone-chromium:114.0
environment:
- START_XVFB=false
logging:
driver: none
volumes:
- /dev/shm:/dev/shm
shm_size: 2G
ports:
- "4444:4444"
- "5959:5900"
- "4445:4444"
- "5960:5900"
networks:
- hyrax

Expand Down
13 changes: 9 additions & 4 deletions lib/hyrax/specs/capybara.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ def after_teardown
Capybara.save_path = ENV['CI'] ? "/tmp/test-results" : Rails.root.join('tmp', 'capybara')

if ENV['IN_DOCKER'].present? || ENV['HUB_URL'].present?
args = %w[disable-gpu no-sandbox whitelisted-ips window-size=1400,1400]
args.push('headless') if ActiveModel::Type::Boolean.new.cast(ENV['CHROME_HEADLESS_MODE'])

options = Selenium::WebDriver::Options.chrome("goog:chromeOptions" => { args: args })
options = Selenium::WebDriver::Chrome::Options.new.tap do |opts|
opts.add_argument("--headless") if ENV["CHROME_HEADLESS_MODE"]
opts.add_argument("--disable-gpu") if Gem.win_platform?
# Workaround https://bugs.chromium.org/p/chromedriver/issues/detail?id=2650&q=load&sort=-id&colspec=ID%20Status%20Pri%20Owner%20Summary
opts.add_argument("--disable-site-isolation-trials")
opts.add_argument("--window-size=1440,1440")
opts.add_argument("--enable-features=NetworkService,NetworkServiceInProcess")
opts.add_argument("--disable-features=VizDisplayCompositor")
end

Capybara.register_driver :selenium_chrome_headless_sandboxless do |app|
driver = Capybara::Selenium::Driver.new(app,
Expand Down

0 comments on commit 9c4110d

Please sign in to comment.