diff --git a/.ruby-version b/.ruby-version index 4e34c4dd..9c1555fa 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.7.6 +ruby-3.3.2 diff --git a/Gemfile b/Gemfile index 53b290c7..1d0bf567 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby "2.7.6" +ruby "3.3.2" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" gem "rails", "~> 7.0.4" @@ -10,7 +10,8 @@ gem "rails", "~> 7.0.4" gem "sprockets-rails" # Use sqlite3 as the database for Active Record -gem "sqlite3", "~> 1.4" +# gem "sqlite3", "~> 1.4" +gem 'pg', '>= 0.18', '< 2.0' # Use the Puma web server [https://github.com/puma/puma] gem "puma", "~> 5.0" @@ -28,7 +29,7 @@ gem "stimulus-rails" gem "jbuilder" #Background processing -gem "sidekiq" +gem "sidekiq", "~> 7.0.7" # Use Redis adapter to run Action Cable in production gem "redis", "~> 4.0" diff --git a/Gemfile.lock b/Gemfile.lock index 0da0887b..b5545e7a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -83,7 +83,7 @@ GEM xpath (~> 3.2) childprocess (4.1.0) concurrent-ruby (1.1.10) - connection_pool (2.3.0) + connection_pool (2.4.1) crass (1.0.6) debug (1.6.3) irb (>= 1.3.6) @@ -112,7 +112,7 @@ GEM matrix (0.4.2) method_source (1.0.0) mini_mime (1.1.2) - mini_portile2 (2.8.0) + mini_portile2 (2.8.7) minitest (5.16.3) msgpack (1.6.0) net-imap (0.3.1) @@ -124,13 +124,14 @@ GEM net-smtp (0.3.3) net-protocol nio4r (2.5.8) - nokogiri (1.13.9) - mini_portile2 (~> 2.8.0) + nokogiri (1.16.6) + mini_portile2 (~> 2.8.2) racc (~> 1.4) + pg (1.5.3) public_suffix (5.0.0) puma (5.6.5) nio4r (~> 2.0) - racc (1.6.0) + racc (1.8.0) rack (2.2.4) rack-test (2.0.2) rack (>= 1.3) @@ -162,7 +163,7 @@ GEM zeitwerk (~> 2.5) rake (13.0.6) redis (4.8.0) - redis-client (0.11.2) + redis-client (0.14.1) connection_pool regexp_parser (2.6.1) reline (0.3.1) @@ -191,7 +192,7 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sidekiq (7.0.2) + sidekiq (7.0.9) concurrent-ruby (< 2) connection_pool (>= 2.3.0) rack (>= 2.2.4) @@ -203,8 +204,6 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sqlite3 (1.5.4) - mini_portile2 (~> 2.8.0) stimulus-rails (1.1.1) railties (>= 6.0.0) thor (1.2.1) @@ -241,14 +240,14 @@ DEPENDENCIES debug importmap-rails jbuilder + pg (>= 0.18, < 2.0) puma (~> 5.0) rails (~> 7.0.4) redis (~> 4.0) rspec-rails selenium-webdriver - sidekiq + sidekiq (~> 7.0.7) sprockets-rails - sqlite3 (~> 1.4) stimulus-rails turbo-rails tzinfo-data @@ -256,7 +255,7 @@ DEPENDENCIES webdrivers RUBY VERSION - ruby 2.7.6p219 + ruby 3.3.2p78 BUNDLED WITH 2.1.4 diff --git a/README.md b/README.md index f3e883aa..131635e4 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,9 @@ Updates * System dependencies + + + * Configuration * Database creation @@ -23,5 +26,3 @@ Updates * Services (job queues, cache servers, search engines, etc.) * Deployment instructions - -* ... diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 09705d12..58992cce 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,2 +1,3 @@ class ApplicationController < ActionController::Base + # asdasd asd end diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index cab14057..326a8aa2 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -8,6 +8,7 @@ def index # GET /items/1 or /items/1.json def show + #asdasd end # GET /items/new diff --git a/app/models/item.rb b/app/models/item.rb index 809e23f8..a751429f 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -1,2 +1,3 @@ class Item < ApplicationRecord + #adfasdasd end diff --git a/app/sidekiq/hard_job10.rb b/app/sidekiq/hard_job10.rb new file mode 100644 index 00000000..215cb499 --- /dev/null +++ b/app/sidekiq/hard_job10.rb @@ -0,0 +1,7 @@ +class HardJob10 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/app/sidekiq/hard_job11.rb b/app/sidekiq/hard_job11.rb new file mode 100644 index 00000000..d1c7a896 --- /dev/null +++ b/app/sidekiq/hard_job11.rb @@ -0,0 +1,7 @@ +class HardJob11 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/app/sidekiq/hard_job12.rb b/app/sidekiq/hard_job12.rb new file mode 100644 index 00000000..dabf995e --- /dev/null +++ b/app/sidekiq/hard_job12.rb @@ -0,0 +1,7 @@ +class HardJob12 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/app/sidekiq/hard_job13.rb b/app/sidekiq/hard_job13.rb new file mode 100644 index 00000000..84e0e22d --- /dev/null +++ b/app/sidekiq/hard_job13.rb @@ -0,0 +1,7 @@ +class HardJob13 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/app/sidekiq/hard_job14.rb b/app/sidekiq/hard_job14.rb new file mode 100644 index 00000000..d929440e --- /dev/null +++ b/app/sidekiq/hard_job14.rb @@ -0,0 +1,7 @@ +class HardJob14 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/app/sidekiq/hard_job15.rb b/app/sidekiq/hard_job15.rb new file mode 100644 index 00000000..5e2874ea --- /dev/null +++ b/app/sidekiq/hard_job15.rb @@ -0,0 +1,7 @@ +class HardJob15 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/app/sidekiq/hard_job16.rb b/app/sidekiq/hard_job16.rb new file mode 100644 index 00000000..3266b294 --- /dev/null +++ b/app/sidekiq/hard_job16.rb @@ -0,0 +1,7 @@ +class HardJob16 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/app/sidekiq/hard_job17.rb b/app/sidekiq/hard_job17.rb new file mode 100644 index 00000000..9e8f8c9c --- /dev/null +++ b/app/sidekiq/hard_job17.rb @@ -0,0 +1,7 @@ +class HardJob17 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/app/sidekiq/hard_job18.rb b/app/sidekiq/hard_job18.rb new file mode 100644 index 00000000..200ea2ca --- /dev/null +++ b/app/sidekiq/hard_job18.rb @@ -0,0 +1,7 @@ +class HardJob18 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/app/sidekiq/hard_job2.rb b/app/sidekiq/hard_job2.rb new file mode 100644 index 00000000..52b89d59 --- /dev/null +++ b/app/sidekiq/hard_job2.rb @@ -0,0 +1,7 @@ +class HardJob2 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/app/sidekiq/hard_job3.rb b/app/sidekiq/hard_job3.rb new file mode 100644 index 00000000..d22f12eb --- /dev/null +++ b/app/sidekiq/hard_job3.rb @@ -0,0 +1,7 @@ +class HardJob3 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/app/sidekiq/hard_job4.rb b/app/sidekiq/hard_job4.rb new file mode 100644 index 00000000..c5206b81 --- /dev/null +++ b/app/sidekiq/hard_job4.rb @@ -0,0 +1,7 @@ +class HardJob4 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/app/sidekiq/hard_job5.rb b/app/sidekiq/hard_job5.rb new file mode 100644 index 00000000..9d580e7a --- /dev/null +++ b/app/sidekiq/hard_job5.rb @@ -0,0 +1,7 @@ +class HardJob5 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/app/sidekiq/hard_job6.rb b/app/sidekiq/hard_job6.rb new file mode 100644 index 00000000..301d7cd1 --- /dev/null +++ b/app/sidekiq/hard_job6.rb @@ -0,0 +1,7 @@ +class HardJob6 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/app/sidekiq/hard_job7.rb b/app/sidekiq/hard_job7.rb new file mode 100644 index 00000000..40faf09c --- /dev/null +++ b/app/sidekiq/hard_job7.rb @@ -0,0 +1,7 @@ +class HardJob7 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/app/sidekiq/hard_job8.rb b/app/sidekiq/hard_job8.rb new file mode 100644 index 00000000..d8ad6dee --- /dev/null +++ b/app/sidekiq/hard_job8.rb @@ -0,0 +1,7 @@ +class HardJob8 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/app/sidekiq/hard_job9.rb b/app/sidekiq/hard_job9.rb new file mode 100644 index 00000000..19e27672 --- /dev/null +++ b/app/sidekiq/hard_job9.rb @@ -0,0 +1,7 @@ +class HardJob9 + include Sidekiq::Job + + def perform(*args) + # Do something + end +end diff --git a/config/database.yml b/config/database.yml index fcba57f1..2f921d4b 100644 --- a/config/database.yml +++ b/config/database.yml @@ -5,21 +5,34 @@ # gem "sqlite3" # default: &default - adapter: sqlite3 + adapter: postgresql + timeout: 5 + encoding: unicode pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> - timeout: 5000 development: <<: *default - database: db/development.sqlite3 + database: basic_app_dev + username: <%= ENV['BASIC_APP_USERNAME'] %> + password: <%= ENV['BASIC_APP_PASSWORD'] %> + host: localhost + port: 5432 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: <<: *default - database: db/test.sqlite3 + database: basic_app_test + username: <%= ENV['BASIC_APP_USERNAME'] %> + password: <%= ENV['BASIC_APP_PASSWORD'] %> + host: localhost + port: 5432 production: <<: *default - database: db/production.sqlite3 + database: basic_app + username: <%= ENV['BASIC_APP_USERNAME'] %> + password: <%= ENV['BASIC_APP_PASSWORD'] %> + host: localhost + port: 5432 diff --git a/spec/features/test_feature_spec.rb b/spec/features/test_feature_spec.rb new file mode 100644 index 00000000..2b052941 --- /dev/null +++ b/spec/features/test_feature_spec.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require 'rails_helper' + +feature 'Test page' do + context 'user visits root' do + scenario 'user sees page' do + visit items_path + expect(page).to have_text("Items") + end + end +end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index a53bdba2..c40f1879 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -1,12 +1,15 @@ # This file is copied to spec/ when you run 'rails generate rspec:install' -require 'spec_helper' ENV['RAILS_ENV'] ||= 'test' -require_relative '../config/environment' +require File.expand_path('../../config/environment', __FILE__) # Prevent database truncation if the environment is production abort("The Rails environment is running in production mode!") if Rails.env.production? +require 'spec_helper' require 'rspec/rails' # Add additional requires below this line. Rails is not loaded until this point! +# some comments go here + + # Requires supporting ruby files with custom matchers and macros, etc, in # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are # run as spec files by default. This means that files in spec/support that end @@ -22,6 +25,7 @@ # # Dir[Rails.root.join('spec', 'support', '**', '*.rb')].sort.each { |f| require f } + # Checks for pending migrations and applies them before tests are run. # If you are not using ActiveRecord, you can remove these lines. begin diff --git a/spec/sidekiq/hard_job10_spec.rb b/spec/sidekiq/hard_job10_spec.rb new file mode 100644 index 00000000..bd2fcb27 --- /dev/null +++ b/spec/sidekiq/hard_job10_spec.rb @@ -0,0 +1,18 @@ +require 'rails_helper' +RSpec.describe HardJob10, type: :job do + it "does a long test" do + expect(1).to eq(1) + end + + it "does second long test" do + expect(1).to eq(1) + end + + it "does third long test" do + expect(1).to eq(1) + end + + it "does forth long test" do + expect(1).to eq(1) + end +end diff --git a/spec/sidekiq/hard_job11_spec.rb b/spec/sidekiq/hard_job11_spec.rb new file mode 100644 index 00000000..f591c695 --- /dev/null +++ b/spec/sidekiq/hard_job11_spec.rb @@ -0,0 +1,18 @@ +require 'rails_helper' +RSpec.describe HardJob11, type: :job do + it "does a long test" do + expect(1).to eq(1) + end + + it "does second long test" do + expect(1).to eq(1) + end + + it "does third long test" do + expect(1).to eq(1) + end + + it "does forth long test" do + expect(1).to eq(1) + end +end diff --git a/spec/sidekiq/hard_job12_spec.rb b/spec/sidekiq/hard_job12_spec.rb new file mode 100644 index 00000000..62e2479b --- /dev/null +++ b/spec/sidekiq/hard_job12_spec.rb @@ -0,0 +1,18 @@ +require 'rails_helper' +RSpec.describe HardJob12, type: :job do + it "does a long test" do + expect(1).to eq(1) + end + + it "does second long test" do + expect(1).to eq(1) + end + + it "does third long test" do + expect(1).to eq(1) + end + + it "does forth long test" do + expect(1).to eq(1) + end +end diff --git a/spec/sidekiq/hard_job13_spec.rb b/spec/sidekiq/hard_job13_spec.rb new file mode 100644 index 00000000..61dbb787 --- /dev/null +++ b/spec/sidekiq/hard_job13_spec.rb @@ -0,0 +1,22 @@ +require 'rails_helper' +RSpec.describe HardJob13, type: :job do + it "does a long test" do + expect(1).to eq(1) + end + + it "does second long test" do + expect(1).to eq(1) + end + + it "does third long test" do + expect(1).to eq(1) + end + + it "does forth long test" do + expect(1).to eq(1) + end + + # it "does short flaky test" do + # expect(ENV['RSPEC_RETRY_RETRY_COUNT'].to_i).to eq(2) + # end +end diff --git a/spec/sidekiq/hard_job14_spec.rb b/spec/sidekiq/hard_job14_spec.rb new file mode 100644 index 00000000..ed87e284 --- /dev/null +++ b/spec/sidekiq/hard_job14_spec.rb @@ -0,0 +1,18 @@ +require 'rails_helper' +RSpec.describe HardJob14, type: :job do + it "does a long test" do + expect(1).to eq(1) + end + + it "does second long test" do + expect(1).to eq(1) + end + + it "does third long test" do + expect(1).to eq(1) + end + + it "does forth long test" do + expect(1).to eq(1) + end +end diff --git a/spec/sidekiq/hard_job15_spec.rb b/spec/sidekiq/hard_job15_spec.rb new file mode 100644 index 00000000..ab6cd86f --- /dev/null +++ b/spec/sidekiq/hard_job15_spec.rb @@ -0,0 +1,18 @@ +require 'rails_helper' +RSpec.describe HardJob15, type: :job do + it "does a long test" do + expect(1).to eq(1) + end + + it "does second long test" do + expect(1).to eq(1) + end + + it "does third long test" do + expect(1).to eq(1) + end + + it "does forth long test" do + expect(1).to eq(1) + end +end diff --git a/spec/sidekiq/hard_job2_spec.rb b/spec/sidekiq/hard_job2_spec.rb new file mode 100644 index 00000000..ab0da30b --- /dev/null +++ b/spec/sidekiq/hard_job2_spec.rb @@ -0,0 +1,18 @@ +require 'rails_helper' +RSpec.describe HardJob2, type: :job do + it "does a long test" do + expect(1).to eq(1) + end + + it "does second long test" do + expect(1).to eq(1) + end + + it "does third long test" do + expect(1).to eq(1) + end + + it "does forth long test" do + expect(1).to eq(1) + end +end diff --git a/spec/sidekiq/hard_job3_spec.rb b/spec/sidekiq/hard_job3_spec.rb new file mode 100644 index 00000000..ec1cac98 --- /dev/null +++ b/spec/sidekiq/hard_job3_spec.rb @@ -0,0 +1,18 @@ +require 'rails_helper' +RSpec.describe HardJob3, type: :job do + it "does a long test" do + expect(1).to eq(1) + end + + it "does second long test" do + expect(1).to eq(1) + end + + it "does third long test" do + expect(1).to eq(1) + end + + it "does forth long test" do + expect(1).to eq(1) + end +end diff --git a/spec/sidekiq/hard_job4_spec.rb b/spec/sidekiq/hard_job4_spec.rb new file mode 100644 index 00000000..94dccf2b --- /dev/null +++ b/spec/sidekiq/hard_job4_spec.rb @@ -0,0 +1,18 @@ +require 'rails_helper' +RSpec.describe HardJob4, type: :job do + it "does a long test" do + expect(1).to eq(1) + end + + it "does second long test" do + expect(1).to eq(1) + end + + it "does third long test" do + expect(1).to eq(1) + end + + it "does forth long test" do + expect(1).to eq(1) + end +end diff --git a/spec/sidekiq/hard_job5_spec.rb b/spec/sidekiq/hard_job5_spec.rb new file mode 100644 index 00000000..2cd1fea7 --- /dev/null +++ b/spec/sidekiq/hard_job5_spec.rb @@ -0,0 +1,18 @@ +require 'rails_helper' +RSpec.describe HardJob5, type: :job do + it "does a long test" do + expect(1).to eq(1) + end + + it "does second long test" do + expect(1).to eq(1) + end + + it "does third long test" do + expect(1).to eq(1) + end + + it "does forth long test" do + expect(1).to eq(1) + end +end diff --git a/spec/sidekiq/hard_job6_spec.rb b/spec/sidekiq/hard_job6_spec.rb new file mode 100644 index 00000000..abf865c9 --- /dev/null +++ b/spec/sidekiq/hard_job6_spec.rb @@ -0,0 +1,22 @@ +require 'rails_helper' +RSpec.describe HardJob6, type: :job do + it "does a long test" do + expect(1).to eq(1) + end + + it "does second long test" do + expect(1).to eq(1) + end + + it "does third long test" do + expect(1).to eq(1) + end + + it "does forth long test" do + expect(1).to eq(1) + end + + # it "does short flaky test" do + # expect(ENV['RSPEC_RETRY_RETRY_COUNT'].to_i).to eq(2) + # end +end diff --git a/spec/sidekiq/hard_job7_spec.rb b/spec/sidekiq/hard_job7_spec.rb new file mode 100644 index 00000000..0960b2e4 --- /dev/null +++ b/spec/sidekiq/hard_job7_spec.rb @@ -0,0 +1,18 @@ +require 'rails_helper' +RSpec.describe HardJob7, type: :job do + it "does a long test" do + expect(1).to eq(1) + end + + it "does second long test" do + expect(1).to eq(1) + end + + it "does third long test" do + expect(1).to eq(1) + end + + it "does forth long test" do + expect(1).to eq(1) + end +end diff --git a/spec/sidekiq/hard_job8_spec.rb b/spec/sidekiq/hard_job8_spec.rb new file mode 100644 index 00000000..a64f0d38 --- /dev/null +++ b/spec/sidekiq/hard_job8_spec.rb @@ -0,0 +1,22 @@ +require 'rails_helper' +RSpec.describe HardJob8, type: :job do + it "does a long test" do + expect(1).to eq(1) + end + + it "does second long test" do + expect(1).to eq(1) + end + + it "does third long test" do + expect(1).to eq(1) + end + + it "does forth long test" do + expect(1).to eq(1) + end + + # it "does short flaky test" do + # expect(ENV['RSPEC_RETRY_RETRY_COUNT'].to_i).to eq(2) + # end +end diff --git a/spec/sidekiq/hard_job9_spec.rb b/spec/sidekiq/hard_job9_spec.rb new file mode 100644 index 00000000..bdde2934 --- /dev/null +++ b/spec/sidekiq/hard_job9_spec.rb @@ -0,0 +1,18 @@ +require 'rails_helper' +RSpec.describe HardJob9, type: :job do + it "does a long test" do + expect(1).to eq(1) + end + + it "does second long test" do + expect(1).to eq(1) + end + + it "does third long test" do + expect(1).to eq(1) + end + + it "does forth long test" do + expect(1).to eq(1) + end +end diff --git a/spec/sidekiq/hard_job_spec.rb b/spec/sidekiq/hard_job_spec.rb index b034fdee..4e024af0 100644 --- a/spec/sidekiq/hard_job_spec.rb +++ b/spec/sidekiq/hard_job_spec.rb @@ -1,4 +1,31 @@ require 'rails_helper' RSpec.describe HardJob, type: :job do - pending "add some examples to (or delete) #{__FILE__}" + it "does a long test" do + expect(1).to eq(1) + end + + it "does second long test" do + expect(1).to eq(1) + end + + it "does third long test" do + expect(1).to eq(1) + end + + it "does forth long test" do + expect(1).to eq(1) + end + + it "does short pass test" do + expect(1).to eq(1) + end + + it "does short fixed fail test" do + expect(1).to eq(1) + end + + # it "does short flaky test" do + # expect(ENV['RSPEC_RETRY_RETRY_COUNT'].to_i).to eq(2) + # end + end