From d5283d333d26cd1c8234b506e0868ba44eb033fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 10 Aug 2024 12:10:59 +0200 Subject: [PATCH] Bump rails from 7.1.3.4 to 7.2.0 (#615) * Bump rails from 7.1.3.4 to 7.2.0 Bumps [rails](https://github.com/rails/rails) from 7.1.3.4 to 7.2.0. - [Release notes](https://github.com/rails/rails/releases) - [Commits](https://github.com/rails/rails/compare/v7.1.3.4...v7.2.0) --- updated-dependencies: - dependency-name: rails dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update gemset.nix * Perform actual rails update * Fix deprecation warning * Use ActiveJob test adapter in tests * Fix rescan runner model tests --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] Co-authored-by: Charlotte Van Petegem --- .github/workflows/ci.yml | 5 +- Gemfile | 16 ++-- Gemfile.lock | 140 +++++++++++++++--------------- app/models/playlist.rb | 4 +- app/models/track_artist.rb | 2 +- app/models/user.rb | 2 +- config/application.rb | 2 +- config/brakeman.ignore | 29 +++++++ config/environments/test.rb | 3 + config/puma.rb | 49 ++++------- gemset.nix | 105 +++++++++++++--------- test/factories/rescan_runners.rb | 1 + test/models/rescan_runner_test.rb | 10 ++- test/test_helper.rb | 1 + 14 files changed, 212 insertions(+), 157 deletions(-) create mode 100644 config/brakeman.ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da1be024..2e38542e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,4 +47,7 @@ jobs: env: RAILS_ENV: "test" run: | - bundle exec rubocop -c .rubocop.yml + bundle exec rubocop -c .rubocop.yml -f github + - name: Scan with brakeman + run: | + bundle exec brakeman --no-pager diff --git a/Gemfile b/Gemfile index 2de4a71a..2879ddd3 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '~> 3.3.0' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 7.1' +gem 'rails', '~> 7.2' # Use postgresql as the database for Active Record gem 'pg', '>= 1.2.3', '< 2.0' # Use Puma as the app server @@ -48,10 +48,12 @@ group :development, :test do end group :development do - gem 'annotate', '~> 3.2' # Remove workaround in lib/tasks/annotate.rb when https://github.com/ctran/annotate_models/issues/696 is fixed - gem 'rubocop', '~> 1.65' - gem 'rubocop-factory_bot', '~> 2.26' - gem 'rubocop-minitest', '~> 0.35.1' - gem 'rubocop-rails', '~> 2.25' - gem 'ruby-lsp', '~> 0.17.12' + gem 'annotate', '~> 3.2', require: false # Remove workaround in lib/tasks/annotate.rb when https://github.com/ctran/annotate_models/issues/696 is fixed + gem 'rubocop', '~> 1.65', require: false + gem 'rubocop-factory_bot', '~> 2.26', require: false + gem 'rubocop-minitest', '~> 0.35.1', require: false + gem 'rubocop-rails', '~> 2.25', require: false + gem 'ruby-lsp', '~> 0.17.12', require: false + + gem 'brakeman', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 5623353d..6afb2755 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,51 +1,46 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) + actioncable (7.2.0) + actionpack (= 7.2.0) + activesupport (= 7.2.0) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.1.3.4) - actionpack (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activesupport (= 7.1.3.4) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp + actionmailbox (7.2.0) + actionpack (= 7.2.0) + activejob (= 7.2.0) + activerecord (= 7.2.0) + activestorage (= 7.2.0) + activesupport (= 7.2.0) + mail (>= 2.8.0) + actionmailer (7.2.0) + actionpack (= 7.2.0) + actionview (= 7.2.0) + activejob (= 7.2.0) + activesupport (= 7.2.0) + mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.1.3.4) - actionview (= 7.1.3.4) - activesupport (= 7.1.3.4) + actionpack (7.2.0) + actionview (= 7.2.0) + activesupport (= 7.2.0) nokogiri (>= 1.8.5) racc - rack (>= 2.2.4) + rack (>= 2.2.4, < 3.2) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.3.4) - actionpack (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + useragent (~> 0.16) + actiontext (7.2.0) + actionpack (= 7.2.0) + activerecord (= 7.2.0) + activestorage (= 7.2.0) + activesupport (= 7.2.0) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3.4) - activesupport (= 7.1.3.4) + actionview (7.2.0) + activesupport (= 7.2.0) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) @@ -55,31 +50,32 @@ GEM activemodel (>= 4.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (7.1.3.4) - activesupport (= 7.1.3.4) + activejob (7.2.0) + activesupport (= 7.2.0) globalid (>= 0.3.6) - activemodel (7.1.3.4) - activesupport (= 7.1.3.4) - activerecord (7.1.3.4) - activemodel (= 7.1.3.4) - activesupport (= 7.1.3.4) + activemodel (7.2.0) + activesupport (= 7.2.0) + activerecord (7.2.0) + activemodel (= 7.2.0) + activesupport (= 7.2.0) timeout (>= 0.4.0) - activestorage (7.1.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activesupport (= 7.1.3.4) + activestorage (7.2.0) + actionpack (= 7.2.0) + activejob (= 7.2.0) + activerecord (= 7.2.0) + activesupport (= 7.2.0) marcel (~> 1.0) - activesupport (7.1.3.4) + activesupport (7.2.0) base64 bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) annotate (3.2.0) activerecord (>= 3.2, < 8.0) rake (>= 10.4, < 14.0) @@ -89,6 +85,8 @@ GEM bigdecimal (3.1.8) bootsnap (1.18.4) msgpack (~> 1.2) + brakeman (6.1.2) + racc builder (3.3.0) case_transform (0.2) activesupport @@ -158,8 +156,7 @@ GEM mocha (2.4.5) ruby2_keywords (>= 0.0.5) msgpack (1.7.2) - mutex_m (0.2.0) - net-imap (0.4.12) + net-imap (0.4.14) date net-protocol net-pop (0.1.2) @@ -196,20 +193,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.3.4) - actioncable (= 7.1.3.4) - actionmailbox (= 7.1.3.4) - actionmailer (= 7.1.3.4) - actionpack (= 7.1.3.4) - actiontext (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activemodel (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + rails (7.2.0) + actioncable (= 7.2.0) + actionmailbox (= 7.2.0) + actionmailer (= 7.2.0) + actionpack (= 7.2.0) + actiontext (= 7.2.0) + actionview (= 7.2.0) + activejob (= 7.2.0) + activemodel (= 7.2.0) + activerecord (= 7.2.0) + activestorage (= 7.2.0) + activesupport (= 7.2.0) bundler (>= 1.15.0) - railties (= 7.1.3.4) + railties (= 7.2.0) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -217,10 +214,10 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) - irb + railties (7.2.0) + actionpack (= 7.2.0) + activesupport (= 7.2.0) + irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) @@ -269,6 +266,7 @@ GEM ffi (~> 1.12) logger ruby2_keywords (0.0.5) + securerandom (0.3.1) simplecov (0.21.2) docile (~> 1.1) simplecov-html (~> 0.11) @@ -283,6 +281,7 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) + useragent (0.16.10) wahwah (1.6.4) webrick (1.8.1) websocket-driver (0.7.6) @@ -299,6 +298,7 @@ DEPENDENCIES annotate (~> 3.2) bcrypt (~> 3.1) bootsnap (~> 1.18.4) + brakeman codecov (~> 0.6.0) debug (~> 1.9) factory_bot_rails (~> 6.4) @@ -311,7 +311,7 @@ DEPENDENCIES puma (~> 6.4) pundit (~> 2.3) rack-cors (~> 2.0) - rails (~> 7.1) + rails (~> 7.2) rubocop (~> 1.65) rubocop-factory_bot (~> 2.26) rubocop-minitest (~> 0.35.1) @@ -326,4 +326,4 @@ RUBY VERSION ruby 3.3.0p0 BUNDLED WITH - 2.5.9 + 2.5.11 diff --git a/app/models/playlist.rb b/app/models/playlist.rb index 2fb9a9ca..d1181d46 100644 --- a/app/models/playlist.rb +++ b/app/models/playlist.rb @@ -15,8 +15,8 @@ class Playlist < ApplicationRecord belongs_to :user has_many :items, class_name: 'PlaylistItem', dependent: :destroy - enum access: { shared: 0, personal: 1, secret: 2 } - enum playlist_type: { album: 0, artist: 1, track: 2 } + enum :access, { shared: 0, personal: 1, secret: 2 } + enum :playlist_type, { album: 0, artist: 1, track: 2 } scope :with_item_ids, lambda { left_joins(:items) diff --git a/app/models/track_artist.rb b/app/models/track_artist.rb index 97589b2b..65eecdeb 100644 --- a/app/models/track_artist.rb +++ b/app/models/track_artist.rb @@ -15,7 +15,7 @@ class TrackArtist < ApplicationRecord include HasNormalized - enum role: { main: 0, performer: 1, composer: 2, conductor: 3, remixer: 4, producer: 5, arranger: 6 } + enum :role, { main: 0, performer: 1, composer: 2, conductor: 3, remixer: 4, producer: 5, arranger: 6 } belongs_to :track belongs_to :artist diff --git a/app/models/user.rb b/app/models/user.rb index 66d75e09..ab0838b1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -9,7 +9,7 @@ # class User < ApplicationRecord - enum permission: { user: 0, moderator: 1, admin: 2 } + enum :permission, { user: 0, moderator: 1, admin: 2 } has_secure_password diff --git a/config/application.rb b/config/application.rb index 309bd338..f0f6efea 100644 --- a/config/application.rb +++ b/config/application.rb @@ -17,7 +17,7 @@ module Accentor class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.1 + config.load_defaults 7.2 # Please, add to the `ignore` list any other `lib` subdirectories that do # not contain `.rb` files, or that should not be reloaded or eager loaded. diff --git a/config/brakeman.ignore b/config/brakeman.ignore new file mode 100644 index 00000000..159363b7 --- /dev/null +++ b/config/brakeman.ignore @@ -0,0 +1,29 @@ +{ + "ignored_warnings": [ + { + "warning_type": "File Access", + "warning_code": 16, + "fingerprint": "4cca0972cd94dfed36bd9c5de56d9194b5f9fa2df9cea101e054130f95d5556f", + "check_name": "SendFile", + "message": "Model attribute used in file name", + "file": "app/controllers/tracks_controller.rb", + "line": 85, + "link": "https://brakemanscanner.org/docs/warning_types/file_access/", + "code": "send_file(Track.find(params[:id]).audio_file.full_path)", + "render_path": null, + "location": { + "type": "method", + "class": "TracksController", + "method": "download" + }, + "user_input": "Track.find(params[:id]).audio_file.full_path", + "confidence": "Medium", + "cwe_id": [ + 22 + ], + "note": "The attribute is not configurable by users, but rather set by the scan job" + } + ], + "updated": "2024-08-10 11:14:43 +0200", + "brakeman_version": "6.1.2" +} diff --git a/config/environments/test.rb b/config/environments/test.rb index 23c5bef6..22645337 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -49,6 +49,9 @@ # Raises error for missing translations. config.i18n.raise_on_missing_translations = true + # Use ActiveJob test adapter in tests + config.active_job.queue_adapter = :test + # Annotate rendered view with file names. # config.action_view.annotate_rendered_view_with_filenames = true diff --git a/config/puma.rb b/config/puma.rb index 346d7da9..8a484c7b 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,12 +1,23 @@ -# Puma can serve each request in a thread from an internal thread pool. -# The `threads` method setting takes two numbers: a minimum and maximum. -# Any libraries that use thread pools should be configured to match -# the maximum value specified for Puma. Default is set to 5 threads for minimum -# and maximum; this matches the default thread size of Active Record. +# Puma starts a configurable number of processes (workers) and each process +# serves each request in a thread from an internal thread pool. # -max_threads_count = ENV.fetch('RAILS_MAX_THREADS', 5) -min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count } -threads min_threads_count, max_threads_count +# The ideal number of threads per worker depends both on how much time the +# application spends waiting for IO operations and on how much you wish to +# to prioritize throughput over latency. +# +# As a rule of thumb, increasing the number of threads will increase how much +# traffic a given process can handle (throughput), but due to CRuby's +# Global VM Lock (GVL) it has diminishing returns and will degrade the +# response time (latency) of the application. +# +# The default is set to 3 threads as it's deemed a decent compromise between +# throughput and latency for the average Rails application. +# +# Any libraries that use a connection pool or another resource pool should +# be configured to provide at least as many connections as the number of +# threads. This includes Active Record's `pool` parameter in `database.yml`. +threads_count = ENV.fetch('RAILS_MAX_THREADS', 3) +threads threads_count, threads_count # Specifies the `worker_timeout` threshold that Puma will use to wait before # terminating a worker in development environments. @@ -14,32 +25,10 @@ worker_timeout 3600 if ENV.fetch('RAILS_ENV', 'development') == 'development' # Specifies the `port` that Puma will listen on to receive requests; default is 3000. -# port ENV.fetch('PORT', 3000) - -# Specifies the `environment` that Puma will run in. -# -environment ENV.fetch('RAILS_ENV') { 'development' } - -# Specifies the `pidfile`, `statefile` and the socket file that Puma will use. pidfile ENV.fetch('PIDFILE') { 'tmp/pids/server.pid' } state_path ENV.fetch('STATEPATH') { 'tmp/pids/server.state' } bind ENV.fetch('SOCKETFILE') { 'unix://tmp/sockets/puma.sock' } -# Specifies the number of `workers` to boot in clustered mode. -# Workers are forked web server processes. If using threads and workers together -# the concurrency of the application would be max `threads` * `workers`. -# Workers do not work on JRuby or Windows (both of which do not support -# processes). -# -# workers ENV.fetch("WEB_CONCURRENCY") { 2 } - -# Use the `preload_app!` method when specifying a `workers` number. -# This directive tells Puma to first boot the application and load code -# before forking the application. This takes advantage of Copy On Write -# process behavior so workers use less memory. -# -# preload_app! - # Allow puma to be restarted by `rails restart` command. plugin :tmp_restart diff --git a/gemset.nix b/gemset.nix index 5fbd32ee..682aa573 100644 --- a/gemset.nix +++ b/gemset.nix @@ -5,43 +5,43 @@ platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "046k9cnw8vqlf4q4i2aywr5rf02k2081238z2rf3vada3ijshyvq"; + sha256 = "11npl2xcqa1vzvfhih4nszzhj7s4kvx2qz178vzqc25asi0k13ch"; type = "gem"; }; - version = "7.1.3.4"; + version = "7.2.0"; }; actionmailbox = { - dependencies = ["actionpack" "activejob" "activerecord" "activestorage" "activesupport" "mail" "net-imap" "net-pop" "net-smtp"]; + dependencies = ["actionpack" "activejob" "activerecord" "activestorage" "activesupport" "mail"]; groups = ["default"]; platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "1l6ahdd20zimpq8crfw9ng8w288giv3daklbw6df95s5lhck1zd3"; + sha256 = "0r8n0r26fkndd4a206sizajrdhhc4r27jbqryi8cm54k33j03a4s"; type = "gem"; }; - version = "7.1.3.4"; + version = "7.2.0"; }; actionmailer = { - dependencies = ["actionpack" "actionview" "activejob" "activesupport" "mail" "net-imap" "net-pop" "net-smtp" "rails-dom-testing"]; + dependencies = ["actionpack" "actionview" "activejob" "activesupport" "mail" "rails-dom-testing"]; groups = ["default"]; platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "0l835a50h95wlzcy76c2vg54ix3i55kqmnrmz67b11q5fjb6068z"; + sha256 = "04g0487vn75v7im6c7v80fmbkndml3fa4376qyvij33qqkn7jv9p"; type = "gem"; }; - version = "7.1.3.4"; + version = "7.2.0"; }; actionpack = { - dependencies = ["actionview" "activesupport" "nokogiri" "racc" "rack" "rack-session" "rack-test" "rails-dom-testing" "rails-html-sanitizer"]; + dependencies = ["actionview" "activesupport" "nokogiri" "racc" "rack" "rack-session" "rack-test" "rails-dom-testing" "rails-html-sanitizer" "useragent"]; groups = ["default" "development" "test"]; platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "1lpd0lvn6abcq5k8g0qw8kmzx6igirlqxvd1hhwmr5vaxhdwgbyw"; + sha256 = "17csq41dmp4has1pqzmdmsspr8hn0lyn3mcmfc3k00zsaf90gppw"; type = "gem"; }; - version = "7.1.3.4"; + version = "7.2.0"; }; actiontext = { dependencies = ["actionpack" "activerecord" "activestorage" "activesupport" "globalid" "nokogiri"]; @@ -49,10 +49,10 @@ platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "115p772dc19qvywyz9pgzh1fb3g2457hhh96shcrijd3jnp4v5l4"; + sha256 = "1hlfcckb2n5sxa53mqvv573r7k6wkm88zb8n2vg48kfbllwigywh"; type = "gem"; }; - version = "7.1.3.4"; + version = "7.2.0"; }; actionview = { dependencies = ["activesupport" "builder" "erubi" "rails-dom-testing" "rails-html-sanitizer"]; @@ -60,10 +60,10 @@ platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "0nv1ifjhm59abc52k2hwazl38r9cc4bkfgdsl00f24gc5ljgbz21"; + sha256 = "18zxclv46kjv0s04kznsvi24w5ays4xzylw831dgapzzr452qw41"; type = "gem"; }; - version = "7.1.3.4"; + version = "7.2.0"; }; active_model_serializers = { dependencies = ["actionpack" "activemodel" "case_transform" "jsonapi-renderer"]; @@ -82,10 +82,10 @@ platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "0qhg0izdckgyqmrsgigh1vkqg8ccrkdjhf36k9gxcbgvzpqfx2iz"; + sha256 = "06nfky2m2ajzjhdsidrnwx7sayn0mwm4v0pwgvdjvijh6js2d6f3"; type = "gem"; }; - version = "7.1.3.4"; + version = "7.2.0"; }; activemodel = { dependencies = ["activesupport"]; @@ -93,10 +93,10 @@ platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "0wmdw440l4h75zk6c4ynbnv21bj26dh8kb1kwikqkjnzfvm3ij7l"; + sha256 = "0l9p7bsd2g22h2p1s2g4a9n9ncb09csicgpwila9ki0bx8g6whi7"; type = "gem"; }; - version = "7.1.3.4"; + version = "7.2.0"; }; activerecord = { dependencies = ["activemodel" "activesupport" "timeout"]; @@ -104,10 +104,10 @@ platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "1wihj9xhr7yj10hh8fqw6ralanbwlisncbam8pa92czjssjfqkkq"; + sha256 = "19y8fda63bmzndsssdpj9jyqsdarfxssrs8hadywp86l9f6lnyha"; type = "gem"; }; - version = "7.1.3.4"; + version = "7.2.0"; }; activestorage = { dependencies = ["actionpack" "activejob" "activerecord" "activesupport" "marcel"]; @@ -115,21 +115,21 @@ platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "0bhardfnmyynd04si8989g5yw5fnj4f2a5cs1945w43ylyh0w0pj"; + sha256 = "153cbnqix4kwqkly462y9qrfwcj8g08kfzxxqm9dx61zscfnldh2"; type = "gem"; }; - version = "7.1.3.4"; + version = "7.2.0"; }; activesupport = { - dependencies = ["base64" "bigdecimal" "concurrent-ruby" "connection_pool" "drb" "i18n" "minitest" "mutex_m" "tzinfo"]; + dependencies = ["base64" "bigdecimal" "concurrent-ruby" "connection_pool" "drb" "i18n" "logger" "minitest" "securerandom" "tzinfo"]; groups = ["default" "development" "test"]; platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "0283wk1zxb76lg79dk501kcf5xy9h25qiw15m86s4nrfv11vqns5"; + sha256 = "19bhvqwya58k45m89abqpdczdk5ysd2841hkyr21yg4j14rlvaci"; type = "gem"; }; - version = "7.1.3.4"; + version = "7.2.0"; }; annotate = { dependencies = ["activerecord" "rake"]; @@ -193,6 +193,17 @@ }; version = "1.18.4"; }; + brakeman = { + dependencies = ["racc"]; + groups = ["development"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1lylig4vgnw9l1ybwgxdi9nw9q2bc5dcplklg8nsbi7j32f7c5kp"; + type = "gem"; + }; + version = "6.1.2"; + }; builder = { groups = ["default" "development" "test"]; platforms = []; @@ -580,26 +591,16 @@ }; version = "1.7.2"; }; - mutex_m = { - groups = ["default" "development" "test"]; - platforms = []; - source = { - remotes = ["https://rubygems.org"]; - sha256 = "1ma093ayps1m92q845hmpk0dmadicvifkbf05rpq9pifhin0rvxn"; - type = "gem"; - }; - version = "0.2.0"; - }; net-imap = { dependencies = ["date" "net-protocol"]; groups = ["default"]; platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "18yclv06n0cy8jqmi11sd1dl8nasc5n5r1mhan2v51j7jd3z58v3"; + sha256 = "0rc08fxm10vv73bg0nqyp5bdvl4cvzb3y4cdk4kwmxx414zln652"; type = "gem"; }; - version = "0.4.12"; + version = "0.4.14"; }; net-pop = { dependencies = ["net-protocol"]; @@ -809,10 +810,10 @@ platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "1bd6b970kwz9l23ffwg77n424gyhqqm31f493vf43rjfyyfwlzrs"; + sha256 = "0810cj96ng1ljcvhrdnbmf0hqxyh6acmn8dfckjwx73q3c0rhb6q"; type = "gem"; }; - version = "7.1.3.4"; + version = "7.2.0"; }; rails-dom-testing = { dependencies = ["activesupport" "minitest" "nokogiri"]; @@ -842,10 +843,10 @@ platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "1z0slb2dlwrwgqijbk37hl4r9bh4h8vzcyswz6a9srl8lzrljq3c"; + sha256 = "117b68b1lp7b06g3db2brlc8yfs2j9jj95v23f12090s3a5d53fh"; type = "gem"; }; - version = "7.1.3.4"; + version = "7.2.0"; }; rainbow = { groups = ["default" "development"]; @@ -1018,6 +1019,16 @@ }; version = "0.0.5"; }; + securerandom = { + groups = ["default" "development" "test"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1phv6kh417vkanhssbjr960c0gfqvf8z7d3d9fd2yvd41q64bw4q"; + type = "gem"; + }; + version = "0.3.1"; + }; simplecov = { dependencies = ["docile" "simplecov-html" "simplecov_json_formatter"]; groups = ["test"]; @@ -1120,6 +1131,16 @@ }; version = "2.5.0"; }; + useragent = { + groups = ["default" "development" "test"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1fv5kvq494swy0p17h9qya9r50w15xsi9zmvhzb8gh55kq6ki50p"; + type = "gem"; + }; + version = "0.16.10"; + }; wahwah = { groups = ["default"]; platforms = []; diff --git a/test/factories/rescan_runners.rb b/test/factories/rescan_runners.rb index 2d8a93e0..469836dd 100644 --- a/test/factories/rescan_runners.rb +++ b/test/factories/rescan_runners.rb @@ -12,6 +12,7 @@ # FactoryBot.define do factory :rescan_runner do + finished_at { 1.minute.ago } location end end diff --git a/test/models/rescan_runner_test.rb b/test/models/rescan_runner_test.rb index 9b6db5ca..711cb56b 100644 --- a/test/models/rescan_runner_test.rb +++ b/test/models/rescan_runner_test.rb @@ -26,7 +26,9 @@ class RescanRunnerTest < ActiveSupport::TestCase test 'schedule should create a job' do prev = @runner.finished_at - @runner.schedule + perform_enqueued_jobs do + @runner.schedule + end @runner.reload assert_not_equal prev, @runner.finished_at @@ -45,7 +47,11 @@ class RescanRunnerTest < ActiveSupport::TestCase create_list(:rescan_runner, 3) prev = RescanRunner.all.map(&:finished_at) - RescanRunner.schedule_all + + perform_enqueued_jobs do + RescanRunner.schedule_all + end + after = RescanRunner.all.map(&:finished_at) prev.each_with_index do |time, i| diff --git a/test/test_helper.rb b/test/test_helper.rb index 54105092..655de0cd 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -17,6 +17,7 @@ class ActiveSupport::TestCase include FactoryBot::Syntax::Methods + include ActiveJob::TestHelper # Run tests in parallel with specified workers parallelize(workers: :number_of_processors)