From 0bb963218fe80121b1987a71165aa9cca2127bc7 Mon Sep 17 00:00:00 2001 From: Keenan Brock Date: Wed, 23 Oct 2024 19:54:44 -0400 Subject: [PATCH] Drop ruby <6.1 fixup --- .github/workflows/run_test_suite.yml | 18 +----------------- Appraisals | 13 ++++--------- Gemfile | 2 +- bin/console | 13 +++++++++++++ bin/setup | 6 ++++++ gemfiles/gemfile_52.gemfile | 10 ---------- gemfiles/gemfile_60.gemfile | 10 ---------- gemfiles/gemfile_61.gemfile | 10 ---------- 8 files changed, 25 insertions(+), 57 deletions(-) create mode 100755 bin/console create mode 100644 bin/setup delete mode 100644 gemfiles/gemfile_52.gemfile delete mode 100644 gemfiles/gemfile_60.gemfile delete mode 100644 gemfiles/gemfile_61.gemfile diff --git a/.github/workflows/run_test_suite.yml b/.github/workflows/run_test_suite.yml index dd8b0d8e..c0bc7bf2 100644 --- a/.github/workflows/run_test_suite.yml +++ b/.github/workflows/run_test_suite.yml @@ -43,20 +43,7 @@ jobs: # - https://guides.rubyonrails.org/maintenance_policy.html format: [materialized_path, materialized_path2] activerecord: [70, 71, 72] - ruby: [3.2, 3.3] - # additional tests - include: - # EOL 6/2022 (ruby >= 2.2.2, <2.7) - - ruby: 2.6 - activerecord: 52 - # EOL 2023 - - ruby: 2.7 - activerecord: 60 - # rails 6.1 and 7.0 have different ruby versions - - ruby: 2.7 - activerecord: 61 - - ruby: "3.0" - activerecord: 61 + ruby: [3.1, 3.3] env: # for the pg cli (psql, pg_isready) and possibly rails PGHOST: 127.0.0.1 # container is mapping it locally @@ -97,7 +84,6 @@ jobs: UPDATE_STRATEGY: sql run: | bundle exec rake - if: ${{ matrix.activerecord != 52 }} - name: run pg tests (ANCESTRY_COLUMN=ancestry_alt) env: DB: pg @@ -111,8 +97,6 @@ jobs: UPDATE_STRATEGY: sql run: | bundle exec rake - FORMAT=${{ matrix.format }} UPDATE_STRATEGY=sql bundle exec rake - if: ${{ matrix.activerecord != 52 }} - name: run mysql tests env: DB: mysql2 diff --git a/Appraisals b/Appraisals index 2883b0b9..2c1082c6 100644 --- a/Appraisals +++ b/Appraisals @@ -1,17 +1,12 @@ # on a mac using: # bundle config --global build.mysql2 "--with-mysql-dir=$(brew --prefix mysql)" -%w[5.2.8 6.0.6 6.1.7 7.0.8 7.1.3 7.2.1].each do |ar_version| +%w[7.0.8 7.1.3 7.2.1].each do |ar_version| appraise "gemfile-#{ar_version.split('.').first(2).join}" do gem 'activerecord', "~> #{ar_version}" - # active record 5.2 uses ruby 2.6 - # active record 6.x uses ruby 2.7 (sometimes 3.0) # so we are targeting the ruby version indirectly through active record - if ar_version < "7.0" - gem "sqlite3", "~> 1.6.9" - else - # sqlite3 v 2.0 is causing trouble with rails - gem "sqlite3", "< 2.0" - end + + # sqlite3 v 2.0 is causing trouble with rails + gem "sqlite3", "< 2.0" end end diff --git a/Gemfile b/Gemfile index aa081768..5246c7c5 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' gemspec -gem "activerecord", "~> 6.1.7" +gem "activerecord", "~> 7.2" gem "mysql2" gem "pg" gem "sqlite3", "~> 1.6.9" diff --git a/bin/console b/bin/console new file mode 100755 index 00000000..222e04eb --- /dev/null +++ b/bin/console @@ -0,0 +1,13 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require "bundler/setup" +require "active_support" +require "active_record" +require "ancestry" + +# models for local testing +# Dir['./spec/support/**/*.rb'].sort.each { |f| require f } + +require "irb" +IRB.start(__FILE__) diff --git a/bin/setup b/bin/setup new file mode 100644 index 00000000..24ac65c5 --- /dev/null +++ b/bin/setup @@ -0,0 +1,6 @@ + + +psql -c 'create database ancestry_test;' || echo 'db exists' +mysql -e 'CREATE SCHEMA IF NOT EXISTS 'ancestry_test';' + +#MAKE="make -j $(nproc)" bundle install --gemfile gemfiles/gemfile_61.gemfile diff --git a/gemfiles/gemfile_52.gemfile b/gemfiles/gemfile_52.gemfile deleted file mode 100644 index eb715511..00000000 --- a/gemfiles/gemfile_52.gemfile +++ /dev/null @@ -1,10 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 5.2.8" -gem "mysql2" -gem "pg" -gem "sqlite3", "~> 1.6.9" - -gemspec path: "../" diff --git a/gemfiles/gemfile_60.gemfile b/gemfiles/gemfile_60.gemfile deleted file mode 100644 index f0d662f0..00000000 --- a/gemfiles/gemfile_60.gemfile +++ /dev/null @@ -1,10 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 6.0.6" -gem "mysql2" -gem "pg" -gem "sqlite3", "~> 1.6.9" - -gemspec path: "../" diff --git a/gemfiles/gemfile_61.gemfile b/gemfiles/gemfile_61.gemfile deleted file mode 100644 index 6a2913a1..00000000 --- a/gemfiles/gemfile_61.gemfile +++ /dev/null @@ -1,10 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 6.1.7" -gem "mysql2" -gem "pg" -gem "sqlite3", "~> 1.6.9" - -gemspec path: "../"