From 50af768213b852ddd3efdf7b9af3142624da958d Mon Sep 17 00:00:00 2001 From: Nick Van Doorn Date: Tue, 30 Apr 2024 13:22:32 -0700 Subject: [PATCH 1/3] Update Docker image to `bookworm` The `buster` image is quite old and creates some challenges on newer ARM based Mac's, so we update to `bookworm`. To put this into context, this takes us from a Debian release in Sept 2019 to June 2023. Co-authored-by: An Stewart Co-authored-by: Chris Todorov Co-authored-by: Alberto Vena Co-authored-by: Thomas von Deyen --- .dockerdev/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.dockerdev/Dockerfile b/.dockerdev/Dockerfile index b91016d9fb0..c365159754c 100644 --- a/.dockerdev/Dockerfile +++ b/.dockerdev/Dockerfile @@ -1,5 +1,5 @@ ARG RUBY_VERSION -FROM ruby:$RUBY_VERSION-slim-buster +FROM ruby:$RUBY_VERSION-slim-bookworm ARG PG_VERSION ARG MYSQL_VERSION @@ -14,6 +14,7 @@ RUN apt-get update -qq \ git \ imagemagick \ libvips \ + libffi-dev \ libmariadb-dev \ sqlite3 \ libsqlite3-dev \ @@ -22,10 +23,10 @@ RUN apt-get update -qq \ && rm -rf /var/cache/apt/lists/* RUN curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ - && echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' $PG_VERSION > /etc/apt/sources.list.d/pgdg.list + && echo 'deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main' $PG_VERSION > /etc/apt/sources.list.d/pgdg.list -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467b942d3a79bd29 \ - && echo "deb http://repo.mysql.com/apt/debian/ buster mysql-"$MYSQL_VERSION > /etc/apt/sources.list.d/mysql.list +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B7B3B788A8D3785C \ + && echo "deb http://repo.mysql.com/apt/debian/ bookworm mysql-"$MYSQL_VERSION > /etc/apt/sources.list.d/mysql.list RUN curl -sSL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - From df0d5befd3180f1a235dea411318092607db5a08 Mon Sep 17 00:00:00 2001 From: Nick Van Doorn Date: Wed, 1 May 2024 14:55:21 -0700 Subject: [PATCH 2/3] Remove `webdrivers` gem This gem has gone end-of-life and we're using a version of Selenium that supports Selenium manager, so there is no reason to keep this gem around. Read more here: https://github.com/titusfortner/webdrivers/blob/44d4c1ae865d0acd30613313b8c67a16711249ac/README.md#update-future-of-this-project Co-authored-by: An Stewart --- Gemfile | 1 - admin/spec/spec_helper.rb | 1 - backend/spec/spec_helper.rb | 1 - backend/spec/teaspoon_env.rb | 1 - 4 files changed, 4 deletions(-) diff --git a/Gemfile b/Gemfile index e22ffa36df0..0b9b891c0a8 100644 --- a/Gemfile +++ b/Gemfile @@ -42,7 +42,6 @@ group :backend do gem 'capybara', '~> 3.13', require: false gem 'capybara-screenshot', '>= 1.0.18', require: false gem 'selenium-webdriver', require: false - gem 'webdrivers', require: false # JavaScript testing gem 'teaspoon', require: false diff --git a/admin/spec/spec_helper.rb b/admin/spec/spec_helper.rb index a68db70acc9..8661c296e3a 100644 --- a/admin/spec/spec_helper.rb +++ b/admin/spec/spec_helper.rb @@ -44,7 +44,6 @@ require "capybara/rspec" require 'capybara-screenshot/rspec' require "selenium/webdriver" -require 'webdrivers' Capybara.save_path = ENV['CIRCLE_ARTIFACTS'] if ENV['CIRCLE_ARTIFACTS'] Capybara.exact = true Capybara.disable_animation = true diff --git a/backend/spec/spec_helper.rb b/backend/spec/spec_helper.rb index 8e8efa43802..ccbf8761aa4 100644 --- a/backend/spec/spec_helper.rb +++ b/backend/spec/spec_helper.rb @@ -52,7 +52,6 @@ Capybara.exact = true require "selenium/webdriver" -require 'webdrivers' Capybara.register_driver :selenium_chrome_headless do |app| browser_options = ::Selenium::WebDriver::Chrome::Options.new diff --git a/backend/spec/teaspoon_env.rb b/backend/spec/teaspoon_env.rb index 9b36bc0e3fe..86f8b204256 100644 --- a/backend/spec/teaspoon_env.rb +++ b/backend/spec/teaspoon_env.rb @@ -13,7 +13,6 @@ ENV['RAILS_ENV'] = 'test' require 'teaspoon/driver/selenium' -require 'webdrivers' # Similar to setup described in # https://github.com/jejacks0n/teaspoon/wiki/Micro-Applications From 1f6b1079edfe04f1576395c9eef8a685aee22fb5 Mon Sep 17 00:00:00 2001 From: Nick Van Doorn Date: Wed, 1 May 2024 14:57:32 -0700 Subject: [PATCH 3/3] Increase shared memory size for feature specs Prior to increasing the shared memory size or `shm_size`, we received errors trying to run feature specs due to lack of memory. Co-authored-by: An Stewart --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 279c78b876d..a94ee665dc3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,6 +18,7 @@ services: - postgres:/var/lib/postgresql/data:cached app: + shm_size: '256mb' build: context: .dockerdev dockerfile: Dockerfile