diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 44579f9f4..b68b0b662 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,11 +13,11 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.7', '2.6', '2.5', '2.4', head, jruby-head] + ruby: ['3.0', '2.7', '2.6', '2.5', head, jruby-head] os: [ubuntu-latest, windows-latest] task: [default] include: - - ruby: '2.4' # lowest supported version + - ruby: '2.5' # lowest supported version os: ubuntu-latest task: rubocop env: diff --git a/.rubocop.yml b/.rubocop.yml index 059edea15..67bb29d84 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,11 +1,14 @@ AllCops: NewCops: enable - TargetRubyVersion: 2.4 + TargetRubyVersion: 2.5 SuggestExtensions: false Exclude: - '**/vendor/bundle/**/*' - 'spec/fixtures/*/db/schema.rb' +Style/FrozenStringLiteralComment: + Enabled: false + Style/StringLiterals: Enabled: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 4187d54cf..968097a1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ - None +### Dependencies + +- Drop ruby 2.4 support. + # Changelog ## v3.5.1 - 2021-03-07 diff --git a/Gemfile.lock b/Gemfile.lock index 44b821a34..8cf57cbda 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,49 +7,54 @@ PATH GEM remote: https://rubygems.org/ specs: - activesupport (5.2.4.3) + activesupport (6.1.3) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) ast (2.4.1) builder (3.2.4) bump (0.9.0) colorize (0.8.1) - concurrent-ruby (1.1.6) - cucumber (4.0.0) + concurrent-ruby (1.1.8) + cucumber (4.1.0) builder (~> 3.2, >= 3.2.3) - cucumber-core (~> 7.0, >= 7.0.0) + cucumber-core (~> 7.1, >= 7.1.0) + cucumber-create-meta (~> 1.0.0, >= 1.0.0) cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) - cucumber-gherkin (~> 13.0, >= 13.0.0) - cucumber-html-formatter (~> 6.0, >= 6.0.1) - cucumber-messages (~> 12.1, >= 12.1.1) - cucumber-wire (~> 3.0, >= 3.0.0) - diff-lcs (~> 1.3, >= 1.3) + cucumber-gherkin (~> 14.0, >= 14.0.1) + cucumber-html-formatter (~> 7.0, >= 7.0.0) + cucumber-messages (~> 12.2, >= 12.2.0) + cucumber-wire (~> 3.1, >= 3.1.0) + diff-lcs (~> 1.3, >= 1.3, < 1.4) multi_test (~> 0.1, >= 0.1.2) sys-uname (~> 1.0, >= 1.0.2) - cucumber-core (7.0.0) - cucumber-gherkin (~> 13.0, >= 13.0.0) - cucumber-messages (~> 12.1, >= 12.1.1) + cucumber-core (7.1.0) + cucumber-gherkin (~> 14.0, >= 14.0.1) + cucumber-messages (~> 12.2, >= 12.2.0) cucumber-tag-expressions (~> 2.0, >= 2.0.4) - cucumber-cucumber-expressions (10.2.0) - cucumber-gherkin (13.0.0) - cucumber-messages (~> 12.0, >= 12.0.0) - cucumber-html-formatter (6.0.2) - cucumber-messages (~> 12.1, >= 12.1.1) - cucumber-messages (12.1.1) + cucumber-create-meta (1.0.0) + cucumber-messages (~> 12.2, >= 12.2.0) + sys-uname (~> 1.2, >= 1.2.1) + cucumber-cucumber-expressions (10.3.0) + cucumber-gherkin (14.2.0) + cucumber-messages (~> 12.4, >= 12.4.0) + cucumber-html-formatter (7.2.0) + cucumber-messages (~> 12.4, >= 12.4.0) + cucumber-messages (12.4.0) protobuf-cucumber (~> 3.10, >= 3.10.8) cucumber-tag-expressions (2.0.4) - cucumber-wire (3.0.0) - cucumber-core (~> 7.0, >= 7.0.0) + cucumber-wire (3.1.0) + cucumber-core (~> 7.1, >= 7.1.0) cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) - cucumber-messages (~> 12.1, >= 12.1.1) - cuke_modeler (3.0.0) - cucumber-gherkin (< 14.0) + cucumber-messages (~> 12.2, >= 12.2.0) + cuke_modeler (3.7.0) + cucumber-gherkin (< 18.0) diff-lcs (1.3) - ffi (1.13.1) + ffi (1.15.0) gherkin-ruby (0.3.2) - i18n (1.8.3) + i18n (1.8.9) concurrent-ruby (~> 1.0) json (2.3.0) middleware (0.1.0) @@ -97,15 +102,16 @@ GEM colorize gherkin-ruby (>= 0.3.2) json - sys-uname (1.2.1) - ffi (>= 1.0.0) + sys-uname (1.2.2) + ffi (~> 1.1) test-unit (3.3.6) power_assert - thor (1.0.1) + thor (1.1.0) thread_safe (0.3.6) - tzinfo (1.2.7) - thread_safe (~> 0.1) + tzinfo (2.0.4) + concurrent-ruby (~> 1.0) unicode-display_width (2.0.0) + zeitwerk (2.4.2) PLATFORMS ruby @@ -123,4 +129,4 @@ DEPENDENCIES test-unit BUNDLED WITH - 2.1.4 + 2.2.15 diff --git a/lib/parallel_tests.rb b/lib/parallel_tests.rb index 997076e9e..84030f862 100644 --- a/lib/parallel_tests.rb +++ b/lib/parallel_tests.rb @@ -23,16 +23,14 @@ def determine_number_of_processes(count) def with_pid_file Tempfile.open('parallel_tests-pidfile') do |f| - begin - ENV['PARALLEL_PID_FILE'] = f.path - # Pids object should be created before threads will start adding pids to it - # Otherwise we would have to use Mutex to prevent creation of several instances - @pids = pids - yield - ensure - ENV['PARALLEL_PID_FILE'] = nil - @pids = nil - end + ENV['PARALLEL_PID_FILE'] = f.path + # Pids object should be created before threads will start adding pids to it + # Otherwise we would have to use Mutex to prevent creation of several instances + @pids = pids + yield + ensure + ENV['PARALLEL_PID_FILE'] = nil + @pids = nil end end diff --git a/lib/parallel_tests/cli.rb b/lib/parallel_tests/cli.rb index 7083bdd53..25f912c9f 100644 --- a/lib/parallel_tests/cli.rb +++ b/lib/parallel_tests/cli.rb @@ -105,13 +105,11 @@ def reprint_output(result, lockfile) def lock(lockfile) File.open(lockfile) do |lock| - begin - lock.flock File::LOCK_EX - yield - ensure - # This shouldn't be necessary, but appears to be - lock.flock File::LOCK_UN - end + lock.flock File::LOCK_EX + yield + ensure + # This shouldn't be necessary, but appears to be + lock.flock File::LOCK_UN end end @@ -228,12 +226,10 @@ def parse_options!(argv) opts.on("-e", "--exec [COMMAND]", "execute this code parallel and with ENV['TEST_ENV_NUMBER']") { |path| options[:execute] = path } opts.on("-o", "--test-options '[OPTIONS]'", "execute test commands with those options") { |arg| options[:test_options] = arg.lstrip } opts.on("-t", "--type [TYPE]", "test(default) / rspec / cucumber / spinach") do |type| - begin - @runner = load_runner(type) - rescue NameError, LoadError => e - puts "Runner for `#{type}` type has not been found! (#{e})" - abort - end + @runner = load_runner(type) + rescue NameError, LoadError => e + puts "Runner for `#{type}` type has not been found! (#{e})" + abort end opts.on( "--suffix [PATTERN]", diff --git a/parallel_tests.gemspec b/parallel_tests.gemspec index 4b329e94f..b6d5f3f9d 100644 --- a/parallel_tests.gemspec +++ b/parallel_tests.gemspec @@ -17,5 +17,5 @@ Gem::Specification.new name, ParallelTests::VERSION do |s| s.license = "MIT" s.executables = ["parallel_spinach", "parallel_cucumber", "parallel_rspec", "parallel_test"] s.add_runtime_dependency "parallel" - s.required_ruby_version = '>= 2.4.0' + s.required_ruby_version = '>= 2.5.0' end diff --git a/spec/fixtures/rails51/Gemfile b/spec/fixtures/rails51/Gemfile deleted file mode 100644 index b55c480eb..000000000 --- a/spec/fixtures/rails51/Gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true -source 'https://rubygems.org' - -gem 'rails', '5.1.6' -gem 'sqlite3' -gem 'tzinfo-data' -gem 'parallel_tests', path: "../../../", group: :development diff --git a/spec/fixtures/rails51/Gemfile.lock b/spec/fixtures/rails51/Gemfile.lock deleted file mode 100644 index fe7ad4b23..000000000 --- a/spec/fixtures/rails51/Gemfile.lock +++ /dev/null @@ -1,124 +0,0 @@ -PATH - remote: ../../.. - specs: - parallel_tests (3.4.0) - parallel - -GEM - remote: https://rubygems.org/ - specs: - actioncable (5.1.6) - actionpack (= 5.1.6) - nio4r (~> 2.0) - websocket-driver (~> 0.6.1) - actionmailer (5.1.6) - actionpack (= 5.1.6) - actionview (= 5.1.6) - activejob (= 5.1.6) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (5.1.6) - actionview (= 5.1.6) - activesupport (= 5.1.6) - rack (~> 2.0) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.1.6) - activesupport (= 5.1.6) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.1.6) - activesupport (= 5.1.6) - globalid (>= 0.3.6) - activemodel (5.1.6) - activesupport (= 5.1.6) - activerecord (5.1.6) - activemodel (= 5.1.6) - activesupport (= 5.1.6) - arel (~> 8.0) - activesupport (5.1.6) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - arel (8.0.0) - builder (3.2.3) - concurrent-ruby (1.0.5) - crass (1.0.4) - erubi (1.7.1) - globalid (0.4.1) - activesupport (>= 4.2.0) - i18n (1.1.1) - concurrent-ruby (~> 1.0) - loofah (2.2.2) - crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.1) - mini_mime (>= 0.1.1) - method_source (0.9.0) - mini_mime (1.0.1) - mini_portile2 (2.3.0) - minitest (5.11.3) - nio4r (2.3.1) - nokogiri (1.8.5) - mini_portile2 (~> 2.3.0) - parallel (1.20.1) - rack (2.0.5) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (5.1.6) - actioncable (= 5.1.6) - actionmailer (= 5.1.6) - actionpack (= 5.1.6) - actionview (= 5.1.6) - activejob (= 5.1.6) - activemodel (= 5.1.6) - activerecord (= 5.1.6) - activesupport (= 5.1.6) - bundler (>= 1.3.0) - railties (= 5.1.6) - sprockets-rails (>= 2.0.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) - nokogiri (>= 1.6) - rails-html-sanitizer (1.0.4) - loofah (~> 2.2, >= 2.2.2) - railties (5.1.6) - actionpack (= 5.1.6) - activesupport (= 5.1.6) - method_source - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (12.3.1) - sprockets (3.7.2) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.1) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - sqlite3 (1.3.13) - thor (0.20.0) - thread_safe (0.3.6) - tzinfo (1.2.5) - thread_safe (~> 0.1) - tzinfo-data (1.2019.3) - tzinfo (>= 1.0.0) - websocket-driver (0.6.5) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.3) - -PLATFORMS - ruby - -DEPENDENCIES - parallel_tests! - rails (= 5.1.6) - sqlite3 - tzinfo-data - -BUNDLED WITH - 2.1.4 diff --git a/spec/fixtures/rails51/app/assets/javascripts/application.js b/spec/fixtures/rails51/app/assets/javascripts/application.js deleted file mode 100644 index 46b20359f..000000000 --- a/spec/fixtures/rails51/app/assets/javascripts/application.js +++ /dev/null @@ -1,15 +0,0 @@ -// This is a manifest file that'll be compiled into application.js, which will include all the files -// listed below. -// -// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's -// vendor/assets/javascripts directory can be referenced here using a relative path. -// -// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// compiled file. JavaScript code in this file should be added after the last require_* statement. -// -// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details -// about supported directives. -// -//= require rails-ujs -//= require turbolinks -//= require_tree . diff --git a/spec/fixtures/rails51/app/controllers/application_controller.rb b/spec/fixtures/rails51/app/controllers/application_controller.rb deleted file mode 100644 index 6d369f832..000000000 --- a/spec/fixtures/rails51/app/controllers/application_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -# frozen_string_literal: true -class ApplicationController < ActionController::Base - protect_from_forgery with: :exception -end diff --git a/spec/fixtures/rails51/app/helpers/application_helper.rb b/spec/fixtures/rails51/app/helpers/application_helper.rb deleted file mode 100644 index 71249b93b..000000000 --- a/spec/fixtures/rails51/app/helpers/application_helper.rb +++ /dev/null @@ -1,3 +0,0 @@ -# frozen_string_literal: true -module ApplicationHelper -end diff --git a/spec/fixtures/rails51/app/jobs/application_job.rb b/spec/fixtures/rails51/app/jobs/application_job.rb deleted file mode 100644 index 32fe70b8e..000000000 --- a/spec/fixtures/rails51/app/jobs/application_job.rb +++ /dev/null @@ -1,3 +0,0 @@ -# frozen_string_literal: true -class ApplicationJob < ActiveJob::Base -end diff --git a/spec/fixtures/rails51/app/views/layouts/application.html.erb b/spec/fixtures/rails51/app/views/layouts/application.html.erb deleted file mode 100644 index 3d0d52825..000000000 --- a/spec/fixtures/rails51/app/views/layouts/application.html.erb +++ /dev/null @@ -1,14 +0,0 @@ - - - - Rails51 - <%= csrf_meta_tags %> - - <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> - <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> - - - - <%= yield %> - - diff --git a/spec/fixtures/rails51/bin/bundle b/spec/fixtures/rails51/bin/bundle deleted file mode 100755 index 74a18868b..000000000 --- a/spec/fixtures/rails51/bin/bundle +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) -load Gem.bin_path('bundler', 'bundle') diff --git a/spec/fixtures/rails51/bin/rails b/spec/fixtures/rails51/bin/rails deleted file mode 100755 index dd027b406..000000000 --- a/spec/fixtures/rails51/bin/rails +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -APP_PATH = File.expand_path('../config/application', __dir__) -require_relative '../config/boot' -require 'rails/commands' diff --git a/spec/fixtures/rails51/bin/update b/spec/fixtures/rails51/bin/update deleted file mode 100755 index 1594fcbcb..000000000 --- a/spec/fixtures/rails51/bin/update +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -require 'pathname' -require 'fileutils' -include FileUtils # rubocop:disable Style/MixinUsage - -# path to your application root. -APP_ROOT = Pathname.new File.expand_path('..', __dir__) - -def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") -end - -chdir APP_ROOT do - # This script is a way to update your development environment automatically. - # Add necessary update steps to this file. - - puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' - system('bundle check') || system!('bundle install') - - puts "\n== Updating database ==" - system! 'bin/rails db:migrate' - - puts "\n== Removing old logs and tempfiles ==" - system! 'bin/rails log:clear tmp:clear' - - puts "\n== Restarting application server ==" - system! 'bin/rails restart' -end diff --git a/spec/fixtures/rails51/bin/yarn b/spec/fixtures/rails51/bin/yarn deleted file mode 100755 index 0d571d110..000000000 --- a/spec/fixtures/rails51/bin/yarn +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -VENDOR_PATH = File.expand_path('..', __dir__) -Dir.chdir(VENDOR_PATH) do - begin - exec "yarnpkg #{ARGV.join(" ")}" - rescue Errno::ENOENT - warn "Yarn executable was not detected in the system." - warn "Download Yarn at https://yarnpkg.com/en/docs/install" - exit 1 - end -end diff --git a/spec/fixtures/rails51/config/application.rb b/spec/fixtures/rails51/config/application.rb deleted file mode 100644 index 7cec4d3ec..000000000 --- a/spec/fixtures/rails51/config/application.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true -require_relative 'boot' - -require 'rails/all' - -# Require the gems listed in Gemfile, including any gems -# you've limited to :test, :development, or :production. -Bundler.require(*Rails.groups) - -module Rails51 - class Application < Rails::Application - # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 5.1 - - # Settings in config/environments/* take precedence over those specified here. - # Application configuration should go into files in config/initializers - # -- all .rb files in that directory are automatically loaded. - end -end diff --git a/spec/fixtures/rails51/config/boot.rb b/spec/fixtures/rails51/config/boot.rb deleted file mode 100644 index 9be337a42..000000000 --- a/spec/fixtures/rails51/config/boot.rb +++ /dev/null @@ -1,4 +0,0 @@ -# frozen_string_literal: true -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) - -require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/spec/fixtures/rails51/config/cable.yml b/spec/fixtures/rails51/config/cable.yml deleted file mode 100644 index e40eb09e4..000000000 --- a/spec/fixtures/rails51/config/cable.yml +++ /dev/null @@ -1,10 +0,0 @@ -development: - adapter: async - -test: - adapter: async - -production: - adapter: redis - url: redis://localhost:6379/1 - channel_prefix: rails51_production diff --git a/spec/fixtures/rails51/config/initializers/assets.rb b/spec/fixtures/rails51/config/initializers/assets.rb deleted file mode 100644 index b6970c9e6..000000000 --- a/spec/fixtures/rails51/config/initializers/assets.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true -# Be sure to restart your server when you modify this file. - -# Version of your assets, change this if you want to expire all your assets. -Rails.application.config.assets.version = '1.0' - -# Add additional assets to the asset load path. -# Rails.application.config.assets.paths << Emoji.images_path -# Add Yarn node_modules folder to the asset load path. -Rails.application.config.assets.paths << Rails.root.join('node_modules') - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in the app/assets -# folder are already added. -# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/spec/fixtures/rails51/config/initializers/backtrace_silencers.rb b/spec/fixtures/rails51/config/initializers/backtrace_silencers.rb deleted file mode 100644 index d0f0d3b5d..000000000 --- a/spec/fixtures/rails51/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff --git a/spec/fixtures/rails51/config/puma.rb b/spec/fixtures/rails51/config/puma.rb deleted file mode 100644 index 3ea935c19..000000000 --- a/spec/fixtures/rails51/config/puma.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true -# 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. -# -threads_count = ENV.fetch("RAILS_MAX_THREADS", 5) -threads threads_count, threads_count - -# 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 number of `workers` to boot in clustered mode. -# Workers are forked webserver 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. If you use this option -# you need to make sure to reconnect any threads in the `on_worker_boot` -# block. -# -# preload_app! - -# If you are preloading your application and using Active Record, it's -# recommended that you close any connections to the database before workers -# are forked to prevent connection leakage. -# -# before_fork do -# ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord) -# end - -# The code in the `on_worker_boot` will be called if you are using -# clustered mode by specifying a number of `workers`. After each worker -# process is booted, this block will be run. If you are using the `preload_app!` -# option, you will want to use this block to reconnect to any threads -# or connections that may have been created at application boot, as Ruby -# cannot share connections between processes. -# -# on_worker_boot do -# ActiveRecord::Base.establish_connection if defined?(ActiveRecord) -# end -# - -# Allow puma to be restarted by `rails restart` command. -plugin :tmp_restart diff --git a/spec/fixtures/rails51/config/routes.rb b/spec/fixtures/rails51/config/routes.rb deleted file mode 100644 index 6bf1218e2..000000000 --- a/spec/fixtures/rails51/config/routes.rb +++ /dev/null @@ -1,4 +0,0 @@ -# frozen_string_literal: true -Rails.application.routes.draw do - # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html -end diff --git a/spec/fixtures/rails51/config/secrets.yml b/spec/fixtures/rails51/config/secrets.yml deleted file mode 100644 index ce38993f6..000000000 --- a/spec/fixtures/rails51/config/secrets.yml +++ /dev/null @@ -1,32 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rails secret` to generate a secure secret key. - -# Make sure the secrets in this file are kept private -# if you're sharing your code publicly. - -# Shared secrets are available across all environments. - -# shared: -# api_key: a1B2c3D4e5F6 - -# Environmental secrets are only available for that specific environment. - -development: - secret_key_base: af5bb48e3a90b938d2aeaf8afd214eb048a2914b0e3b6aeb01633048e29fbd36891ecdb3973a14b66544c86e460065fc0b7a5bc945cdc885c1149c7d36c8f764 - -test: - secret_key_base: 46f5f95eca19f28e3c1b8370b070c96fd1f2f62b817fad9e6b51e95944dba1171ea3c3d96e92106ed3f0e59c288ee259b05efbc44632636857aeb40ffe2ece7e - -# Do not keep production secrets in the unencrypted secrets file. -# Instead, either read values from the environment. -# Or, use `bin/rails secrets:setup` to configure encrypted secrets -# and move the `production:` environment over there. - -production: - secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/spec/fixtures/rails51/db/schema.rb b/spec/fixtures/rails51/db/schema.rb deleted file mode 100644 index 8bb85b8f8..000000000 --- a/spec/fixtures/rails51/db/schema.rb +++ /dev/null @@ -1,21 +0,0 @@ -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended that you check this file into your version control system. - -ActiveRecord::Schema.define(version: 20181024130108) do - - create_table "users", force: :cascade do |t| - t.string "name" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - -end diff --git a/spec/fixtures/rails51/package.json b/spec/fixtures/rails51/package.json deleted file mode 100644 index 3d33606a0..000000000 --- a/spec/fixtures/rails51/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "rails51", - "private": true, - "dependencies": {} -} diff --git a/spec/fixtures/rails51/public/robots.txt b/spec/fixtures/rails51/public/robots.txt deleted file mode 100644 index 37b576a4a..000000000 --- a/spec/fixtures/rails51/public/robots.txt +++ /dev/null @@ -1 +0,0 @@ -# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file diff --git a/spec/fixtures/rails51/test/fixtures/users.yml b/spec/fixtures/rails51/test/fixtures/users.yml deleted file mode 100644 index 56066c68a..000000000 --- a/spec/fixtures/rails51/test/fixtures/users.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - name: MyString - -two: - name: MyString diff --git a/spec/fixtures/rails51/test/models/user2_test.rb b/spec/fixtures/rails51/test/models/user2_test.rb deleted file mode 100644 index bcebe28c8..000000000 --- a/spec/fixtures/rails51/test/models/user2_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true -require 'test_helper' - -class User2Test < ActiveSupport::TestCase - test "the truth" do - User.create - end -end diff --git a/spec/fixtures/rails51/test/models/user_test.rb b/spec/fixtures/rails51/test/models/user_test.rb deleted file mode 100644 index 045d9e148..000000000 --- a/spec/fixtures/rails51/test/models/user_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true -require 'test_helper' - -class UserTest < ActiveSupport::TestCase - test "the truth" do - User.create - end -end diff --git a/spec/fixtures/rails52/.ruby-version b/spec/fixtures/rails52/.ruby-version deleted file mode 100644 index a4db534a2..000000000 --- a/spec/fixtures/rails52/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.5.3 \ No newline at end of file diff --git a/spec/fixtures/rails52/Gemfile b/spec/fixtures/rails52/Gemfile deleted file mode 100644 index 34b52d996..000000000 --- a/spec/fixtures/rails52/Gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true -source 'https://rubygems.org' - -gem 'rails', '5.2.1' -gem 'sqlite3' -gem 'tzinfo-data' -gem 'parallel_tests', path: "../../../", group: :development diff --git a/spec/fixtures/rails52/Gemfile.lock b/spec/fixtures/rails52/Gemfile.lock deleted file mode 100644 index 16f228f8a..000000000 --- a/spec/fixtures/rails52/Gemfile.lock +++ /dev/null @@ -1,132 +0,0 @@ -PATH - remote: ../../.. - specs: - parallel_tests (3.4.0) - parallel - -GEM - remote: https://rubygems.org/ - specs: - actioncable (5.2.1) - actionpack (= 5.2.1) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailer (5.2.1) - actionpack (= 5.2.1) - actionview (= 5.2.1) - activejob (= 5.2.1) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (5.2.1) - actionview (= 5.2.1) - activesupport (= 5.2.1) - rack (~> 2.0) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.1) - activesupport (= 5.2.1) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.1) - activesupport (= 5.2.1) - globalid (>= 0.3.6) - activemodel (5.2.1) - activesupport (= 5.2.1) - activerecord (5.2.1) - activemodel (= 5.2.1) - activesupport (= 5.2.1) - arel (>= 9.0) - activestorage (5.2.1) - actionpack (= 5.2.1) - activerecord (= 5.2.1) - marcel (~> 0.3.1) - activesupport (5.2.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - arel (9.0.0) - builder (3.2.3) - concurrent-ruby (1.0.5) - crass (1.0.4) - erubi (1.7.1) - globalid (0.4.1) - activesupport (>= 4.2.0) - i18n (1.1.1) - concurrent-ruby (~> 1.0) - loofah (2.2.2) - crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.1) - mini_mime (>= 0.1.1) - marcel (0.3.3) - mimemagic (~> 0.3.2) - method_source (0.9.0) - mimemagic (0.3.2) - mini_mime (1.0.1) - mini_portile2 (2.3.0) - minitest (5.11.3) - nio4r (2.3.1) - nokogiri (1.8.5) - mini_portile2 (~> 2.3.0) - parallel (1.20.1) - rack (2.0.5) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (5.2.1) - actioncable (= 5.2.1) - actionmailer (= 5.2.1) - actionpack (= 5.2.1) - actionview (= 5.2.1) - activejob (= 5.2.1) - activemodel (= 5.2.1) - activerecord (= 5.2.1) - activestorage (= 5.2.1) - activesupport (= 5.2.1) - bundler (>= 1.3.0) - railties (= 5.2.1) - sprockets-rails (>= 2.0.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) - nokogiri (>= 1.6) - rails-html-sanitizer (1.0.4) - loofah (~> 2.2, >= 2.2.2) - railties (5.2.1) - actionpack (= 5.2.1) - activesupport (= 5.2.1) - method_source - rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) - rake (12.3.1) - sprockets (3.7.2) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.1) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - sqlite3 (1.3.13) - thor (0.20.0) - thread_safe (0.3.6) - tzinfo (1.2.5) - thread_safe (~> 0.1) - tzinfo-data (1.2019.3) - tzinfo (>= 1.0.0) - websocket-driver (0.7.0) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.3) - -PLATFORMS - ruby - -DEPENDENCIES - parallel_tests! - rails (= 5.2.1) - sqlite3 - tzinfo-data - -BUNDLED WITH - 2.1.4 diff --git a/spec/fixtures/rails52/app/assets/javascripts/application.js b/spec/fixtures/rails52/app/assets/javascripts/application.js deleted file mode 100644 index 82e6f0f6c..000000000 --- a/spec/fixtures/rails52/app/assets/javascripts/application.js +++ /dev/null @@ -1,16 +0,0 @@ -// This is a manifest file that'll be compiled into application.js, which will include all the files -// listed below. -// -// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's -// vendor/assets/javascripts directory can be referenced here using a relative path. -// -// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// compiled file. JavaScript code in this file should be added after the last require_* statement. -// -// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details -// about supported directives. -// -//= require rails-ujs -//= require activestorage -//= require turbolinks -//= require_tree . diff --git a/spec/fixtures/rails52/app/assets/javascripts/cable.js b/spec/fixtures/rails52/app/assets/javascripts/cable.js deleted file mode 100644 index 739aa5f02..000000000 --- a/spec/fixtures/rails52/app/assets/javascripts/cable.js +++ /dev/null @@ -1,13 +0,0 @@ -// Action Cable provides the framework to deal with WebSockets in Rails. -// You can generate new channels where WebSocket features live using the `rails generate channel` command. -// -//= require action_cable -//= require_self -//= require_tree ./channels - -(function() { - this.App || (this.App = {}); - - App.cable = ActionCable.createConsumer(); - -}).call(this); diff --git a/spec/fixtures/rails52/app/helpers/application_helper.rb b/spec/fixtures/rails52/app/helpers/application_helper.rb deleted file mode 100644 index 71249b93b..000000000 --- a/spec/fixtures/rails52/app/helpers/application_helper.rb +++ /dev/null @@ -1,3 +0,0 @@ -# frozen_string_literal: true -module ApplicationHelper -end diff --git a/spec/fixtures/rails52/app/jobs/application_job.rb b/spec/fixtures/rails52/app/jobs/application_job.rb deleted file mode 100644 index 32fe70b8e..000000000 --- a/spec/fixtures/rails52/app/jobs/application_job.rb +++ /dev/null @@ -1,3 +0,0 @@ -# frozen_string_literal: true -class ApplicationJob < ActiveJob::Base -end diff --git a/spec/fixtures/rails52/app/views/layouts/application.html.erb b/spec/fixtures/rails52/app/views/layouts/application.html.erb deleted file mode 100644 index 318a1529a..000000000 --- a/spec/fixtures/rails52/app/views/layouts/application.html.erb +++ /dev/null @@ -1,15 +0,0 @@ - - - - Rails52 - <%= csrf_meta_tags %> - <%= csp_meta_tag %> - - <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> - <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> - - - - <%= yield %> - - diff --git a/spec/fixtures/rails52/bin/bundle b/spec/fixtures/rails52/bin/bundle deleted file mode 100755 index 74a18868b..000000000 --- a/spec/fixtures/rails52/bin/bundle +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) -load Gem.bin_path('bundler', 'bundle') diff --git a/spec/fixtures/rails52/bin/rake b/spec/fixtures/rails52/bin/rake deleted file mode 100755 index 609af7470..000000000 --- a/spec/fixtures/rails52/bin/rake +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -require_relative '../config/boot' -require 'rake' -Rake.application.run diff --git a/spec/fixtures/rails52/bin/update b/spec/fixtures/rails52/bin/update deleted file mode 100755 index 4cc53024e..000000000 --- a/spec/fixtures/rails52/bin/update +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -require 'fileutils' -include FileUtils # rubocop:disable Style/MixinUsage - -# path to your application root. -APP_ROOT = File.expand_path('..', __dir__) - -def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") -end - -chdir APP_ROOT do - # This script is a way to update your development environment automatically. - # Add necessary update steps to this file. - - puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' - system('bundle check') || system!('bundle install') - - # Install JavaScript dependencies if using Yarn - # system('bin/yarn') - - puts "\n== Updating database ==" - system! 'bin/rails db:migrate' - - puts "\n== Removing old logs and tempfiles ==" - system! 'bin/rails log:clear tmp:clear' - - puts "\n== Restarting application server ==" - system! 'bin/rails restart' -end diff --git a/spec/fixtures/rails52/bin/yarn b/spec/fixtures/rails52/bin/yarn deleted file mode 100755 index d5619dbd6..000000000 --- a/spec/fixtures/rails52/bin/yarn +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true -APP_ROOT = File.expand_path('..', __dir__) -Dir.chdir(APP_ROOT) do - begin - exec "yarnpkg", *ARGV - rescue Errno::ENOENT - warn "Yarn executable was not detected in the system." - warn "Download Yarn at https://yarnpkg.com/en/docs/install" - exit 1 - end -end diff --git a/spec/fixtures/rails52/config/credentials.yml.enc b/spec/fixtures/rails52/config/credentials.yml.enc deleted file mode 100644 index a8d1858af..000000000 --- a/spec/fixtures/rails52/config/credentials.yml.enc +++ /dev/null @@ -1 +0,0 @@ -56tStLZJJzxR8hQ5NcvwzMWuLGRc8y4/pk141nnv0DdNlD8uQRYIsm/YkpxJyoU3tyY1/IcdqmVU0JAUkvvaW1+RrwjtF7O0S2YSGxQ/HW0qzIFMt3BmkP3ECmdDGi5nXhRDMUNrQZdQs+aPhRhQB8eKklFeuC8ayKNPWgAzs2UW96TW0/kTHCIi4VNje3fjEPAF6yDXDUBr6RKUXFEJdWMMxSYr1CDEQKOQHj8HET+fRQG08qvpN7BDsv4Uvg8ijO4i1wTabfM1PRGbtw1wFeZzDvOIz58JCqA1ZbgsY4eDGZgpDVx+TT2fuFsG8utWoj7zgsNdNJoYNWsKD/Q1uEgJTDHq2FEdkesJ8gT5XhcfvkuUcwQloEGazeiTQKQ6qGmK8ieZf8HyRGicNsC3/rbHVKk2Zovipvlx--LQpkmklfLtm6EHJQ--I2YLoXnjDTX72UEv1cgHog== \ No newline at end of file diff --git a/spec/fixtures/rails52/config/initializers/assets.rb b/spec/fixtures/rails52/config/initializers/assets.rb deleted file mode 100644 index b6970c9e6..000000000 --- a/spec/fixtures/rails52/config/initializers/assets.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true -# Be sure to restart your server when you modify this file. - -# Version of your assets, change this if you want to expire all your assets. -Rails.application.config.assets.version = '1.0' - -# Add additional assets to the asset load path. -# Rails.application.config.assets.paths << Emoji.images_path -# Add Yarn node_modules folder to the asset load path. -Rails.application.config.assets.paths << Rails.root.join('node_modules') - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in the app/assets -# folder are already added. -# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/spec/fixtures/rails52/config/routes.rb b/spec/fixtures/rails52/config/routes.rb deleted file mode 100644 index 6bf1218e2..000000000 --- a/spec/fixtures/rails52/config/routes.rb +++ /dev/null @@ -1,4 +0,0 @@ -# frozen_string_literal: true -Rails.application.routes.draw do - # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html -end diff --git a/spec/fixtures/rails52/config/storage.yml b/spec/fixtures/rails52/config/storage.yml deleted file mode 100644 index d32f76e8f..000000000 --- a/spec/fixtures/rails52/config/storage.yml +++ /dev/null @@ -1,34 +0,0 @@ -test: - service: Disk - root: <%= Rails.root.join("tmp/storage") %> - -local: - service: Disk - root: <%= Rails.root.join("storage") %> - -# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) -# amazon: -# service: S3 -# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> -# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> -# region: us-east-1 -# bucket: your_own_bucket - -# Remember not to checkin your GCS keyfile to a repository -# google: -# service: GCS -# project: your_project -# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> -# bucket: your_own_bucket - -# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) -# microsoft: -# service: AzureStorage -# storage_account_name: your_account_name -# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> -# container: your_container_name - -# mirror: -# service: Mirror -# primary: local -# mirrors: [ amazon, google, microsoft ] diff --git a/spec/fixtures/rails52/db/schema.rb b/spec/fixtures/rails52/db/schema.rb deleted file mode 100644 index 733245696..000000000 --- a/spec/fixtures/rails52/db/schema.rb +++ /dev/null @@ -1,21 +0,0 @@ -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended that you check this file into your version control system. - -ActiveRecord::Schema.define(version: 2018_10_24_130151) do - - create_table "users", force: :cascade do |t| - t.string "name" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - -end diff --git a/spec/fixtures/rails52/package.json b/spec/fixtures/rails52/package.json deleted file mode 100644 index 3a0a0d7c3..000000000 --- a/spec/fixtures/rails52/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "rails52", - "private": true, - "dependencies": {} -} diff --git a/spec/fixtures/rails52/public/robots.txt b/spec/fixtures/rails52/public/robots.txt deleted file mode 100644 index 37b576a4a..000000000 --- a/spec/fixtures/rails52/public/robots.txt +++ /dev/null @@ -1 +0,0 @@ -# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file diff --git a/spec/fixtures/rails52/test/fixtures/users.yml b/spec/fixtures/rails52/test/fixtures/users.yml deleted file mode 100644 index 56066c68a..000000000 --- a/spec/fixtures/rails52/test/fixtures/users.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - name: MyString - -two: - name: MyString diff --git a/spec/fixtures/rails52/test/mailers/.keep b/spec/fixtures/rails52/test/mailers/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/spec/fixtures/rails52/test/models/.keep b/spec/fixtures/rails52/test/models/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/spec/fixtures/rails52/test/models/user2_test.rb b/spec/fixtures/rails52/test/models/user2_test.rb deleted file mode 100644 index bcebe28c8..000000000 --- a/spec/fixtures/rails52/test/models/user2_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true -require 'test_helper' - -class User2Test < ActiveSupport::TestCase - test "the truth" do - User.create - end -end diff --git a/spec/fixtures/rails52/test/models/user_test.rb b/spec/fixtures/rails52/test/models/user_test.rb deleted file mode 100644 index 045d9e148..000000000 --- a/spec/fixtures/rails52/test/models/user_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true -require 'test_helper' - -class UserTest < ActiveSupport::TestCase - test "the truth" do - User.create - end -end diff --git a/spec/fixtures/rails52/test/system/.keep b/spec/fixtures/rails52/test/system/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/spec/fixtures/rails52/vendor/.keep b/spec/fixtures/rails52/vendor/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/spec/fixtures/rails52/.gitignore b/spec/fixtures/rails60/.gitignore similarity index 85% rename from spec/fixtures/rails52/.gitignore rename to spec/fixtures/rails60/.gitignore index 81452db92..3fd725c86 100644 --- a/spec/fixtures/rails52/.gitignore +++ b/spec/fixtures/rails60/.gitignore @@ -10,6 +10,7 @@ # Ignore the default SQLite database. /db/*.sqlite3 /db/*.sqlite3-journal +/db/*.sqlite3-* # Ignore all logfiles and tempfiles. /log/* @@ -17,12 +18,11 @@ !/log/.keep !/tmp/.keep -# Ignore uploaded files in development -/storage/* -!/storage/.keep +# Ignore pidfiles, but keep the directory. +/tmp/pids/* +!/tmp/pids/ +!/tmp/pids/.keep -/node_modules -/yarn-error.log /public/assets .byebug_history diff --git a/spec/fixtures/rails60/.ruby-version b/spec/fixtures/rails60/.ruby-version new file mode 100644 index 000000000..4a36342fc --- /dev/null +++ b/spec/fixtures/rails60/.ruby-version @@ -0,0 +1 @@ +3.0.0 diff --git a/spec/fixtures/rails60/Gemfile b/spec/fixtures/rails60/Gemfile new file mode 100644 index 000000000..75e568a27 --- /dev/null +++ b/spec/fixtures/rails60/Gemfile @@ -0,0 +1,19 @@ +# frozen_string_literal: true +source 'https://rubygems.org' + +rails_version = '6.0.3' + +gem 'actioncable', rails_version +gem 'actionmailer', rails_version +gem 'actionpack', rails_version +gem 'actionview', rails_version +gem 'activejob', rails_version +gem 'activemodel', rails_version +gem 'activerecord', rails_version +gem 'activesupport', rails_version +gem 'railties', rails_version +gem 'sprockets-rails' + +gem 'sqlite3' +gem 'tzinfo-data' +gem 'parallel_tests', path: "../../../", group: :development diff --git a/spec/fixtures/rails60/Gemfile.lock b/spec/fixtures/rails60/Gemfile.lock new file mode 100644 index 000000000..e27df67c7 --- /dev/null +++ b/spec/fixtures/rails60/Gemfile.lock @@ -0,0 +1,124 @@ +PATH + remote: ../../.. + specs: + parallel_tests (3.5.2) + parallel + +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.0.3) + actionpack (= 6.0.3) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailer (6.0.3) + actionpack (= 6.0.3) + actionview (= 6.0.3) + activejob (= 6.0.3) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.0.3) + actionview (= 6.0.3) + activesupport (= 6.0.3) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actionview (6.0.3) + activesupport (= 6.0.3) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.3) + activesupport (= 6.0.3) + globalid (>= 0.3.6) + activemodel (6.0.3) + activesupport (= 6.0.3) + activerecord (6.0.3) + activemodel (= 6.0.3) + activesupport (= 6.0.3) + activesupport (6.0.3) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2, >= 2.2.2) + builder (3.2.4) + concurrent-ruby (1.1.8) + crass (1.0.6) + erubi (1.10.0) + globalid (0.4.2) + activesupport (>= 4.2.0) + i18n (1.8.9) + concurrent-ruby (~> 1.0) + loofah (2.9.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + method_source (1.0.0) + mini_mime (1.0.2) + minitest (5.14.4) + nio4r (2.5.7) + nokogiri (1.11.2-x64-mingw32) + racc (~> 1.4) + nokogiri (1.11.2-x86_64-linux) + racc (~> 1.4) + parallel (1.20.1) + racc (1.5.2) + rack (2.2.3) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (6.0.3) + actionpack (= 6.0.3) + activesupport (= 6.0.3) + method_source + rake (>= 0.8.7) + thor (>= 0.20.3, < 2.0) + rake (13.0.3) + sprockets (4.0.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.2) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + thor (1.1.0) + thread_safe (0.3.6) + tzinfo (1.2.9) + thread_safe (~> 0.1) + tzinfo-data (1.2021.1) + tzinfo (>= 1.0.0) + websocket-driver (0.7.3) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.4.2) + +PLATFORMS + x64-mingw32 + x86_64-linux + +DEPENDENCIES + actioncable (= 6.0.3) + actionmailer (= 6.0.3) + actionpack (= 6.0.3) + actionview (= 6.0.3) + activejob (= 6.0.3) + activemodel (= 6.0.3) + activerecord (= 6.0.3) + activesupport (= 6.0.3) + parallel_tests! + railties (= 6.0.3) + sprockets-rails + sqlite3 + tzinfo-data + +BUNDLED WITH + 2.2.15 diff --git a/spec/fixtures/rails51/README.md b/spec/fixtures/rails60/README.md similarity index 100% rename from spec/fixtures/rails51/README.md rename to spec/fixtures/rails60/README.md diff --git a/spec/fixtures/rails52/Rakefile b/spec/fixtures/rails60/Rakefile similarity index 88% rename from spec/fixtures/rails52/Rakefile rename to spec/fixtures/rails60/Rakefile index 84f2bc394..e85f91391 100644 --- a/spec/fixtures/rails52/Rakefile +++ b/spec/fixtures/rails60/Rakefile @@ -1,4 +1,3 @@ -# frozen_string_literal: true # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. diff --git a/spec/fixtures/rails51/app/assets/config/manifest.js b/spec/fixtures/rails60/app/assets/config/manifest.js similarity index 62% rename from spec/fixtures/rails51/app/assets/config/manifest.js rename to spec/fixtures/rails60/app/assets/config/manifest.js index b16e53d6d..591819335 100644 --- a/spec/fixtures/rails51/app/assets/config/manifest.js +++ b/spec/fixtures/rails60/app/assets/config/manifest.js @@ -1,3 +1,2 @@ //= link_tree ../images -//= link_directory ../javascripts .js //= link_directory ../stylesheets .css diff --git a/spec/fixtures/rails51/app/assets/images/.keep b/spec/fixtures/rails60/app/assets/images/.keep similarity index 100% rename from spec/fixtures/rails51/app/assets/images/.keep rename to spec/fixtures/rails60/app/assets/images/.keep diff --git a/spec/fixtures/rails51/app/assets/stylesheets/application.css b/spec/fixtures/rails60/app/assets/stylesheets/application.css similarity index 100% rename from spec/fixtures/rails51/app/assets/stylesheets/application.css rename to spec/fixtures/rails60/app/assets/stylesheets/application.css diff --git a/spec/fixtures/rails51/app/channels/application_cable/channel.rb b/spec/fixtures/rails60/app/channels/application_cable/channel.rb similarity index 72% rename from spec/fixtures/rails51/app/channels/application_cable/channel.rb rename to spec/fixtures/rails60/app/channels/application_cable/channel.rb index 51e3e936b..d67269728 100644 --- a/spec/fixtures/rails51/app/channels/application_cable/channel.rb +++ b/spec/fixtures/rails60/app/channels/application_cable/channel.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true module ApplicationCable class Channel < ActionCable::Channel::Base end diff --git a/spec/fixtures/rails51/app/channels/application_cable/connection.rb b/spec/fixtures/rails60/app/channels/application_cable/connection.rb similarity index 73% rename from spec/fixtures/rails51/app/channels/application_cable/connection.rb rename to spec/fixtures/rails60/app/channels/application_cable/connection.rb index fa70319da..0ff5442f4 100644 --- a/spec/fixtures/rails51/app/channels/application_cable/connection.rb +++ b/spec/fixtures/rails60/app/channels/application_cable/connection.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true module ApplicationCable class Connection < ActionCable::Connection::Base end diff --git a/spec/fixtures/rails52/app/controllers/application_controller.rb b/spec/fixtures/rails60/app/controllers/application_controller.rb similarity index 65% rename from spec/fixtures/rails52/app/controllers/application_controller.rb rename to spec/fixtures/rails60/app/controllers/application_controller.rb index e0491348f..09705d12a 100644 --- a/spec/fixtures/rails52/app/controllers/application_controller.rb +++ b/spec/fixtures/rails60/app/controllers/application_controller.rb @@ -1,3 +1,2 @@ -# frozen_string_literal: true class ApplicationController < ActionController::Base end diff --git a/spec/fixtures/rails51/app/assets/javascripts/channels/.keep b/spec/fixtures/rails60/app/controllers/concerns/.keep similarity index 100% rename from spec/fixtures/rails51/app/assets/javascripts/channels/.keep rename to spec/fixtures/rails60/app/controllers/concerns/.keep diff --git a/spec/fixtures/rails60/app/helpers/application_helper.rb b/spec/fixtures/rails60/app/helpers/application_helper.rb new file mode 100644 index 000000000..de6be7945 --- /dev/null +++ b/spec/fixtures/rails60/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/spec/fixtures/rails51/app/assets/javascripts/cable.js b/spec/fixtures/rails60/app/javascript/channels/consumer.js similarity index 50% rename from spec/fixtures/rails51/app/assets/javascripts/cable.js rename to spec/fixtures/rails60/app/javascript/channels/consumer.js index 739aa5f02..0eceb59b1 100644 --- a/spec/fixtures/rails51/app/assets/javascripts/cable.js +++ b/spec/fixtures/rails60/app/javascript/channels/consumer.js @@ -1,13 +1,6 @@ // Action Cable provides the framework to deal with WebSockets in Rails. // You can generate new channels where WebSocket features live using the `rails generate channel` command. -// -//= require action_cable -//= require_self -//= require_tree ./channels -(function() { - this.App || (this.App = {}); +import { createConsumer } from "@rails/actioncable" - App.cable = ActionCable.createConsumer(); - -}).call(this); +export default createConsumer() diff --git a/spec/fixtures/rails60/app/javascript/channels/index.js b/spec/fixtures/rails60/app/javascript/channels/index.js new file mode 100644 index 000000000..0cfcf7491 --- /dev/null +++ b/spec/fixtures/rails60/app/javascript/channels/index.js @@ -0,0 +1,5 @@ +// Load all the channels within this directory and all subdirectories. +// Channel files must be named *_channel.js. + +const channels = require.context('.', true, /_channel\.js$/) +channels.keys().forEach(channels) diff --git a/spec/fixtures/rails60/app/javascript/packs/application.js b/spec/fixtures/rails60/app/javascript/packs/application.js new file mode 100644 index 000000000..28d74208c --- /dev/null +++ b/spec/fixtures/rails60/app/javascript/packs/application.js @@ -0,0 +1,16 @@ +// This file is automatically compiled by Webpack, along with any other files +// present in this directory. You're encouraged to place your actual application logic in +// a relevant structure within app/javascript and only use these pack files to reference +// that code so it'll be compiled. + +require("@rails/ujs").start() +require("turbolinks").start() +require("channels") + + +// Uncomment to copy all static images under ../images to the output folder and reference +// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>) +// or the `imagePath` JavaScript helper below. +// +// const images = require.context('../images', true) +// const imagePath = (name) => images(name, true) diff --git a/spec/fixtures/rails60/app/jobs/application_job.rb b/spec/fixtures/rails60/app/jobs/application_job.rb new file mode 100644 index 000000000..d394c3d10 --- /dev/null +++ b/spec/fixtures/rails60/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError +end diff --git a/spec/fixtures/rails52/app/mailers/application_mailer.rb b/spec/fixtures/rails60/app/mailers/application_mailer.rb similarity index 77% rename from spec/fixtures/rails52/app/mailers/application_mailer.rb rename to spec/fixtures/rails60/app/mailers/application_mailer.rb index 24289009a..286b2239d 100644 --- a/spec/fixtures/rails52/app/mailers/application_mailer.rb +++ b/spec/fixtures/rails60/app/mailers/application_mailer.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true class ApplicationMailer < ActionMailer::Base default from: 'from@example.com' layout 'mailer' diff --git a/spec/fixtures/rails52/app/models/application_record.rb b/spec/fixtures/rails60/app/models/application_record.rb similarity index 72% rename from spec/fixtures/rails52/app/models/application_record.rb rename to spec/fixtures/rails60/app/models/application_record.rb index 767a072b5..10a4cba84 100644 --- a/spec/fixtures/rails52/app/models/application_record.rb +++ b/spec/fixtures/rails60/app/models/application_record.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true class ApplicationRecord < ActiveRecord::Base self.abstract_class = true end diff --git a/spec/fixtures/rails51/app/controllers/concerns/.keep b/spec/fixtures/rails60/app/models/concerns/.keep similarity index 100% rename from spec/fixtures/rails51/app/controllers/concerns/.keep rename to spec/fixtures/rails60/app/models/concerns/.keep diff --git a/spec/fixtures/rails51/app/models/user.rb b/spec/fixtures/rails60/app/models/user.rb similarity index 53% rename from spec/fixtures/rails51/app/models/user.rb rename to spec/fixtures/rails60/app/models/user.rb index b161db0c3..379658a50 100644 --- a/spec/fixtures/rails51/app/models/user.rb +++ b/spec/fixtures/rails60/app/models/user.rb @@ -1,3 +1,2 @@ -# frozen_string_literal: true class User < ApplicationRecord end diff --git a/spec/fixtures/rails60/app/views/layouts/application.html.erb b/spec/fixtures/rails60/app/views/layouts/application.html.erb new file mode 100644 index 000000000..60ee8159f --- /dev/null +++ b/spec/fixtures/rails60/app/views/layouts/application.html.erb @@ -0,0 +1,15 @@ + + + + Rails60 + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> + <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> + + + + <%= yield %> + + diff --git a/spec/fixtures/rails51/app/views/layouts/mailer.html.erb b/spec/fixtures/rails60/app/views/layouts/mailer.html.erb similarity index 100% rename from spec/fixtures/rails51/app/views/layouts/mailer.html.erb rename to spec/fixtures/rails60/app/views/layouts/mailer.html.erb diff --git a/spec/fixtures/rails51/app/views/layouts/mailer.text.erb b/spec/fixtures/rails60/app/views/layouts/mailer.text.erb similarity index 100% rename from spec/fixtures/rails51/app/views/layouts/mailer.text.erb rename to spec/fixtures/rails60/app/views/layouts/mailer.text.erb diff --git a/spec/fixtures/rails52/bin/rails b/spec/fixtures/rails60/bin/rails similarity index 82% rename from spec/fixtures/rails52/bin/rails rename to spec/fixtures/rails60/bin/rails index dd027b406..073966023 100755 --- a/spec/fixtures/rails52/bin/rails +++ b/spec/fixtures/rails60/bin/rails @@ -1,5 +1,4 @@ #!/usr/bin/env ruby -# frozen_string_literal: true APP_PATH = File.expand_path('../config/application', __dir__) require_relative '../config/boot' require 'rails/commands' diff --git a/spec/fixtures/rails51/bin/rake b/spec/fixtures/rails60/bin/rake similarity index 75% rename from spec/fixtures/rails51/bin/rake rename to spec/fixtures/rails60/bin/rake index 609af7470..17240489f 100755 --- a/spec/fixtures/rails51/bin/rake +++ b/spec/fixtures/rails60/bin/rake @@ -1,5 +1,4 @@ #!/usr/bin/env ruby -# frozen_string_literal: true require_relative '../config/boot' require 'rake' Rake.application.run diff --git a/spec/fixtures/rails52/bin/setup b/spec/fixtures/rails60/bin/setup similarity index 67% rename from spec/fixtures/rails52/bin/setup rename to spec/fixtures/rails60/bin/setup index e876cef46..5853b5ea8 100755 --- a/spec/fixtures/rails52/bin/setup +++ b/spec/fixtures/rails60/bin/setup @@ -1,7 +1,5 @@ #!/usr/bin/env ruby -# frozen_string_literal: true require 'fileutils' -include FileUtils # rubocop:disable Style/MixinUsage # path to your application root. APP_ROOT = File.expand_path('..', __dir__) @@ -10,24 +8,25 @@ def system!(*args) system(*args) || abort("\n== Command #{args} failed ==") end -chdir APP_ROOT do - # This script is a starting point to setup your application. +FileUtils.chdir APP_ROOT do + # This script is a way to setup or update your development environment automatically. + # This script is idempotent, so that you can run it at anytime and get an expectable outcome. # Add necessary setup steps to this file. puts '== Installing dependencies ==' system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') - # Install JavaScript dependencies if using Yarn + # Install JavaScript dependencies # system('bin/yarn') # puts "\n== Copying sample files ==" # unless File.exist?('config/database.yml') - # cp 'config/database.yml.sample', 'config/database.yml' + # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' # end puts "\n== Preparing database ==" - system! 'bin/rails db:setup' + system! 'bin/rails db:prepare' puts "\n== Removing old logs and tempfiles ==" system! 'bin/rails log:clear tmp:clear' diff --git a/spec/fixtures/rails60/bin/yarn b/spec/fixtures/rails60/bin/yarn new file mode 100755 index 000000000..b24854dce --- /dev/null +++ b/spec/fixtures/rails60/bin/yarn @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +APP_ROOT = File.expand_path('..', __dir__) +Dir.chdir(APP_ROOT) do + exec "yarnpkg", *ARGV +rescue Errno::ENOENT + warn "Yarn executable was not detected in the system." + warn "Download Yarn at https://yarnpkg.com/en/docs/install" + exit 1 +end diff --git a/spec/fixtures/rails51/config.ru b/spec/fixtures/rails60/config.ru similarity index 81% rename from spec/fixtures/rails51/config.ru rename to spec/fixtures/rails60/config.ru index 7eae2644f..f7ba0b527 100644 --- a/spec/fixtures/rails51/config.ru +++ b/spec/fixtures/rails60/config.ru @@ -1,4 +1,3 @@ -# frozen_string_literal: true # This file is used by Rack-based servers to start the application. require_relative 'config/environment' diff --git a/spec/fixtures/rails52/config/application.rb b/spec/fixtures/rails60/config/application.rb similarity index 55% rename from spec/fixtures/rails52/config/application.rb rename to spec/fixtures/rails60/config/application.rb index 5cccc17df..c596e99c8 100644 --- a/spec/fixtures/rails52/config/application.rb +++ b/spec/fixtures/rails60/config/application.rb @@ -1,16 +1,28 @@ -# frozen_string_literal: true require_relative 'boot' -require 'rails/all' +require "rails" +# Pick the frameworks you want: +require "active_model/railtie" +require "active_job/railtie" +require "active_record/railtie" +# require "active_storage/engine" +require "action_controller/railtie" +require "action_mailer/railtie" +# require "action_mailbox/engine" +# require "action_text/engine" +require "action_view/railtie" +require "action_cable/engine" +# require "sprockets/railtie" +require "rails/test_unit/railtie" # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) -module Rails52 +module Rails60 class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 5.2 + config.load_defaults 6.0 # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers diff --git a/spec/fixtures/rails52/config/boot.rb b/spec/fixtures/rails60/config/boot.rb similarity index 81% rename from spec/fixtures/rails52/config/boot.rb rename to spec/fixtures/rails60/config/boot.rb index 9be337a42..30f5120df 100644 --- a/spec/fixtures/rails52/config/boot.rb +++ b/spec/fixtures/rails60/config/boot.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/spec/fixtures/rails52/config/cable.yml b/spec/fixtures/rails60/config/cable.yml similarity index 71% rename from spec/fixtures/rails52/config/cable.yml rename to spec/fixtures/rails60/config/cable.yml index 71933205b..debdc02e7 100644 --- a/spec/fixtures/rails52/config/cable.yml +++ b/spec/fixtures/rails60/config/cable.yml @@ -2,9 +2,9 @@ development: adapter: async test: - adapter: async + adapter: test production: adapter: redis url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> - channel_prefix: rails52_production + channel_prefix: rails60_production diff --git a/spec/fixtures/rails60/config/credentials.yml.enc b/spec/fixtures/rails60/config/credentials.yml.enc new file mode 100644 index 000000000..d7824b920 --- /dev/null +++ b/spec/fixtures/rails60/config/credentials.yml.enc @@ -0,0 +1 @@ +8Y8/F1ai6tfrAft/z0x+qNBnelef8uXXLft0kSsqh8WxI67QWJNyIqK6JBgwUpvQylLyomhY6DlPrOYzi0nj8AnjxYJGdIAKFbQq9PqJ9/0gzHs/QoyWCPLczqTYkKzvUshv+T+XbzRdI0Wz2umoaBVNyRzP7uMwtqVDecZhRgOd35gYlAAqFmfdvjKFeIIpNdTRINqq9W4fQmLuZ45Wk6QbdtU3HMFYJGv5aiFyg+kZQ2M/mGtskGCGIm+i7e8XMBNOJo+oMTRzEC0Z5tktz+epdsKBoJCJ7sJyMs3mUnt1SJc2AG4ORpRymvqSC3lkAiL/zhfynSoxMyktLmwT+vjvaemHjqT4MllkVvFutIZQMuSfYLIUGM5zKWdQvg0pahwYTADQJeCibtIQzWRhaBi79LjniupyG+RN--uZKZ0kvSJ5E4V8zX--AGm8/1XOThzOHhRVZY5jiA== \ No newline at end of file diff --git a/spec/fixtures/rails52/config/database.yml b/spec/fixtures/rails60/config/database.yml similarity index 84% rename from spec/fixtures/rails52/config/database.yml rename to spec/fixtures/rails60/config/database.yml index faeb94565..f90baf882 100644 --- a/spec/fixtures/rails52/config/database.yml +++ b/spec/fixtures/rails60/config/database.yml @@ -1,4 +1,4 @@ -# SQLite version 3.x +# SQLite. Versions 3.8.0 and up are supported. # gem install sqlite3 # # Ensure the SQLite 3 gem is defined in your Gemfile @@ -6,7 +6,7 @@ # default: &default adapter: sqlite3 - pool: 5 + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> timeout: 5000 development: diff --git a/spec/fixtures/rails51/config/environment.rb b/spec/fixtures/rails60/config/environment.rb similarity index 81% rename from spec/fixtures/rails51/config/environment.rb rename to spec/fixtures/rails60/config/environment.rb index 12ea62f88..426333bb4 100644 --- a/spec/fixtures/rails51/config/environment.rb +++ b/spec/fixtures/rails60/config/environment.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true # Load the Rails application. require_relative 'application' diff --git a/spec/fixtures/rails52/config/environments/development.rb b/spec/fixtures/rails60/config/environments/development.rb similarity index 78% rename from spec/fixtures/rails52/config/environments/development.rb rename to spec/fixtures/rails60/config/environments/development.rb index a61361fe5..04bd3eeba 100644 --- a/spec/fixtures/rails52/config/environments/development.rb +++ b/spec/fixtures/rails60/config/environments/development.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. @@ -17,6 +16,7 @@ # Run rails dev:cache to toggle caching. if Rails.root.join('tmp', 'caching-dev.txt').exist? config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true config.cache_store = :memory_store config.public_file_server.headers = { @@ -28,9 +28,6 @@ config.cache_store = :null_store end - # Store uploaded files on the local file system (see config/storage.yml for options) - config.active_storage.service = :local - # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = false @@ -45,15 +42,7 @@ # Highlight code that triggered database queries in logs. config.active_record.verbose_query_logs = true - # Debug mode disables concatenation and preprocessing of assets. - # This option may cause significant delays in view rendering with a large - # number of complex assets. - config.assets.debug = true - - # Suppress logger output for asset requests. - config.assets.quiet = true - - # Raises error for missing translations + # Raises error for missing translations. # config.action_view.raise_on_missing_translations = true # Use an evented file watcher to asynchronously detect changes in source code, diff --git a/spec/fixtures/rails52/config/environments/production.rb b/spec/fixtures/rails60/config/environments/production.rb similarity index 71% rename from spec/fixtures/rails52/config/environments/production.rb rename to spec/fixtures/rails60/config/environments/production.rb index fb40a27a5..08e99c0fe 100644 --- a/spec/fixtures/rails52/config/environments/production.rb +++ b/spec/fixtures/rails60/config/environments/production.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. @@ -23,15 +22,6 @@ # Apache or NGINX already handles this. config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? - # Compress JavaScripts and CSS. - config.assets.js_compressor = :uglifier - # config.assets.css_compressor = :sass - - # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false - - # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb - # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.action_controller.asset_host = 'http://assets.example.com' @@ -39,10 +29,7 @@ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX - # Store uploaded files on the local file system (see config/storage.yml for options) - config.active_storage.service = :local - - # Mount Action Cable outside main process or domain + # Mount Action Cable outside main process or domain. # config.action_cable.mount_path = nil # config.action_cable.url = 'wss://example.com/cable' # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] @@ -60,9 +47,9 @@ # Use a different cache store in production. # config.cache_store = :mem_cache_store - # Use a real queuing backend for Active Job (and separate queues per environment) + # Use a real queuing backend for Active Job (and separate queues per environment). # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "rails52_#{Rails.env}" + # config.active_job.queue_name_prefix = "rails60_production" config.action_mailer.perform_caching = false @@ -92,4 +79,25 @@ # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + + # Inserts middleware to perform automatic connection switching. + # The `database_selector` hash is used to pass options to the DatabaseSelector + # middleware. The `delay` is used to determine how long to wait after a write + # to send a subsequent read to the primary. + # + # The `database_resolver` class is used by the middleware to determine which + # database is appropriate to use based on the time delay. + # + # The `database_resolver_context` class is used by the middleware to set + # timestamps for the last write to the primary. The resolver uses the context + # class timestamps to determine how long to wait before reading from the + # replica. + # + # By default Rails will store a last write timestamp in the session. The + # DatabaseSelector middleware is designed as such you can define your own + # strategy for connection switching and pass that into the middleware through + # these configuration options. + # config.active_record.database_selector = { delay: 2.seconds } + # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver + # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session end diff --git a/spec/fixtures/rails51/config/environments/test.rb b/spec/fixtures/rails60/config/environments/test.rb similarity index 76% rename from spec/fixtures/rails51/config/environments/test.rb rename to spec/fixtures/rails60/config/environments/test.rb index b0c64d7a2..2f62f93cb 100644 --- a/spec/fixtures/rails51/config/environments/test.rb +++ b/spec/fixtures/rails60/config/environments/test.rb @@ -1,11 +1,11 @@ -# frozen_string_literal: true +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! config.cache_classes = true # Do not eager load code on boot. This avoids loading your whole application @@ -16,18 +16,20 @@ # Configure public file server for tests with Cache-Control for performance. config.public_file_server.enabled = true config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}" + 'Cache-Control' => "public, max-age=#{1.hour.to_i}" } # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false + config.cache_store = :null_store # Raise exceptions instead of rendering exception templates. config.action_dispatch.show_exceptions = false # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false + config.action_mailer.perform_caching = false # Tell Action Mailer not to deliver emails to the real world. @@ -38,6 +40,6 @@ # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr - # Raises error for missing translations + # Raises error for missing translations. # config.action_view.raise_on_missing_translations = true end diff --git a/spec/fixtures/rails51/config/initializers/application_controller_renderer.rb b/spec/fixtures/rails60/config/initializers/application_controller_renderer.rb similarity index 87% rename from spec/fixtures/rails51/config/initializers/application_controller_renderer.rb rename to spec/fixtures/rails60/config/initializers/application_controller_renderer.rb index f4556db39..89d2efab2 100644 --- a/spec/fixtures/rails51/config/initializers/application_controller_renderer.rb +++ b/spec/fixtures/rails60/config/initializers/application_controller_renderer.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true # Be sure to restart your server when you modify this file. # ActiveSupport::Reloader.to_prepare do diff --git a/spec/fixtures/rails52/config/initializers/backtrace_silencers.rb b/spec/fixtures/rails60/config/initializers/backtrace_silencers.rb similarity index 93% rename from spec/fixtures/rails52/config/initializers/backtrace_silencers.rb rename to spec/fixtures/rails60/config/initializers/backtrace_silencers.rb index d0f0d3b5d..59385cdf3 100644 --- a/spec/fixtures/rails52/config/initializers/backtrace_silencers.rb +++ b/spec/fixtures/rails60/config/initializers/backtrace_silencers.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. diff --git a/spec/fixtures/rails52/config/initializers/content_security_policy.rb b/spec/fixtures/rails60/config/initializers/content_security_policy.rb similarity index 77% rename from spec/fixtures/rails52/config/initializers/content_security_policy.rb rename to spec/fixtures/rails60/config/initializers/content_security_policy.rb index 497f5667c..35d0f26fc 100644 --- a/spec/fixtures/rails52/config/initializers/content_security_policy.rb +++ b/spec/fixtures/rails60/config/initializers/content_security_policy.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true # Be sure to restart your server when you modify this file. # Define an application-wide content security policy @@ -12,6 +11,8 @@ # policy.object_src :none # policy.script_src :self, :https # policy.style_src :self, :https +# # If you are using webpack-dev-server then specify webpack-dev-server host +# policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development? # # Specify URI for violation reports # # policy.report_uri "/csp-violation-report-endpoint" @@ -20,6 +21,9 @@ # If you are using UJS then enable automatic nonce generation # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } +# Set the nonce only to specific directives +# Rails.application.config.content_security_policy_nonce_directives = %w(script-src) + # Report CSP violations to a specified URI # For further information see the following documentation: # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only diff --git a/spec/fixtures/rails51/config/initializers/cookies_serializer.rb b/spec/fixtures/rails60/config/initializers/cookies_serializer.rb similarity index 89% rename from spec/fixtures/rails51/config/initializers/cookies_serializer.rb rename to spec/fixtures/rails60/config/initializers/cookies_serializer.rb index 2a7295959..5a6a32d37 100644 --- a/spec/fixtures/rails51/config/initializers/cookies_serializer.rb +++ b/spec/fixtures/rails60/config/initializers/cookies_serializer.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true # Be sure to restart your server when you modify this file. # Specify a serializer for the signed and encrypted cookie jars. diff --git a/spec/fixtures/rails52/config/initializers/filter_parameter_logging.rb b/spec/fixtures/rails60/config/initializers/filter_parameter_logging.rb similarity index 86% rename from spec/fixtures/rails52/config/initializers/filter_parameter_logging.rb rename to spec/fixtures/rails60/config/initializers/filter_parameter_logging.rb index b7fe1231f..4a994e1e7 100644 --- a/spec/fixtures/rails52/config/initializers/filter_parameter_logging.rb +++ b/spec/fixtures/rails60/config/initializers/filter_parameter_logging.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true # Be sure to restart your server when you modify this file. # Configure sensitive parameters which will be filtered from the log file. diff --git a/spec/fixtures/rails52/config/initializers/inflections.rb b/spec/fixtures/rails60/config/initializers/inflections.rb similarity index 95% rename from spec/fixtures/rails52/config/initializers/inflections.rb rename to spec/fixtures/rails60/config/initializers/inflections.rb index aa7435fbc..ac033bf9d 100644 --- a/spec/fixtures/rails52/config/initializers/inflections.rb +++ b/spec/fixtures/rails60/config/initializers/inflections.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections diff --git a/spec/fixtures/rails52/config/initializers/mime_types.rb b/spec/fixtures/rails60/config/initializers/mime_types.rb similarity index 83% rename from spec/fixtures/rails52/config/initializers/mime_types.rb rename to spec/fixtures/rails60/config/initializers/mime_types.rb index 6e1d16f02..dc1899682 100644 --- a/spec/fixtures/rails52/config/initializers/mime_types.rb +++ b/spec/fixtures/rails60/config/initializers/mime_types.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true # Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: diff --git a/spec/fixtures/rails52/config/initializers/wrap_parameters.rb b/spec/fixtures/rails60/config/initializers/wrap_parameters.rb similarity index 94% rename from spec/fixtures/rails52/config/initializers/wrap_parameters.rb rename to spec/fixtures/rails60/config/initializers/wrap_parameters.rb index 18c382529..bbfc3961b 100644 --- a/spec/fixtures/rails52/config/initializers/wrap_parameters.rb +++ b/spec/fixtures/rails60/config/initializers/wrap_parameters.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true # Be sure to restart your server when you modify this file. # This file contains settings for ActionController::ParamsWrapper which diff --git a/spec/fixtures/rails51/config/locales/en.yml b/spec/fixtures/rails60/config/locales/en.yml similarity index 93% rename from spec/fixtures/rails51/config/locales/en.yml rename to spec/fixtures/rails60/config/locales/en.yml index decc5a857..cf9b342d0 100644 --- a/spec/fixtures/rails51/config/locales/en.yml +++ b/spec/fixtures/rails60/config/locales/en.yml @@ -27,7 +27,7 @@ # 'true': 'foo' # # To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. +# available at https://guides.rubyonrails.org/i18n.html. en: hello: "Hello world" diff --git a/spec/fixtures/rails52/config/puma.rb b/spec/fixtures/rails60/config/puma.rb similarity index 74% rename from spec/fixtures/rails52/config/puma.rb rename to spec/fixtures/rails60/config/puma.rb index d05463a09..283e163b1 100644 --- a/spec/fixtures/rails52/config/puma.rb +++ b/spec/fixtures/rails60/config/puma.rb @@ -1,12 +1,12 @@ -# frozen_string_literal: true # 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. # -threads_count = ENV.fetch("RAILS_MAX_THREADS", 5) -threads threads_count, threads_count +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 # Specifies the `port` that Puma will listen on to receive requests; default is 3000. # @@ -14,10 +14,13 @@ # Specifies the `environment` that Puma will run in. # -environment ENV.fetch("RAILS_ENV", "development") +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the `pidfile` that Puma will use. +pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } # Specifies the number of `workers` to boot in clustered mode. -# Workers are forked webserver processes. If using threads and workers together +# 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). diff --git a/spec/fixtures/rails60/config/routes.rb b/spec/fixtures/rails60/config/routes.rb new file mode 100644 index 000000000..c06383a17 --- /dev/null +++ b/spec/fixtures/rails60/config/routes.rb @@ -0,0 +1,3 @@ +Rails.application.routes.draw do + # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html +end diff --git a/spec/fixtures/rails51/db/migrate/20181024130108_create_users.rb b/spec/fixtures/rails60/db/migrate/20210325101904_create_users.rb similarity index 56% rename from spec/fixtures/rails51/db/migrate/20181024130108_create_users.rb rename to spec/fixtures/rails60/db/migrate/20210325101904_create_users.rb index 2b5b822b5..6c10d9cad 100644 --- a/spec/fixtures/rails51/db/migrate/20181024130108_create_users.rb +++ b/spec/fixtures/rails60/db/migrate/20210325101904_create_users.rb @@ -1,5 +1,4 @@ -# frozen_string_literal: true -class CreateUsers < ActiveRecord::Migration[5.1] +class CreateUsers < ActiveRecord::Migration[6.0] def change create_table :users do |t| t.string :name diff --git a/spec/fixtures/rails60/db/schema.rb b/spec/fixtures/rails60/db/schema.rb new file mode 100644 index 000000000..a0bb87f84 --- /dev/null +++ b/spec/fixtures/rails60/db/schema.rb @@ -0,0 +1,21 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# This file is the source Rails uses to define your schema when running `rails +# db:schema:load`. When creating a new database, `rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 2021_03_25_101904) do + + create_table "users", force: :cascade do |t| + t.string "name" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end + +end diff --git a/spec/fixtures/rails52/db/seeds.rb b/spec/fixtures/rails60/db/seeds.rb similarity index 92% rename from spec/fixtures/rails52/db/seeds.rb rename to spec/fixtures/rails60/db/seeds.rb index 8744e3c59..1beea2acc 100644 --- a/spec/fixtures/rails52/db/seeds.rb +++ b/spec/fixtures/rails60/db/seeds.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true # This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). # diff --git a/spec/fixtures/rails51/app/models/concerns/.keep b/spec/fixtures/rails60/lib/assets/.keep similarity index 100% rename from spec/fixtures/rails51/app/models/concerns/.keep rename to spec/fixtures/rails60/lib/assets/.keep diff --git a/spec/fixtures/rails51/lib/assets/.keep b/spec/fixtures/rails60/lib/tasks/.keep similarity index 100% rename from spec/fixtures/rails51/lib/assets/.keep rename to spec/fixtures/rails60/lib/tasks/.keep diff --git a/spec/fixtures/rails51/lib/tasks/.keep b/spec/fixtures/rails60/log/.keep similarity index 100% rename from spec/fixtures/rails51/lib/tasks/.keep rename to spec/fixtures/rails60/log/.keep diff --git a/spec/fixtures/rails60/package.json b/spec/fixtures/rails60/package.json new file mode 100644 index 000000000..867b0a0f3 --- /dev/null +++ b/spec/fixtures/rails60/package.json @@ -0,0 +1,10 @@ +{ + "name": "rails60", + "private": true, + "dependencies": { + "@rails/ujs": "^6.0.0", + "turbolinks": "^5.2.0", + "@rails/actioncable": "^6.0.0" + }, + "version": "0.1.0" +} diff --git a/spec/fixtures/rails51/public/404.html b/spec/fixtures/rails60/public/404.html similarity index 100% rename from spec/fixtures/rails51/public/404.html rename to spec/fixtures/rails60/public/404.html diff --git a/spec/fixtures/rails51/public/422.html b/spec/fixtures/rails60/public/422.html similarity index 100% rename from spec/fixtures/rails51/public/422.html rename to spec/fixtures/rails60/public/422.html diff --git a/spec/fixtures/rails51/public/500.html b/spec/fixtures/rails60/public/500.html similarity index 100% rename from spec/fixtures/rails51/public/500.html rename to spec/fixtures/rails60/public/500.html diff --git a/spec/fixtures/rails51/public/apple-touch-icon-precomposed.png b/spec/fixtures/rails60/public/apple-touch-icon-precomposed.png similarity index 100% rename from spec/fixtures/rails51/public/apple-touch-icon-precomposed.png rename to spec/fixtures/rails60/public/apple-touch-icon-precomposed.png diff --git a/spec/fixtures/rails51/public/apple-touch-icon.png b/spec/fixtures/rails60/public/apple-touch-icon.png similarity index 100% rename from spec/fixtures/rails51/public/apple-touch-icon.png rename to spec/fixtures/rails60/public/apple-touch-icon.png diff --git a/spec/fixtures/rails51/public/favicon.ico b/spec/fixtures/rails60/public/favicon.ico similarity index 100% rename from spec/fixtures/rails51/public/favicon.ico rename to spec/fixtures/rails60/public/favicon.ico diff --git a/spec/fixtures/rails60/public/robots.txt b/spec/fixtures/rails60/public/robots.txt new file mode 100644 index 000000000..c19f78ab6 --- /dev/null +++ b/spec/fixtures/rails60/public/robots.txt @@ -0,0 +1 @@ +# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file diff --git a/spec/fixtures/rails52/test/application_system_test_case.rb b/spec/fixtures/rails60/test/application_system_test_case.rb similarity index 83% rename from spec/fixtures/rails52/test/application_system_test_case.rb rename to spec/fixtures/rails60/test/application_system_test_case.rb index 93fada67a..d19212abd 100644 --- a/spec/fixtures/rails52/test/application_system_test_case.rb +++ b/spec/fixtures/rails60/test/application_system_test_case.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true require "test_helper" class ApplicationSystemTestCase < ActionDispatch::SystemTestCase diff --git a/spec/fixtures/rails60/test/channels/application_cable/connection_test.rb b/spec/fixtures/rails60/test/channels/application_cable/connection_test.rb new file mode 100644 index 000000000..800405f15 --- /dev/null +++ b/spec/fixtures/rails60/test/channels/application_cable/connection_test.rb @@ -0,0 +1,11 @@ +require "test_helper" + +class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase + # test "connects with cookies" do + # cookies.signed[:user_id] = 42 + # + # connect + # + # assert_equal connection.user_id, "42" + # end +end diff --git a/spec/fixtures/rails51/log/.keep b/spec/fixtures/rails60/test/controllers/.keep similarity index 100% rename from spec/fixtures/rails51/log/.keep rename to spec/fixtures/rails60/test/controllers/.keep diff --git a/spec/fixtures/rails51/test/controllers/.keep b/spec/fixtures/rails60/test/fixtures/.keep similarity index 100% rename from spec/fixtures/rails51/test/controllers/.keep rename to spec/fixtures/rails60/test/fixtures/.keep diff --git a/spec/fixtures/rails51/test/fixtures/.keep b/spec/fixtures/rails60/test/fixtures/files/.keep similarity index 100% rename from spec/fixtures/rails51/test/fixtures/.keep rename to spec/fixtures/rails60/test/fixtures/files/.keep diff --git a/spec/fixtures/rails60/test/fixtures/users.yml b/spec/fixtures/rails60/test/fixtures/users.yml new file mode 100644 index 000000000..7d4122404 --- /dev/null +++ b/spec/fixtures/rails60/test/fixtures/users.yml @@ -0,0 +1,7 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + +two: + name: MyString diff --git a/spec/fixtures/rails51/test/fixtures/files/.keep b/spec/fixtures/rails60/test/helpers/.keep similarity index 100% rename from spec/fixtures/rails51/test/fixtures/files/.keep rename to spec/fixtures/rails60/test/helpers/.keep diff --git a/spec/fixtures/rails51/test/helpers/.keep b/spec/fixtures/rails60/test/integration/.keep similarity index 100% rename from spec/fixtures/rails51/test/helpers/.keep rename to spec/fixtures/rails60/test/integration/.keep diff --git a/spec/fixtures/rails51/test/integration/.keep b/spec/fixtures/rails60/test/mailers/.keep similarity index 100% rename from spec/fixtures/rails51/test/integration/.keep rename to spec/fixtures/rails60/test/mailers/.keep diff --git a/spec/fixtures/rails51/test/mailers/.keep b/spec/fixtures/rails60/test/models/.keep similarity index 100% rename from spec/fixtures/rails51/test/mailers/.keep rename to spec/fixtures/rails60/test/models/.keep diff --git a/spec/fixtures/rails60/test/models/user_test.rb b/spec/fixtures/rails60/test/models/user_test.rb new file mode 100644 index 000000000..82f61e010 --- /dev/null +++ b/spec/fixtures/rails60/test/models/user_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class UserTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/spec/fixtures/rails51/test/models/.keep b/spec/fixtures/rails60/test/system/.keep similarity index 100% rename from spec/fixtures/rails51/test/models/.keep rename to spec/fixtures/rails60/test/system/.keep diff --git a/spec/fixtures/rails52/test/test_helper.rb b/spec/fixtures/rails60/test/test_helper.rb similarity index 90% rename from spec/fixtures/rails52/test/test_helper.rb rename to spec/fixtures/rails60/test/test_helper.rb index 58af4446f..3ab84e3d1 100644 --- a/spec/fixtures/rails52/test/test_helper.rb +++ b/spec/fixtures/rails60/test/test_helper.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true ENV['RAILS_ENV'] ||= 'test' require_relative '../config/environment' require 'rails/test_help' diff --git a/spec/fixtures/rails51/test/system/.keep b/spec/fixtures/rails60/vendor/.keep similarity index 100% rename from spec/fixtures/rails51/test/system/.keep rename to spec/fixtures/rails60/vendor/.keep diff --git a/spec/fixtures/rails61/.gitattributes b/spec/fixtures/rails61/.gitattributes new file mode 100644 index 000000000..516857104 --- /dev/null +++ b/spec/fixtures/rails61/.gitattributes @@ -0,0 +1,10 @@ +# See https://git-scm.com/docs/gitattributes for more about git attribute files. + +# Mark the database schema as having been generated. +db/schema.rb linguist-generated + +# Mark the yarn lockfile as having been generated. +yarn.lock linguist-generated + +# Mark any vendored files as having been vendored. +vendor/* linguist-vendored diff --git a/spec/fixtures/rails51/.gitignore b/spec/fixtures/rails61/.gitignore similarity index 71% rename from spec/fixtures/rails51/.gitignore rename to spec/fixtures/rails61/.gitignore index dcc5b36f3..eb612efd0 100644 --- a/spec/fixtures/rails51/.gitignore +++ b/spec/fixtures/rails61/.gitignore @@ -9,7 +9,7 @@ # Ignore the default SQLite database. /db/*.sqlite3 -/db/*.sqlite3-journal +/db/*.sqlite3-* # Ignore all logfiles and tempfiles. /log/* @@ -17,7 +17,14 @@ !/log/.keep !/tmp/.keep -/node_modules -/yarn-error.log +# Ignore pidfiles, but keep the directory. +/tmp/pids/* +!/tmp/pids/ +!/tmp/pids/.keep + +/public/assets .byebug_history + +# Ignore master key for decrypting credentials and more. +/config/master.key diff --git a/spec/fixtures/rails61/.ruby-version b/spec/fixtures/rails61/.ruby-version new file mode 100644 index 000000000..4a36342fc --- /dev/null +++ b/spec/fixtures/rails61/.ruby-version @@ -0,0 +1 @@ +3.0.0 diff --git a/spec/fixtures/rails61/Gemfile b/spec/fixtures/rails61/Gemfile new file mode 100644 index 000000000..6925c0c66 --- /dev/null +++ b/spec/fixtures/rails61/Gemfile @@ -0,0 +1,19 @@ +# frozen_string_literal: true +source 'https://rubygems.org' + +rails_version = '6.1.3' + +gem 'actioncable', rails_version +gem 'actionmailer', rails_version +gem 'actionpack', rails_version +gem 'actionview', rails_version +gem 'activejob', rails_version +gem 'activemodel', rails_version +gem 'activerecord', rails_version +gem 'activesupport', rails_version +gem 'railties', rails_version +gem 'sprockets-rails' + +gem 'sqlite3' +gem 'tzinfo-data' +gem 'parallel_tests', path: "../../../", group: :development diff --git a/spec/fixtures/rails61/Gemfile.lock b/spec/fixtures/rails61/Gemfile.lock new file mode 100644 index 000000000..f261b9561 --- /dev/null +++ b/spec/fixtures/rails61/Gemfile.lock @@ -0,0 +1,125 @@ +PATH + remote: ../../.. + specs: + parallel_tests (3.5.2) + parallel + +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.1.3) + actionpack (= 6.1.3) + activesupport (= 6.1.3) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailer (6.1.3) + actionpack (= 6.1.3) + actionview (= 6.1.3) + activejob (= 6.1.3) + activesupport (= 6.1.3) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.1.3) + actionview (= 6.1.3) + activesupport (= 6.1.3) + rack (~> 2.0, >= 2.0.9) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actionview (6.1.3) + activesupport (= 6.1.3) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.1.3) + activesupport (= 6.1.3) + globalid (>= 0.3.6) + activemodel (6.1.3) + activesupport (= 6.1.3) + activerecord (6.1.3) + activemodel (= 6.1.3) + activesupport (= 6.1.3) + activesupport (6.1.3) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + builder (3.2.4) + concurrent-ruby (1.1.8) + crass (1.0.6) + erubi (1.10.0) + globalid (0.4.2) + activesupport (>= 4.2.0) + i18n (1.8.9) + concurrent-ruby (~> 1.0) + loofah (2.9.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + method_source (1.0.0) + mini_mime (1.0.2) + minitest (5.14.4) + nio4r (2.5.7) + nokogiri (1.11.2-x64-mingw32) + racc (~> 1.4) + nokogiri (1.11.2-x86_64-linux) + racc (~> 1.4) + parallel (1.20.1) + racc (1.5.2) + rack (2.2.3) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (6.1.3) + actionpack (= 6.1.3) + activesupport (= 6.1.3) + method_source + rake (>= 0.8.7) + thor (~> 1.0) + rake (13.0.3) + sprockets (4.0.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.2) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + thor (1.1.0) + tzinfo (2.0.4) + concurrent-ruby (~> 1.0) + tzinfo-data (1.2021.1) + tzinfo (>= 1.0.0) + websocket-driver (0.7.3) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.4.2) + +PLATFORMS + x64-mingw32 + x86_64-linux + +DEPENDENCIES + actioncable (= 6.1.3) + actionmailer (= 6.1.3) + actionpack (= 6.1.3) + actionview (= 6.1.3) + activejob (= 6.1.3) + activemodel (= 6.1.3) + activerecord (= 6.1.3) + activesupport (= 6.1.3) + parallel_tests! + railties (= 6.1.3) + sprockets-rails + sqlite3 + tzinfo-data + +BUNDLED WITH + 2.2.15 diff --git a/spec/fixtures/rails52/README.md b/spec/fixtures/rails61/README.md similarity index 100% rename from spec/fixtures/rails52/README.md rename to spec/fixtures/rails61/README.md diff --git a/spec/fixtures/rails51/Rakefile b/spec/fixtures/rails61/Rakefile similarity index 73% rename from spec/fixtures/rails51/Rakefile rename to spec/fixtures/rails61/Rakefile index 84f2bc394..9a5ea7383 100644 --- a/spec/fixtures/rails51/Rakefile +++ b/spec/fixtures/rails61/Rakefile @@ -1,7 +1,6 @@ -# frozen_string_literal: true # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. -require_relative 'config/application' +require_relative "config/application" Rails.application.load_tasks diff --git a/spec/fixtures/rails52/app/assets/config/manifest.js b/spec/fixtures/rails61/app/assets/config/manifest.js similarity index 62% rename from spec/fixtures/rails52/app/assets/config/manifest.js rename to spec/fixtures/rails61/app/assets/config/manifest.js index b16e53d6d..591819335 100644 --- a/spec/fixtures/rails52/app/assets/config/manifest.js +++ b/spec/fixtures/rails61/app/assets/config/manifest.js @@ -1,3 +1,2 @@ //= link_tree ../images -//= link_directory ../javascripts .js //= link_directory ../stylesheets .css diff --git a/spec/fixtures/rails51/vendor/.keep b/spec/fixtures/rails61/app/assets/images/.keep similarity index 100% rename from spec/fixtures/rails51/vendor/.keep rename to spec/fixtures/rails61/app/assets/images/.keep diff --git a/spec/fixtures/rails52/app/assets/stylesheets/application.css b/spec/fixtures/rails61/app/assets/stylesheets/application.css similarity index 100% rename from spec/fixtures/rails52/app/assets/stylesheets/application.css rename to spec/fixtures/rails61/app/assets/stylesheets/application.css diff --git a/spec/fixtures/rails52/app/channels/application_cable/channel.rb b/spec/fixtures/rails61/app/channels/application_cable/channel.rb similarity index 72% rename from spec/fixtures/rails52/app/channels/application_cable/channel.rb rename to spec/fixtures/rails61/app/channels/application_cable/channel.rb index 51e3e936b..d67269728 100644 --- a/spec/fixtures/rails52/app/channels/application_cable/channel.rb +++ b/spec/fixtures/rails61/app/channels/application_cable/channel.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true module ApplicationCable class Channel < ActionCable::Channel::Base end diff --git a/spec/fixtures/rails52/app/channels/application_cable/connection.rb b/spec/fixtures/rails61/app/channels/application_cable/connection.rb similarity index 73% rename from spec/fixtures/rails52/app/channels/application_cable/connection.rb rename to spec/fixtures/rails61/app/channels/application_cable/connection.rb index fa70319da..0ff5442f4 100644 --- a/spec/fixtures/rails52/app/channels/application_cable/connection.rb +++ b/spec/fixtures/rails61/app/channels/application_cable/connection.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true module ApplicationCable class Connection < ActionCable::Connection::Base end diff --git a/spec/fixtures/rails61/app/controllers/application_controller.rb b/spec/fixtures/rails61/app/controllers/application_controller.rb new file mode 100644 index 000000000..09705d12a --- /dev/null +++ b/spec/fixtures/rails61/app/controllers/application_controller.rb @@ -0,0 +1,2 @@ +class ApplicationController < ActionController::Base +end diff --git a/spec/fixtures/rails52/app/assets/images/.keep b/spec/fixtures/rails61/app/controllers/concerns/.keep similarity index 100% rename from spec/fixtures/rails52/app/assets/images/.keep rename to spec/fixtures/rails61/app/controllers/concerns/.keep diff --git a/spec/fixtures/rails61/app/helpers/application_helper.rb b/spec/fixtures/rails61/app/helpers/application_helper.rb new file mode 100644 index 000000000..de6be7945 --- /dev/null +++ b/spec/fixtures/rails61/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/spec/fixtures/rails61/app/javascript/channels/consumer.js b/spec/fixtures/rails61/app/javascript/channels/consumer.js new file mode 100644 index 000000000..8ec3aad3a --- /dev/null +++ b/spec/fixtures/rails61/app/javascript/channels/consumer.js @@ -0,0 +1,6 @@ +// Action Cable provides the framework to deal with WebSockets in Rails. +// You can generate new channels where WebSocket features live using the `bin/rails generate channel` command. + +import { createConsumer } from "@rails/actioncable" + +export default createConsumer() diff --git a/spec/fixtures/rails61/app/javascript/channels/index.js b/spec/fixtures/rails61/app/javascript/channels/index.js new file mode 100644 index 000000000..0cfcf7491 --- /dev/null +++ b/spec/fixtures/rails61/app/javascript/channels/index.js @@ -0,0 +1,5 @@ +// Load all the channels within this directory and all subdirectories. +// Channel files must be named *_channel.js. + +const channels = require.context('.', true, /_channel\.js$/) +channels.keys().forEach(channels) diff --git a/spec/fixtures/rails61/app/javascript/packs/application.js b/spec/fixtures/rails61/app/javascript/packs/application.js new file mode 100644 index 000000000..26530c6c0 --- /dev/null +++ b/spec/fixtures/rails61/app/javascript/packs/application.js @@ -0,0 +1,11 @@ +// This file is automatically compiled by Webpack, along with any other files +// present in this directory. You're encouraged to place your actual application logic in +// a relevant structure within app/javascript and only use these pack files to reference +// that code so it'll be compiled. + +import Rails from "@rails/ujs" +import Turbolinks from "turbolinks" +import "channels" + +Rails.start() +Turbolinks.start() diff --git a/spec/fixtures/rails61/app/jobs/application_job.rb b/spec/fixtures/rails61/app/jobs/application_job.rb new file mode 100644 index 000000000..d394c3d10 --- /dev/null +++ b/spec/fixtures/rails61/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError +end diff --git a/spec/fixtures/rails51/app/mailers/application_mailer.rb b/spec/fixtures/rails61/app/mailers/application_mailer.rb similarity index 77% rename from spec/fixtures/rails51/app/mailers/application_mailer.rb rename to spec/fixtures/rails61/app/mailers/application_mailer.rb index 24289009a..286b2239d 100644 --- a/spec/fixtures/rails51/app/mailers/application_mailer.rb +++ b/spec/fixtures/rails61/app/mailers/application_mailer.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true class ApplicationMailer < ActionMailer::Base default from: 'from@example.com' layout 'mailer' diff --git a/spec/fixtures/rails51/app/models/application_record.rb b/spec/fixtures/rails61/app/models/application_record.rb similarity index 72% rename from spec/fixtures/rails51/app/models/application_record.rb rename to spec/fixtures/rails61/app/models/application_record.rb index 767a072b5..10a4cba84 100644 --- a/spec/fixtures/rails51/app/models/application_record.rb +++ b/spec/fixtures/rails61/app/models/application_record.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true class ApplicationRecord < ActiveRecord::Base self.abstract_class = true end diff --git a/spec/fixtures/rails52/app/assets/javascripts/channels/.keep b/spec/fixtures/rails61/app/models/concerns/.keep similarity index 100% rename from spec/fixtures/rails52/app/assets/javascripts/channels/.keep rename to spec/fixtures/rails61/app/models/concerns/.keep diff --git a/spec/fixtures/rails52/app/models/user.rb b/spec/fixtures/rails61/app/models/user.rb similarity index 53% rename from spec/fixtures/rails52/app/models/user.rb rename to spec/fixtures/rails61/app/models/user.rb index b161db0c3..379658a50 100644 --- a/spec/fixtures/rails52/app/models/user.rb +++ b/spec/fixtures/rails61/app/models/user.rb @@ -1,3 +1,2 @@ -# frozen_string_literal: true class User < ApplicationRecord end diff --git a/spec/fixtures/rails61/app/views/layouts/application.html.erb b/spec/fixtures/rails61/app/views/layouts/application.html.erb new file mode 100644 index 000000000..2cd2637fe --- /dev/null +++ b/spec/fixtures/rails61/app/views/layouts/application.html.erb @@ -0,0 +1,16 @@ + + + + Rails61 + + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> + <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> + + + + <%= yield %> + + diff --git a/spec/fixtures/rails52/app/views/layouts/mailer.html.erb b/spec/fixtures/rails61/app/views/layouts/mailer.html.erb similarity index 100% rename from spec/fixtures/rails52/app/views/layouts/mailer.html.erb rename to spec/fixtures/rails61/app/views/layouts/mailer.html.erb diff --git a/spec/fixtures/rails52/app/views/layouts/mailer.text.erb b/spec/fixtures/rails61/app/views/layouts/mailer.text.erb similarity index 100% rename from spec/fixtures/rails52/app/views/layouts/mailer.text.erb rename to spec/fixtures/rails61/app/views/layouts/mailer.text.erb diff --git a/spec/fixtures/rails61/bin/rails b/spec/fixtures/rails61/bin/rails new file mode 100755 index 000000000..6fb4e4051 --- /dev/null +++ b/spec/fixtures/rails61/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path('../config/application', __dir__) +require_relative "../config/boot" +require "rails/commands" diff --git a/spec/fixtures/rails61/bin/rake b/spec/fixtures/rails61/bin/rake new file mode 100755 index 000000000..4fbf10b96 --- /dev/null +++ b/spec/fixtures/rails61/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative "../config/boot" +require "rake" +Rake.application.run diff --git a/spec/fixtures/rails51/bin/setup b/spec/fixtures/rails61/bin/setup similarity index 58% rename from spec/fixtures/rails51/bin/setup rename to spec/fixtures/rails61/bin/setup index 4c1bacf0f..90700ac4f 100755 --- a/spec/fixtures/rails51/bin/setup +++ b/spec/fixtures/rails61/bin/setup @@ -1,34 +1,32 @@ #!/usr/bin/env ruby -# frozen_string_literal: true -require 'pathname' -require 'fileutils' -include FileUtils # rubocop:disable Style/MixinUsage +require "fileutils" # path to your application root. -APP_ROOT = Pathname.new File.expand_path('..', __dir__) +APP_ROOT = File.expand_path('..', __dir__) def system!(*args) system(*args) || abort("\n== Command #{args} failed ==") end -chdir APP_ROOT do - # This script is a starting point to setup your application. +FileUtils.chdir APP_ROOT do + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. # Add necessary setup steps to this file. puts '== Installing dependencies ==' system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') - # Install JavaScript dependencies if using Yarn - # system('bin/yarn') + # Install JavaScript dependencies + system! 'bin/yarn' # puts "\n== Copying sample files ==" # unless File.exist?('config/database.yml') - # cp 'config/database.yml.sample', 'config/database.yml' + # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' # end puts "\n== Preparing database ==" - system! 'bin/rails db:setup' + system! 'bin/rails db:prepare' puts "\n== Removing old logs and tempfiles ==" system! 'bin/rails log:clear tmp:clear' diff --git a/spec/fixtures/rails61/bin/yarn b/spec/fixtures/rails61/bin/yarn new file mode 100755 index 000000000..da6c479af --- /dev/null +++ b/spec/fixtures/rails61/bin/yarn @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby +APP_ROOT = File.expand_path('..', __dir__) +Dir.chdir(APP_ROOT) do + yarn = ENV["PATH"].split(File::PATH_SEPARATOR) + .reject { |dir| File.expand_path(dir) == __dir__ } + .product(["yarn", "yarn.cmd", "yarn.ps1"]) + .map { |dir, file| File.expand_path(file, dir) } + .find { |file| File.executable?(file) } + + if yarn + exec yarn, *ARGV + else + warn "Yarn executable was not detected in the system." + warn "Download Yarn at https://yarnpkg.com/en/docs/install" + exit 1 + end +end diff --git a/spec/fixtures/rails52/config.ru b/spec/fixtures/rails61/config.ru similarity index 57% rename from spec/fixtures/rails52/config.ru rename to spec/fixtures/rails61/config.ru index 7eae2644f..4a3c09a68 100644 --- a/spec/fixtures/rails52/config.ru +++ b/spec/fixtures/rails61/config.ru @@ -1,6 +1,6 @@ -# frozen_string_literal: true # This file is used by Rack-based servers to start the application. -require_relative 'config/environment' +require_relative "config/environment" run Rails.application +Rails.application.load_server diff --git a/spec/fixtures/rails61/config/application.rb b/spec/fixtures/rails61/config/application.rb new file mode 100644 index 000000000..d07333913 --- /dev/null +++ b/spec/fixtures/rails61/config/application.rb @@ -0,0 +1,35 @@ +require_relative "boot" + +require "rails" +# Pick the frameworks you want: +require "active_model/railtie" +require "active_job/railtie" +require "active_record/railtie" +# require "active_storage/engine" +require "action_controller/railtie" +require "action_mailer/railtie" +# require "action_mailbox/engine" +# require "action_text/engine" +require "action_view/railtie" +require "action_cable/engine" +# require "sprockets/railtie" +require "rails/test_unit/railtie" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module Rails61 + class Application < Rails::Application + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 6.1 + + # Configuration for the application, engines, and railties goes here. + # + # These settings can be overridden in specific environments using the files + # in config/environments, which are processed later. + # + # config.time_zone = "Central Time (US & Canada)" + # config.eager_load_paths << Rails.root.join("extras") + end +end diff --git a/spec/fixtures/rails61/config/boot.rb b/spec/fixtures/rails61/config/boot.rb new file mode 100644 index 000000000..d69bd27dc --- /dev/null +++ b/spec/fixtures/rails61/config/boot.rb @@ -0,0 +1,3 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) + +require "bundler/setup" # Set up gems listed in the Gemfile. diff --git a/spec/fixtures/rails61/config/cable.yml b/spec/fixtures/rails61/config/cable.yml new file mode 100644 index 000000000..da0571339 --- /dev/null +++ b/spec/fixtures/rails61/config/cable.yml @@ -0,0 +1,10 @@ +development: + adapter: async + +test: + adapter: test + +production: + adapter: redis + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: rails61_production diff --git a/spec/fixtures/rails61/config/credentials.yml.enc b/spec/fixtures/rails61/config/credentials.yml.enc new file mode 100644 index 000000000..a8669465f --- /dev/null +++ b/spec/fixtures/rails61/config/credentials.yml.enc @@ -0,0 +1 @@ +aubiW8m61jDG+NneYhU9p325QDOmlICTJ5Qz4otgOiuYt7jYRtFHq6UW+5FK5Rnn6ixynhGE2B1D8mq1OLO4r3F7R/O236cseJqh+TOX0VTKRdnuCgSCTdJXFd2DTSsg4yRYM7xDFIT6qNv+Htn56vMTZMz8tvLQ+AfsN6yWJ9NruN6mQiA/8JOdAjKVj2sTPHAZB1+ktj0jFwo5Mr/Ixy6Vxd7lMlhV2p6AIzIqQEzFVpyKr9iuFF570ZkMVuRAyozTT7+4jRtk2JY63VvIqabS+kaAR/76TTZYzF4hadtWC/x5NW6vewlmbyGEpCVLkZzNHCRzsnHdE3zMf/fhfTyYVcbyrkSOP9L7FG5dQmqDtIDY0JyLeADDeHL2N4GwlbqDuV1HUtTPh2FYKB32MFth2lsL30HvQH5F--JFMR1GM9jIjoF7nq--2bcbl0NUQsk5KX9uj6zSiw== \ No newline at end of file diff --git a/spec/fixtures/rails51/config/database.yml b/spec/fixtures/rails61/config/database.yml similarity index 84% rename from spec/fixtures/rails51/config/database.yml rename to spec/fixtures/rails61/config/database.yml index faeb94565..f90baf882 100644 --- a/spec/fixtures/rails51/config/database.yml +++ b/spec/fixtures/rails61/config/database.yml @@ -1,4 +1,4 @@ -# SQLite version 3.x +# SQLite. Versions 3.8.0 and up are supported. # gem install sqlite3 # # Ensure the SQLite 3 gem is defined in your Gemfile @@ -6,7 +6,7 @@ # default: &default adapter: sqlite3 - pool: 5 + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> timeout: 5000 development: diff --git a/spec/fixtures/rails52/config/environment.rb b/spec/fixtures/rails61/config/environment.rb similarity index 61% rename from spec/fixtures/rails52/config/environment.rb rename to spec/fixtures/rails61/config/environment.rb index 12ea62f88..cac531577 100644 --- a/spec/fixtures/rails52/config/environment.rb +++ b/spec/fixtures/rails61/config/environment.rb @@ -1,6 +1,5 @@ -# frozen_string_literal: true # Load the Rails application. -require_relative 'application' +require_relative "application" # Initialize the Rails application. Rails.application.initialize! diff --git a/spec/fixtures/rails51/config/environments/development.rb b/spec/fixtures/rails61/config/environments/development.rb similarity index 55% rename from spec/fixtures/rails51/config/environments/development.rb rename to spec/fixtures/rails61/config/environments/development.rb index 8a4e13721..e65bd2a7f 100644 --- a/spec/fixtures/rails51/config/environments/development.rb +++ b/spec/fixtures/rails61/config/environments/development.rb @@ -1,9 +1,10 @@ -# frozen_string_literal: true +require "active_support/core_ext/integer/time" + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development + # In the development environment your application's code is reloaded any time + # it changes. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. config.cache_classes = false @@ -14,12 +15,14 @@ config.consider_all_requests_local = true # Enable/disable caching. By default caching is disabled. - if Rails.root.join('tmp/caching-dev.txt').exist? + # Run rails dev:cache to toggle caching. + if Rails.root.join('tmp', 'caching-dev.txt').exist? config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true config.cache_store = :memory_store config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}" + 'Cache-Control' => "public, max-age=#{2.days.to_i}" } else config.action_controller.perform_caching = false @@ -35,21 +38,28 @@ # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + # Raise an error on page load if there are pending migrations. config.active_record.migration_error = :page_load - # Debug mode disables concatenation and preprocessing of assets. - # This option may cause significant delays in view rendering with a large - # number of complex assets. - config.assets.debug = true + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true - # Suppress logger output for asset requests. - config.assets.quiet = true + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true # Use an evented file watcher to asynchronously detect changes in source code, # routes, locales, etc. This feature depends on the listen gem. # config.file_watcher = ActiveSupport::EventedFileUpdateChecker + + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true end diff --git a/spec/fixtures/rails51/config/environments/production.rb b/spec/fixtures/rails61/config/environments/production.rb similarity index 57% rename from spec/fixtures/rails51/config/environments/production.rb rename to spec/fixtures/rails61/config/environments/production.rb index ff1eda28e..972a88e43 100644 --- a/spec/fixtures/rails51/config/environments/production.rb +++ b/spec/fixtures/rails61/config/environments/production.rb @@ -1,4 +1,5 @@ -# frozen_string_literal: true +require "active_support/core_ext/integer/time" + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. @@ -15,32 +16,22 @@ config.consider_all_requests_local = false config.action_controller.perform_caching = true - # Attempt to read encrypted secrets from `config/secrets.yml.enc`. - # Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or - # `config/secrets.yml.key`. - config.read_encrypted_secrets = true + # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] + # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). + # config.require_master_key = true # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? - # Compress JavaScripts and CSS. - config.assets.js_compressor = :uglifier - # config.assets.css_compressor = :sass - - # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false - - # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb - # Enable serving of images, stylesheets, and JavaScripts from an asset server. - # config.action_controller.asset_host = 'http://assets.example.com' + # config.asset_host = 'http://assets.example.com' # Specifies the header that your server uses for sending files. # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX - # Mount Action Cable outside main process or domain + # Mount Action Cable outside main process or domain. # config.action_cable.mount_path = nil # config.action_cable.url = 'wss://example.com/cable' # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] @@ -48,9 +39,9 @@ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true - # Use the lowest log level to ensure availability of diagnostic information - # when problems arise. - config.log_level = :debug + # Include generic and useful information about system operation, but avoid logging too much + # information to avoid inadvertent exposure of personally identifiable information (PII). + config.log_level = :info # Prepend all log lines with the following tags. config.log_tags = [:request_id] @@ -58,9 +49,10 @@ # Use a different cache store in production. # config.cache_store = :mem_cache_store - # Use a real queuing backend for Active Job (and separate queues per environment) + # Use a real queuing backend for Active Job (and separate queues per environment). # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "rails51_#{Rails.env}" + # config.active_job.queue_name_prefix = "rails61_production" + config.action_mailer.perform_caching = false # Ignore bad email addresses and do not raise email delivery errors. @@ -74,11 +66,17 @@ # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify + # Log disallowed deprecations. + config.active_support.disallowed_deprecation = :log + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new # Use a different logger for distributed setups. - # require 'syslog/logger' + # require "syslog/logger" # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') if ENV["RAILS_LOG_TO_STDOUT"].present? @@ -89,4 +87,25 @@ # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + + # Inserts middleware to perform automatic connection switching. + # The `database_selector` hash is used to pass options to the DatabaseSelector + # middleware. The `delay` is used to determine how long to wait after a write + # to send a subsequent read to the primary. + # + # The `database_resolver` class is used by the middleware to determine which + # database is appropriate to use based on the time delay. + # + # The `database_resolver_context` class is used by the middleware to set + # timestamps for the last write to the primary. The resolver uses the context + # class timestamps to determine how long to wait before reading from the + # replica. + # + # By default Rails will store a last write timestamp in the session. The + # DatabaseSelector middleware is designed as such you can define your own + # strategy for connection switching and pass that into the middleware through + # these configuration options. + # config.active_record.database_selector = { delay: 2.seconds } + # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver + # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session end diff --git a/spec/fixtures/rails52/config/environments/test.rb b/spec/fixtures/rails61/config/environments/test.rb similarity index 63% rename from spec/fixtures/rails52/config/environments/test.rb rename to spec/fixtures/rails61/config/environments/test.rb index 79de6da35..d66c042f9 100644 --- a/spec/fixtures/rails52/config/environments/test.rb +++ b/spec/fixtures/rails61/config/environments/test.rb @@ -1,11 +1,13 @@ -# frozen_string_literal: true +require "active_support/core_ext/integer/time" + +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! config.cache_classes = true # Do not eager load code on boot. This avoids loading your whole application @@ -22,6 +24,7 @@ # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false + config.cache_store = :null_store # Raise exceptions instead of rendering exception templates. config.action_dispatch.show_exceptions = false @@ -29,9 +32,6 @@ # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false - # Store uploaded files on the local file system in a temporary directory - config.active_storage.service = :test - config.action_mailer.perform_caching = false # Tell Action Mailer not to deliver emails to the real world. @@ -42,6 +42,15 @@ # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true end diff --git a/spec/fixtures/rails52/config/initializers/application_controller_renderer.rb b/spec/fixtures/rails61/config/initializers/application_controller_renderer.rb similarity index 87% rename from spec/fixtures/rails52/config/initializers/application_controller_renderer.rb rename to spec/fixtures/rails61/config/initializers/application_controller_renderer.rb index f4556db39..89d2efab2 100644 --- a/spec/fixtures/rails52/config/initializers/application_controller_renderer.rb +++ b/spec/fixtures/rails61/config/initializers/application_controller_renderer.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true # Be sure to restart your server when you modify this file. # ActiveSupport::Reloader.to_prepare do diff --git a/spec/fixtures/rails61/config/initializers/backtrace_silencers.rb b/spec/fixtures/rails61/config/initializers/backtrace_silencers.rb new file mode 100644 index 000000000..33699c309 --- /dev/null +++ b/spec/fixtures/rails61/config/initializers/backtrace_silencers.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code +# by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'". +Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"] diff --git a/spec/fixtures/rails61/config/initializers/content_security_policy.rb b/spec/fixtures/rails61/config/initializers/content_security_policy.rb new file mode 100644 index 000000000..35d0f26fc --- /dev/null +++ b/spec/fixtures/rails61/config/initializers/content_security_policy.rb @@ -0,0 +1,30 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy +# For further information see the following documentation +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy + +# Rails.application.config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https +# # If you are using webpack-dev-server then specify webpack-dev-server host +# policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development? + +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end + +# If you are using UJS then enable automatic nonce generation +# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } + +# Set the nonce only to specific directives +# Rails.application.config.content_security_policy_nonce_directives = %w(script-src) + +# Report CSP violations to a specified URI +# For further information see the following documentation: +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only +# Rails.application.config.content_security_policy_report_only = true diff --git a/spec/fixtures/rails52/config/initializers/cookies_serializer.rb b/spec/fixtures/rails61/config/initializers/cookies_serializer.rb similarity index 89% rename from spec/fixtures/rails52/config/initializers/cookies_serializer.rb rename to spec/fixtures/rails61/config/initializers/cookies_serializer.rb index 2a7295959..5a6a32d37 100644 --- a/spec/fixtures/rails52/config/initializers/cookies_serializer.rb +++ b/spec/fixtures/rails61/config/initializers/cookies_serializer.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true # Be sure to restart your server when you modify this file. # Specify a serializer for the signed and encrypted cookie jars. diff --git a/spec/fixtures/rails51/config/initializers/filter_parameter_logging.rb b/spec/fixtures/rails61/config/initializers/filter_parameter_logging.rb similarity index 52% rename from spec/fixtures/rails51/config/initializers/filter_parameter_logging.rb rename to spec/fixtures/rails61/config/initializers/filter_parameter_logging.rb index b7fe1231f..4b34a0366 100644 --- a/spec/fixtures/rails51/config/initializers/filter_parameter_logging.rb +++ b/spec/fixtures/rails61/config/initializers/filter_parameter_logging.rb @@ -1,5 +1,6 @@ -# frozen_string_literal: true # Be sure to restart your server when you modify this file. # Configure sensitive parameters which will be filtered from the log file. -Rails.application.config.filter_parameters += [:password] +Rails.application.config.filter_parameters += [ + :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn +] diff --git a/spec/fixtures/rails51/config/initializers/inflections.rb b/spec/fixtures/rails61/config/initializers/inflections.rb similarity index 95% rename from spec/fixtures/rails51/config/initializers/inflections.rb rename to spec/fixtures/rails61/config/initializers/inflections.rb index aa7435fbc..ac033bf9d 100644 --- a/spec/fixtures/rails51/config/initializers/inflections.rb +++ b/spec/fixtures/rails61/config/initializers/inflections.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections diff --git a/spec/fixtures/rails51/config/initializers/mime_types.rb b/spec/fixtures/rails61/config/initializers/mime_types.rb similarity index 83% rename from spec/fixtures/rails51/config/initializers/mime_types.rb rename to spec/fixtures/rails61/config/initializers/mime_types.rb index 6e1d16f02..dc1899682 100644 --- a/spec/fixtures/rails51/config/initializers/mime_types.rb +++ b/spec/fixtures/rails61/config/initializers/mime_types.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true # Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: diff --git a/spec/fixtures/rails61/config/initializers/permissions_policy.rb b/spec/fixtures/rails61/config/initializers/permissions_policy.rb new file mode 100644 index 000000000..00f64d71b --- /dev/null +++ b/spec/fixtures/rails61/config/initializers/permissions_policy.rb @@ -0,0 +1,11 @@ +# Define an application-wide HTTP permissions policy. For further +# information see https://developers.google.com/web/updates/2018/06/feature-policy +# +# Rails.application.config.permissions_policy do |f| +# f.camera :none +# f.gyroscope :none +# f.microphone :none +# f.usb :none +# f.fullscreen :self +# f.payment :self, "https://secure.example.com" +# end diff --git a/spec/fixtures/rails51/config/initializers/wrap_parameters.rb b/spec/fixtures/rails61/config/initializers/wrap_parameters.rb similarity index 94% rename from spec/fixtures/rails51/config/initializers/wrap_parameters.rb rename to spec/fixtures/rails61/config/initializers/wrap_parameters.rb index 18c382529..bbfc3961b 100644 --- a/spec/fixtures/rails51/config/initializers/wrap_parameters.rb +++ b/spec/fixtures/rails61/config/initializers/wrap_parameters.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true # Be sure to restart your server when you modify this file. # This file contains settings for ActionController::ParamsWrapper which diff --git a/spec/fixtures/rails52/config/locales/en.yml b/spec/fixtures/rails61/config/locales/en.yml similarity index 93% rename from spec/fixtures/rails52/config/locales/en.yml rename to spec/fixtures/rails61/config/locales/en.yml index decc5a857..cf9b342d0 100644 --- a/spec/fixtures/rails52/config/locales/en.yml +++ b/spec/fixtures/rails61/config/locales/en.yml @@ -27,7 +27,7 @@ # 'true': 'foo' # # To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. +# available at https://guides.rubyonrails.org/i18n.html. en: hello: "Hello world" diff --git a/spec/fixtures/rails61/config/puma.rb b/spec/fixtures/rails61/config/puma.rb new file mode 100644 index 000000000..fa40ee6f5 --- /dev/null +++ b/spec/fixtures/rails61/config/puma.rb @@ -0,0 +1,43 @@ +# 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. +# +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 + +# Specifies the `worker_timeout` threshold that Puma will use to wait before +# terminating a worker in development environments. +# +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` that Puma will use. +pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } + +# 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/spec/fixtures/rails61/config/routes.rb b/spec/fixtures/rails61/config/routes.rb new file mode 100644 index 000000000..c06383a17 --- /dev/null +++ b/spec/fixtures/rails61/config/routes.rb @@ -0,0 +1,3 @@ +Rails.application.routes.draw do + # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html +end diff --git a/spec/fixtures/rails52/db/migrate/20181024130151_create_users.rb b/spec/fixtures/rails61/db/migrate/20210325101931_create_users.rb similarity index 56% rename from spec/fixtures/rails52/db/migrate/20181024130151_create_users.rb rename to spec/fixtures/rails61/db/migrate/20210325101931_create_users.rb index 55b4dfea6..9f06756e8 100644 --- a/spec/fixtures/rails52/db/migrate/20181024130151_create_users.rb +++ b/spec/fixtures/rails61/db/migrate/20210325101931_create_users.rb @@ -1,5 +1,4 @@ -# frozen_string_literal: true -class CreateUsers < ActiveRecord::Migration[5.2] +class CreateUsers < ActiveRecord::Migration[6.1] def change create_table :users do |t| t.string :name diff --git a/spec/fixtures/rails61/db/schema.rb b/spec/fixtures/rails61/db/schema.rb new file mode 100644 index 000000000..64f426a4f --- /dev/null +++ b/spec/fixtures/rails61/db/schema.rb @@ -0,0 +1,21 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 2021_03_25_101931) do + + create_table "users", force: :cascade do |t| + t.string "name" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end + +end diff --git a/spec/fixtures/rails51/db/seeds.rb b/spec/fixtures/rails61/db/seeds.rb similarity index 64% rename from spec/fixtures/rails51/db/seeds.rb rename to spec/fixtures/rails61/db/seeds.rb index 8744e3c59..f3a0480d1 100644 --- a/spec/fixtures/rails51/db/seeds.rb +++ b/spec/fixtures/rails61/db/seeds.rb @@ -1,6 +1,5 @@ -# frozen_string_literal: true # This file should contain all the record creation needed to seed the database with its default values. -# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). +# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). # # Examples: # diff --git a/spec/fixtures/rails52/app/controllers/concerns/.keep b/spec/fixtures/rails61/lib/assets/.keep similarity index 100% rename from spec/fixtures/rails52/app/controllers/concerns/.keep rename to spec/fixtures/rails61/lib/assets/.keep diff --git a/spec/fixtures/rails52/app/models/concerns/.keep b/spec/fixtures/rails61/lib/tasks/.keep similarity index 100% rename from spec/fixtures/rails52/app/models/concerns/.keep rename to spec/fixtures/rails61/lib/tasks/.keep diff --git a/spec/fixtures/rails52/lib/assets/.keep b/spec/fixtures/rails61/log/.keep similarity index 100% rename from spec/fixtures/rails52/lib/assets/.keep rename to spec/fixtures/rails61/log/.keep diff --git a/spec/fixtures/rails61/package.json b/spec/fixtures/rails61/package.json new file mode 100644 index 000000000..672812ed6 --- /dev/null +++ b/spec/fixtures/rails61/package.json @@ -0,0 +1,10 @@ +{ + "name": "rails61", + "private": true, + "dependencies": { + "@rails/ujs": "^6.0.0", + "turbolinks": "^5.2.0", + "@rails/actioncable": "^6.0.0" + }, + "version": "0.1.0" +} diff --git a/spec/fixtures/rails52/public/404.html b/spec/fixtures/rails61/public/404.html similarity index 100% rename from spec/fixtures/rails52/public/404.html rename to spec/fixtures/rails61/public/404.html diff --git a/spec/fixtures/rails52/public/422.html b/spec/fixtures/rails61/public/422.html similarity index 100% rename from spec/fixtures/rails52/public/422.html rename to spec/fixtures/rails61/public/422.html diff --git a/spec/fixtures/rails52/public/500.html b/spec/fixtures/rails61/public/500.html similarity index 100% rename from spec/fixtures/rails52/public/500.html rename to spec/fixtures/rails61/public/500.html diff --git a/spec/fixtures/rails52/public/apple-touch-icon-precomposed.png b/spec/fixtures/rails61/public/apple-touch-icon-precomposed.png similarity index 100% rename from spec/fixtures/rails52/public/apple-touch-icon-precomposed.png rename to spec/fixtures/rails61/public/apple-touch-icon-precomposed.png diff --git a/spec/fixtures/rails52/public/apple-touch-icon.png b/spec/fixtures/rails61/public/apple-touch-icon.png similarity index 100% rename from spec/fixtures/rails52/public/apple-touch-icon.png rename to spec/fixtures/rails61/public/apple-touch-icon.png diff --git a/spec/fixtures/rails52/public/favicon.ico b/spec/fixtures/rails61/public/favicon.ico similarity index 100% rename from spec/fixtures/rails52/public/favicon.ico rename to spec/fixtures/rails61/public/favicon.ico diff --git a/spec/fixtures/rails61/public/robots.txt b/spec/fixtures/rails61/public/robots.txt new file mode 100644 index 000000000..c19f78ab6 --- /dev/null +++ b/spec/fixtures/rails61/public/robots.txt @@ -0,0 +1 @@ +# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file diff --git a/spec/fixtures/rails51/test/application_system_test_case.rb b/spec/fixtures/rails61/test/application_system_test_case.rb similarity index 83% rename from spec/fixtures/rails51/test/application_system_test_case.rb rename to spec/fixtures/rails61/test/application_system_test_case.rb index 93fada67a..d19212abd 100644 --- a/spec/fixtures/rails51/test/application_system_test_case.rb +++ b/spec/fixtures/rails61/test/application_system_test_case.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true require "test_helper" class ApplicationSystemTestCase < ActionDispatch::SystemTestCase diff --git a/spec/fixtures/rails61/test/channels/application_cable/connection_test.rb b/spec/fixtures/rails61/test/channels/application_cable/connection_test.rb new file mode 100644 index 000000000..800405f15 --- /dev/null +++ b/spec/fixtures/rails61/test/channels/application_cable/connection_test.rb @@ -0,0 +1,11 @@ +require "test_helper" + +class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase + # test "connects with cookies" do + # cookies.signed[:user_id] = 42 + # + # connect + # + # assert_equal connection.user_id, "42" + # end +end diff --git a/spec/fixtures/rails52/lib/tasks/.keep b/spec/fixtures/rails61/test/controllers/.keep similarity index 100% rename from spec/fixtures/rails52/lib/tasks/.keep rename to spec/fixtures/rails61/test/controllers/.keep diff --git a/spec/fixtures/rails52/log/.keep b/spec/fixtures/rails61/test/fixtures/files/.keep similarity index 100% rename from spec/fixtures/rails52/log/.keep rename to spec/fixtures/rails61/test/fixtures/files/.keep diff --git a/spec/fixtures/rails61/test/fixtures/users.yml b/spec/fixtures/rails61/test/fixtures/users.yml new file mode 100644 index 000000000..7d4122404 --- /dev/null +++ b/spec/fixtures/rails61/test/fixtures/users.yml @@ -0,0 +1,7 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + +two: + name: MyString diff --git a/spec/fixtures/rails52/storage/.keep b/spec/fixtures/rails61/test/helpers/.keep similarity index 100% rename from spec/fixtures/rails52/storage/.keep rename to spec/fixtures/rails61/test/helpers/.keep diff --git a/spec/fixtures/rails52/test/controllers/.keep b/spec/fixtures/rails61/test/integration/.keep similarity index 100% rename from spec/fixtures/rails52/test/controllers/.keep rename to spec/fixtures/rails61/test/integration/.keep diff --git a/spec/fixtures/rails52/test/fixtures/.keep b/spec/fixtures/rails61/test/mailers/.keep similarity index 100% rename from spec/fixtures/rails52/test/fixtures/.keep rename to spec/fixtures/rails61/test/mailers/.keep diff --git a/spec/fixtures/rails52/test/fixtures/files/.keep b/spec/fixtures/rails61/test/models/.keep similarity index 100% rename from spec/fixtures/rails52/test/fixtures/files/.keep rename to spec/fixtures/rails61/test/models/.keep diff --git a/spec/fixtures/rails61/test/models/user_test.rb b/spec/fixtures/rails61/test/models/user_test.rb new file mode 100644 index 000000000..5c07f4900 --- /dev/null +++ b/spec/fixtures/rails61/test/models/user_test.rb @@ -0,0 +1,7 @@ +require "test_helper" + +class UserTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/spec/fixtures/rails52/test/helpers/.keep b/spec/fixtures/rails61/test/system/.keep similarity index 100% rename from spec/fixtures/rails52/test/helpers/.keep rename to spec/fixtures/rails61/test/system/.keep diff --git a/spec/fixtures/rails51/test/test_helper.rb b/spec/fixtures/rails61/test/test_helper.rb similarity index 65% rename from spec/fixtures/rails51/test/test_helper.rb rename to spec/fixtures/rails61/test/test_helper.rb index 562b8c129..e9f0b367c 100644 --- a/spec/fixtures/rails51/test/test_helper.rb +++ b/spec/fixtures/rails61/test/test_helper.rb @@ -1,7 +1,6 @@ -# frozen_string_literal: true ENV['RAILS_ENV'] ||= 'test' -require File.expand_path('../config/environment', __dir__) -require 'rails/test_help' +require_relative "../config/environment" +require "rails/test_help" class ActiveSupport::TestCase # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. diff --git a/spec/fixtures/rails52/test/integration/.keep b/spec/fixtures/rails61/vendor/.keep similarity index 100% rename from spec/fixtures/rails52/test/integration/.keep rename to spec/fixtures/rails61/vendor/.keep diff --git a/spec/integration_spec.rb b/spec/integration_spec.rb index 8c14c4612..3b2675af3 100644 --- a/spec/integration_spec.rb +++ b/spec/integration_spec.rb @@ -84,7 +84,8 @@ def self.it_fails_without_any_files(type) expect(result).to include '2 processes for 2 specs, ~ 1 spec per process' end - describe "--fail-fast" do + # Uses `Process.kill` under the hood, which on Windows doesn't work as expected. It kills all process group instead of just one process. + describe "--fail-fast", unless: Gem.win_platform? do def run_tests(test_option: nil) super( "spec", diff --git a/spec/rails_spec.rb b/spec/rails_spec.rb index 0e43f1760..e73640520 100644 --- a/spec/rails_spec.rb +++ b/spec/rails_spec.rb @@ -13,8 +13,7 @@ def sh(command, options = {}) result end - # TODO: rails 6 - ['rails51', 'rails52'].each do |rails| + ['rails60', 'rails61'].each do |rails| it "can create and run #{rails}" do skip 'rails fixtures are not set up for java' if RUBY_PLATFORM == "java" @@ -25,7 +24,6 @@ def sh(command, options = {}) ENV.delete("RACK_ENV") sh "bundle config --local path vendor/bundle" - sh "bundle config --local force_ruby_platform true" sh "bundle install" sh "rm -rf db/*.sqlite3" sh "bundle exec rake db:setup parallel:create --trace 2>&1"