From db845a6c3712565a57a632e9286dc2f998165e9a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 17:03:16 +0000 Subject: [PATCH 01/10] chore(deps-dev): Bump rexml from 3.3.5 to 3.3.9 Bumps [rexml](https://github.com/ruby/rexml) from 3.3.5 to 3.3.9. - [Release notes](https://github.com/ruby/rexml/releases) - [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md) - [Commits](https://github.com/ruby/rexml/compare/v3.3.5...v3.3.9) --- updated-dependencies: - dependency-name: rexml dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ee713699..4df79934 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -205,8 +205,7 @@ GEM rdoc (6.6.3.1) psych (>= 4.0.0) regexp_parser (2.9.2) - rexml (3.3.5) - strscan + rexml (3.3.9) rspec-collection_matchers (1.2.1) rspec-expectations (>= 2.99.0.beta1) rspec-core (3.5.4) @@ -283,7 +282,6 @@ GEM activesupport (>= 6.1) sprockets (>= 3.0.0) stringio (3.1.0) - strscan (3.1.0) thor (1.3.1) tilt (2.0.11) timecop (0.9.10) From 162a3913acf45d5d981fcdd567e1f8579126bb24 Mon Sep 17 00:00:00 2001 From: yoldas Date: Thu, 21 Nov 2024 18:21:20 +0000 Subject: [PATCH 02/10] Add chrome driver options --- spec/spec_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 54a5fafe..7ebee86e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -34,10 +34,11 @@ Capybara.register_driver :headless_chrome do |app| options = Selenium::WebDriver::Chrome::Options.new - options.add_argument('--headless') + options.add_argument('--headless=old') options.add_argument('--disable_gpu') # options.add_argument('--disable-popup-blocking') options.add_argument('--window-size=1600,3200') + options.add_argument('--disable-search-engine-choice-screen') client = Selenium::WebDriver::Remote::Http::Default.new client.read_timeout = 120 # Set the read timeout to 120 seconds From f3c60bf63748458fb1d08eedc8ff6f3ab25cd250 Mon Sep 17 00:00:00 2001 From: yoldas Date: Thu, 21 Nov 2024 18:46:06 +0000 Subject: [PATCH 03/10] Increase wait time --- spec/spec_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7ebee86e..27298c8d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -47,7 +47,7 @@ end Capybara.javascript_driver = :headless_chrome -Capybara.default_max_wait_time = 5 +Capybara.default_max_wait_time = 120 # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| From 460baa613adb44f831f27b95ef5d57510a677608 Mon Sep 17 00:00:00 2001 From: yoldas Date: Thu, 21 Nov 2024 19:25:18 +0000 Subject: [PATCH 04/10] Set higher timeouts --- spec/spec_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 27298c8d..e9874fea 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -41,13 +41,13 @@ options.add_argument('--disable-search-engine-choice-screen') client = Selenium::WebDriver::Remote::Http::Default.new - client.read_timeout = 120 # Set the read timeout to 120 seconds + client.read_timeout = 180 # Set the read timeout to 120 seconds Capybara::Selenium::Driver.new(app, browser: :chrome, options:, http_client: client) end Capybara.javascript_driver = :headless_chrome -Capybara.default_max_wait_time = 120 +Capybara.default_max_wait_time = 180 # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| From 867d3ed68c532858d07730ae244e711e07d5187e Mon Sep 17 00:00:00 2001 From: yoldas Date: Thu, 21 Nov 2024 19:34:01 +0000 Subject: [PATCH 05/10] Set even higher timeouts --- spec/spec_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e9874fea..f375907d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -41,13 +41,13 @@ options.add_argument('--disable-search-engine-choice-screen') client = Selenium::WebDriver::Remote::Http::Default.new - client.read_timeout = 180 # Set the read timeout to 120 seconds + client.read_timeout = 240 # Set the read timeout to 120 seconds Capybara::Selenium::Driver.new(app, browser: :chrome, options:, http_client: client) end Capybara.javascript_driver = :headless_chrome -Capybara.default_max_wait_time = 180 +Capybara.default_max_wait_time = 240 # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| From 17344f3313bf28855b41130404b76c258a56dc83 Mon Sep 17 00:00:00 2001 From: yoldas Date: Thu, 21 Nov 2024 19:43:04 +0000 Subject: [PATCH 06/10] Disable to debug --- .../create_complete_and_report_asset_standard_flow_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/create_complete_and_report_asset_standard_flow_spec.rb b/spec/features/create_complete_and_report_asset_standard_flow_spec.rb index 07728c92..216d2c50 100644 --- a/spec/features/create_complete_and_report_asset_standard_flow_spec.rb +++ b/spec/features/create_complete_and_report_asset_standard_flow_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe 'create complete and report assets within standard flow', :js do +xdescribe 'create complete and report assets within standard flow', :js do let!(:asset_type) { create(:asset_type, name: 'Tube', identifier_type: 'ID') } let!(:workflow_first) { create(:workflow, name: 'Workflow') } let!(:workflow_second) { create(:workflow, name: 'Reportable workflow', reportable: true) } From 350c9c388464a2f71b02af7af5c285b7a25fe5a9 Mon Sep 17 00:00:00 2001 From: yoldas Date: Thu, 21 Nov 2024 19:57:03 +0000 Subject: [PATCH 07/10] Set open timeout --- .../create_complete_and_report_asset_standard_flow_spec.rb | 2 +- spec/spec_helper.rb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/features/create_complete_and_report_asset_standard_flow_spec.rb b/spec/features/create_complete_and_report_asset_standard_flow_spec.rb index 216d2c50..07728c92 100644 --- a/spec/features/create_complete_and_report_asset_standard_flow_spec.rb +++ b/spec/features/create_complete_and_report_asset_standard_flow_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -xdescribe 'create complete and report assets within standard flow', :js do +describe 'create complete and report assets within standard flow', :js do let!(:asset_type) { create(:asset_type, name: 'Tube', identifier_type: 'ID') } let!(:workflow_first) { create(:workflow, name: 'Workflow') } let!(:workflow_second) { create(:workflow, name: 'Reportable workflow', reportable: true) } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f375907d..0ca7e645 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -41,13 +41,14 @@ options.add_argument('--disable-search-engine-choice-screen') client = Selenium::WebDriver::Remote::Http::Default.new - client.read_timeout = 240 # Set the read timeout to 120 seconds + client.open_timeout = 120 + client.read_timeout = 120 Capybara::Selenium::Driver.new(app, browser: :chrome, options:, http_client: client) end Capybara.javascript_driver = :headless_chrome -Capybara.default_max_wait_time = 240 +Capybara.default_max_wait_time = 120 # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| From 7bea16cb7882bab31d47903612ffde3084d942ff Mon Sep 17 00:00:00 2001 From: yoldas Date: Thu, 21 Nov 2024 20:09:04 +0000 Subject: [PATCH 08/10] Remove old gem --- Gemfile | 1 - Gemfile.lock | 4 ---- 2 files changed, 5 deletions(-) diff --git a/Gemfile b/Gemfile index c04f1a8c..29b5c184 100644 --- a/Gemfile +++ b/Gemfile @@ -58,7 +58,6 @@ end group :test do gem 'capybara' - gem 'capybara-selenium' gem 'database_cleaner' gem 'factory_bot' gem 'launchy' diff --git a/Gemfile.lock b/Gemfile.lock index 4df79934..1dee97c7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -86,9 +86,6 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - capybara-selenium (0.0.6) - capybara - selenium-webdriver childprocess (5.0.0) coderay (1.1.3) concurrent-ruby (1.3.3) @@ -313,7 +310,6 @@ PLATFORMS DEPENDENCIES bootstrap-sass (= 3.4.1) capybara - capybara-selenium database_cleaner exception_notification factory_bot From e6b3e4e5860a74b6be90c49f20f0f58c901cb485 Mon Sep 17 00:00:00 2001 From: yoldas Date: Thu, 21 Nov 2024 20:32:14 +0000 Subject: [PATCH 09/10] Update chrome options --- Gemfile | 3 ++- Gemfile.lock | 6 +++++- spec/spec_helper.rb | 14 ++------------ 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/Gemfile b/Gemfile index 29b5c184..78d44a0b 100644 --- a/Gemfile +++ b/Gemfile @@ -58,12 +58,13 @@ end group :test do gem 'capybara' + gem 'capybara-selenium' gem 'database_cleaner' gem 'factory_bot' gem 'launchy' gem 'rspec-collection_matchers' gem 'rspec-rails' - gem 'selenium-webdriver', require: false + gem 'selenium-webdriver', '~> 4.1', require: false gem 'simplecov', require: false gem 'timecop' end diff --git a/Gemfile.lock b/Gemfile.lock index 1dee97c7..36a65934 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -86,6 +86,9 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) + capybara-selenium (0.0.6) + capybara + selenium-webdriver childprocess (5.0.0) coderay (1.1.3) concurrent-ruby (1.3.3) @@ -310,6 +313,7 @@ PLATFORMS DEPENDENCIES bootstrap-sass (= 3.4.1) capybara + capybara-selenium database_cleaner exception_notification factory_bot @@ -332,7 +336,7 @@ DEPENDENCIES rubocop-rspec sass-rails (~> 6.0) sdoc (~> 2.4.0) - selenium-webdriver + selenium-webdriver (~> 4.1) simplecov spring timecop diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0ca7e645..4502b0e9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -25,26 +25,16 @@ require 'selenium/webdriver' Capybara.register_driver :chrome do |app| - client = Selenium::WebDriver::Remote::Http::Default.new - client.read_timeout = 120 # Set the read timeout to 120 seconds - - Capybara::Selenium::Driver.new(app, browser: :chrome, http_client: client) + Capybara::Selenium::Driver.new(app, browser: :chrome) end Capybara.register_driver :headless_chrome do |app| options = Selenium::WebDriver::Chrome::Options.new - options.add_argument('--headless=old') options.add_argument('--disable_gpu') - # options.add_argument('--disable-popup-blocking') options.add_argument('--window-size=1600,3200') options.add_argument('--disable-search-engine-choice-screen') - - client = Selenium::WebDriver::Remote::Http::Default.new - client.open_timeout = 120 - client.read_timeout = 120 - - Capybara::Selenium::Driver.new(app, browser: :chrome, options:, http_client: client) + Capybara::Selenium::Driver.new(app, browser: :chrome, options:) end Capybara.javascript_driver = :headless_chrome From 26bdd907b3d82cc4c6c1b00ee3c0caaf0df22981 Mon Sep 17 00:00:00 2001 From: yoldas Date: Thu, 21 Nov 2024 20:35:11 +0000 Subject: [PATCH 10/10] disable display environment variable --- .github/workflows/ruby_ci.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ruby_ci.yml b/.github/workflows/ruby_ci.yml index 5cb206d1..ddfff4e0 100644 --- a/.github/workflows/ruby_ci.yml +++ b/.github/workflows/ruby_ci.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest env: TZ: Europe/London - DISPLAY: ':99.0' + #DISPLAY: ':99.0' # Services # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idservices services: @@ -17,11 +17,11 @@ jobs: # Use the Mysql docker image https://hub.docker.com/_/mysql image: mysql:8.0 ports: - - 3306:3306 # Default port mappings - # Monitor the health of the container to mesaure when it is ready + - 3306:3306 # Default port mappings + # Monitor the health of the container to mesaure when it is ready options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 env: - MYSQL_ROOT_PASSWORD: '' # Set root PW to nothing + MYSQL_ROOT_PASSWORD: "" # Set root PW to nothing MYSQL_ALLOW_EMPTY_PASSWORD: yes steps: @@ -29,17 +29,18 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - bundler-cache: true # Runs bundle install and caches gems. See the ruby_test.yml - # example if you need more control over bundler. + bundler-cache: + true # Runs bundle install and caches gems. See the ruby_test.yml + # example if you need more control over bundler. - name: Setup database run: bundle exec rake db:setup - name: Test & publish code coverage uses: paambaati/codeclimate-action@v8.0.0 env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID || '5e399530a457db7a41cd5785ce0536b79e9022b3c2d4382f101310b3b166eb38' }} + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID || '5e399530a457db7a41cd5785ce0536b79e9022b3c2d4382f101310b3b166eb38' }} with: coverageCommand: bundle exec rspec - + lint: runs-on: ubuntu-latest steps: @@ -47,7 +48,8 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - bundler-cache: true # Runs bundle install and caches gems. See the ruby_test.yml - # example if you need more control over bundler. + bundler-cache: + true # Runs bundle install and caches gems. See the ruby_test.yml + # example if you need more control over bundler. - name: Lint run: bundle exec rubocop