From 5f55fd3885f8c52c881f73945c35257f2a76bfc9 Mon Sep 17 00:00:00 2001 From: Richard Schneeman Date: Fri, 22 Jan 2021 16:09:49 -0600 Subject: [PATCH 1/5] Rails 2 LTS support --- hatchet.json | 2 +- hatchet.lock | 4 ++-- spec/hatchet/rails23_spec.rb | 14 ++++++++++---- spec/spec_helper.rb | 4 ++++ 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/hatchet.json b/hatchet.json index f38eca572..b5bf30cdc 100644 --- a/hatchet.json +++ b/hatchet.json @@ -45,7 +45,7 @@ "sharpstone/mri_200" ], "rails2": [ - "sharpstone/rails23_mri_193" + "sharpstone/rails_lts_23_default_ruby" ], "rails3": [ "sharpstone/rails3_mri_193", diff --git a/hatchet.lock b/hatchet.lock index 67f314cff..ebe02a3a9 100644 --- a/hatchet.lock +++ b/hatchet.lock @@ -45,8 +45,8 @@ - 2e9ed455517c57b0dc953f54fbf9fef641c7aadb - - "./repos/rack/mri_200" - f9922cbd9c6f44fdded54912f66038db37cb4b8f -- - "./repos/rails2/rails23_mri_193" - - 557f7ba7a9347ebe0dd2038dda7e7a97b2582525 +- - "./repos/rails2/rails_lts_23_default_ruby" + - 7178b2f97d3b2b3170b390d997dcb212dd52cd30 - - "./repos/rails3/rails3-fail-assets-compile" - 0a2496b162fee373cbd484466abfcac1792510a1 - - "./repos/rails3/rails3-fail-rakefile" diff --git a/spec/hatchet/rails23_spec.rb b/spec/hatchet/rails23_spec.rb index e9b4d6342..dd5c37b87 100644 --- a/spec/hatchet/rails23_spec.rb +++ b/spec/hatchet/rails23_spec.rb @@ -1,11 +1,17 @@ require_relative '../spec_helper' describe "Rails 2.3.x" do - it "should deploy on ruby 1.9.3 on cedar-14" do - pending("Rails LTS support") + it "should deploy" do + skip("Need RAILS_LTS_CREDS env var set") unless ENV["RAILS_LTS_CREDS"] - Hatchet::Runner.new('rails23_mri_193', stack: "cedar-14").deploy do |app| - # assert deploy is successful + Hatchet::Runner.new('rails_lts_23_default_ruby', config: rails_lts_config).tap do |app| + app.before_deploy do + File.open("Gemfile", mode: "a") {|f| f.puts "ruby '2.6.6'" } + end + + app.deploy do + # assert deploy is successful + end end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 21007b31b..84b3a4e74 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -54,6 +54,10 @@ def fixture_path(path) Pathname.new(__FILE__).join("../fixtures").expand_path.join(path) end +def rails_lts_config + { 'BUNDLE_GEMS__RAILSLTS__COM' => ENV["RAILS_LTS_CREDS"] } +end + def hatchet_path(path = "") Pathname.new(__FILE__).join("../../repos").expand_path.join(path) end From e098a0baa905cb0e03e2f4945ea6a315294c298b Mon Sep 17 00:00:00 2001 From: Richard Schneeman Date: Wed, 27 Jan 2021 14:32:24 -0600 Subject: [PATCH 2/5] Rails 3 LTS The current Rails 3 LTS release does not work with Heroku Postgres and it makes a connection to the DB on boot, so I've deleted the Rakefile. Asserting behavior against the rest of the app is better than nothing. If it gets fixed from makandra later it can be re-visited. --- hatchet.json | 44 +++++------------- hatchet.lock | 58 +++++++++--------------- spec/hatchet/rails3_spec.rb | 67 +++++++++------------------- spec/helpers/bundler_wrapper_spec.rb | 6 --- spec/helpers/ruby_version_spec.rb | 12 ----- 5 files changed, 53 insertions(+), 134 deletions(-) diff --git a/hatchet.json b/hatchet.json index b5bf30cdc..cb29459b9 100644 --- a/hatchet.json +++ b/hatchet.json @@ -20,8 +20,6 @@ "ruby": [ "sharpstone/ruby_version_does_not_exist", "sharpstone/cd_ruby", - "sharpstone/mri_187", - "sharpstone/mri_193_p547", "sharpstone/ruby_193_jruby_173", "sharpstone/ruby_193_jruby_176", "sharpstone/ruby_193_jruby_1_7_27", @@ -44,43 +42,21 @@ "sharpstone/mri_193", "sharpstone/mri_200" ], - "rails2": [ - "sharpstone/rails_lts_23_default_ruby" - ], - "rails3": [ - "sharpstone/rails3_mri_193", - "sharpstone/railties3_mri_193", - "sharpstone/rails3_12factor", - "sharpstone/rails3_one_plugin", - "sharpstone/rails3_runtime_assets", - "sharpstone/rails3-fail-assets-compile", - "sharpstone/rails3-fail-rakefile" - ], - "rails4": [ - "sharpstone/rails4-manifest", + "rails_versions": [ + "sharpstone/rails_lts_23_default_ruby", + "sharpstone/rails3_default_ruby", "sharpstone/rails3-to-4-no-bin", + "sharpstone/rails4-manifest", "sharpstone/rails4_windows_mri193", - "sharpstone/rails4-fail-assets-compile" - ], - "rails41": [ - "sharpstone/rails41_scaffold" - ], - "rails42": [ + "sharpstone/rails4-fail-assets-compile", + "sharpstone/rails41_scaffold", "sharpstone/rails42_scaffold", - "sharpstone/rails42_sprockets3_manifest" - ], - "rails5": [ - "sharpstone/rails5" - ], - "rails51": [ - "schneems/rails51_webpacker" - ], - "rails52": [ + "sharpstone/rails42_sprockets3_manifest", + "sharpstone/rails5", + "schneems/rails51_webpacker", "sharpstone/active_storage_non_local", "sharpstone/active_storage_local", - "sharpstone/sprockets_asset_compile_true" - ], - "rails6": [ + "sharpstone/sprockets_asset_compile_true", "sharpstone/rails6-basic" ], "heroku": [ diff --git a/hatchet.lock b/hatchet.lock index ebe02a3a9..91c41eac4 100644 --- a/hatchet.lock +++ b/hatchet.lock @@ -45,48 +45,36 @@ - 2e9ed455517c57b0dc953f54fbf9fef641c7aadb - - "./repos/rack/mri_200" - f9922cbd9c6f44fdded54912f66038db37cb4b8f -- - "./repos/rails2/rails_lts_23_default_ruby" - - 7178b2f97d3b2b3170b390d997dcb212dd52cd30 -- - "./repos/rails3/rails3-fail-assets-compile" - - 0a2496b162fee373cbd484466abfcac1792510a1 -- - "./repos/rails3/rails3-fail-rakefile" - - 85ee71f73a50067ca99163aa3bb23865a1df4c8f -- - "./repos/rails3/rails3_12factor" - - 9aebcf9adccd007e178f71aa49f85ee1a203fc4d -- - "./repos/rails3/rails3_mri_193" - - 88c5d0d067cfd11e4452633994a85b04627ae8c7 -- - "./repos/rails3/rails3_one_plugin" - - 4f6ee83f2b977d4c939890ede9f11319ab8fd67c -- - "./repos/rails3/rails3_runtime_assets" - - 6f71613db2ba4e25c82d5986f43e419ed9b2e4b0 -- - "./repos/rails3/railties3_mri_193" - - 8cc041cffb9f5635017aa118d16688491f794e91 -- - "./repos/rails4/rails3-to-4-no-bin" +- - "./repos/rails_versions/active_storage_local" + - e2119af6ddd4bc21fda9bc7da6401e7aa256e38d +- - "./repos/rails_versions/active_storage_non_local" + - cba59b7559f1f806684b65654228d44fcda91a82 +- - "./repos/rails_versions/rails3-to-4-no-bin" - 3fd6e84f5d8eaaadb6d95aeb1f367f62da28cc62 -- - "./repos/rails4/rails4-fail-assets-compile" +- - "./repos/rails_versions/rails3_default_ruby" + - a6b44db674c0d3538633989295e2cfd5e8e1ba0d +- - "./repos/rails_versions/rails4-fail-assets-compile" - 7f65fbb04ca49be526906a1b0d9155cd24941b8e -- - "./repos/rails4/rails4-manifest" +- - "./repos/rails_versions/rails4-manifest" - b700f4683f601f102ab4b65a7e5052e40f2b4def -- - "./repos/rails4/rails4_windows_mri193" - - f4c7b6209835050468bbb87827acf652b8f4d8ce -- - "./repos/rails41/rails41_scaffold" +- - "./repos/rails_versions/rails41_scaffold" - d98e9ccee771b3745f1ab1936a697a05229392df -- - "./repos/rails42/rails42_scaffold" +- - "./repos/rails_versions/rails42_scaffold" - 5da1259651bf29b80af2bb27789422def02be5a8 -- - "./repos/rails42/rails42_sprockets3_manifest" +- - "./repos/rails_versions/rails42_sprockets3_manifest" - 4ea4b080599b4394bdf6753a7b392d9ed6b844a7 -- - "./repos/rails5/rails5" +- - "./repos/rails_versions/rails4_windows_mri193" + - f4c7b6209835050468bbb87827acf652b8f4d8ce +- - "./repos/rails_versions/rails5" - 1680c5da829e03ffb9345187971a13e5109d86a6 -- - "./repos/rails51/rails51_webpacker" +- - "./repos/rails_versions/rails51_webpacker" - 75c5c4f21b1d88fc3b8edf60b3f871df3ad70208 -- - "./repos/rails52/active_storage_local" - - e2119af6ddd4bc21fda9bc7da6401e7aa256e38d -- - "./repos/rails52/active_storage_non_local" - - cba59b7559f1f806684b65654228d44fcda91a82 -- - "./repos/rails52/sprockets_asset_compile_true" - - 98c6675cf97059278709cf75030e28063e0228d2 -- - "./repos/rails6/rails6-basic" +- - "./repos/rails_versions/rails6-basic" - 3b404ac714a16877781b7bf69f1b8a308df6c92f +- - "./repos/rails_versions/rails_lts_23_default_ruby" + - 7178b2f97d3b2b3170b390d997dcb212dd52cd30 +- - "./repos/rails_versions/sprockets_asset_compile_true" + - 98c6675cf97059278709cf75030e28063e0228d2 - - "./repos/rake/asset_precompile_fail" - 16f7834331d6bb3fc5c284130b14eb1ff74d99d5 - - "./repos/rake/asset_precompile_not_found" @@ -113,10 +101,6 @@ - f79860bc2866449fe065484f1542aaadd3f7cfd2 - - "./repos/ruby/libpq_connection_error" - c211c245f09d8335a520cd7a0b5360897d4988eb -- - "./repos/ruby/mri_187" - - 43cecfacbedda64f09310a4408ce73c5dc3a9c44 -- - "./repos/ruby/mri_193_p547" - - 39f4753b620f9ff427c547fd19f04c89f8441f6f - - "./repos/ruby/ruby_193_bad_patch_cedar_14" - 6948c1460c596f08c4642d616ae73a45dc0ae51a - - "./repos/ruby/ruby_193_jruby_17161_jdk7" diff --git a/spec/hatchet/rails3_spec.rb b/spec/hatchet/rails3_spec.rb index 23c6b5d9c..c1c40e9be 100644 --- a/spec/hatchet/rails3_spec.rb +++ b/spec/hatchet/rails3_spec.rb @@ -1,51 +1,28 @@ require_relative '../spec_helper' describe "Rails 3.x" do - it "should deploy on ruby 1.9.3" do - pending("Rails LTS license") - - Hatchet::Runner.new("rails3_mri_193", stack: "cedar-14").deploy do |app, heroku| - expect(app.output).to include("Asset precompilation completed") - - expect(app.output).to match("WARNING") - expect(app.output).to match("Add 'rails_12factor' gem to your Gemfile to skip plugin injection") - - ls = app.run("ls vendor/plugins") - expect(ls).to match("rails3_serve_static_assets") - expect(ls).to match("rails_log_stdout") - end - end - - it "should not have warnings when using the rails_12factor gem" do - Hatchet::Runner.new("rails3_12factor").deploy do |app, heroku| - expect(app.output).not_to match("Add 'rails_12factor' gem to your Gemfile to skip plugin injection") - - # https://github.com/heroku/heroku-buildpack-ruby/issues/525 - env = app.run("env") - expect(env).not_to match("RAILS_GROUPS") - end - end - - it "should only display the correct plugin warning" do - Hatchet::Runner.new("rails3_one_plugin").deploy do |app, heroku| - expect(app.output).not_to match("rails_log_stdout") - expect(app.output).to match("rails3_serve_static_assets") - expect(app.output).to match("Add 'rails_12factor' gem to your Gemfile to skip plugin injection") - end - end - - - it "fails if rake tasks cannot be detected" do - Hatchet::Runner.new("rails3-fail-rakefile", allow_failure: true).deploy do |app| - expect(app.output).to include("raising so the rake task will not load") - expect(app).not_to be_deployed - end - end - - it "fails compile if assets:precompile fails" do - Hatchet::Runner.new("rails3-fail-assets-compile", allow_failure: true).deploy do |app, heroku| - expect(app.output).to include("raising on assets:precompile on purpose") - expect(app).not_to be_deployed + it "should deploy and inject plugins" do + skip("Need RAILS_LTS_CREDS env var set") unless ENV["RAILS_LTS_CREDS"] + + Hatchet::Runner.new("rails3_default_ruby", config: rails_lts_config).tap do |app| + app.before_deploy do + File.open("Gemfile", mode: "a") {|f| f.puts "ruby '2.6.6'" } + end + + app.deploy do + # Rails 3 doesn't work with Postgres 8+ out of the box and Rails + # LTS hasn't patched this yet. We're skipping asset compilation for now + # by deleting the Rakefile + # + # expect(app.output).to include("Asset precompilation completed") + + expect(app.output).to match("WARNING") + expect(app.output).to match("Add 'rails_12factor' gem to your Gemfile to skip plugin injection") + + ls = app.run("ls vendor/plugins") + expect(ls).to match("rails3_serve_static_assets") + expect(ls).to match("rails_log_stdout") + end end end end diff --git a/spec/helpers/bundler_wrapper_spec.rb b/spec/helpers/bundler_wrapper_spec.rb index 3803fe57d..d20fcc9f5 100644 --- a/spec/helpers/bundler_wrapper_spec.rb +++ b/spec/helpers/bundler_wrapper_spec.rb @@ -66,12 +66,6 @@ def wrapper.topic(*args); end # Silence output in tests end end - it "handles MRI patchlevel gemfiles" do - Hatchet::App.new("mri_193_p547").in_directory_fork do |dir| - expect(@bundler.ruby_version).to eq("ruby-1.9.3-p547") - end - end - it "handles app with output in their Gemfile" do Hatchet::App.new("problem_gemfile_version").in_directory_fork do |dir| run!(%{echo '\nputs "some output"\n' >> Gemfile}) diff --git a/spec/helpers/ruby_version_spec.rb b/spec/helpers/ruby_version_spec.rb index 6946f397a..1fe2eff89 100644 --- a/spec/helpers/ruby_version_spec.rb +++ b/spec/helpers/ruby_version_spec.rb @@ -38,18 +38,6 @@ end end - it "correctly handles patch levels" do - Hatchet::App.new("mri_193_p547").in_directory_fork do |dir| - ruby_version = LanguagePack::RubyVersion.new(@bundler.install.ruby_version, is_new: true) - version_number = "1.9.3" - version = "ruby-#{version_number}" - expect(ruby_version.version_without_patchlevel).to eq(version) - expect(ruby_version.patchlevel).to eq("p547") - expect(ruby_version.engine_version).to eq(version_number) - expect(ruby_version.engine).to eq(:ruby) - end - end - it "does not include patchlevels when the patchlevel is negative for download" do ruby_version = LanguagePack::RubyVersion.new("ruby-2.0.0-p-1") expect(ruby_version.version_for_download).to eq("ruby-2.0.0") From 91efe24e7970614f0d556ab1cee27ff1e79990ee Mon Sep 17 00:00:00 2001 From: Richard Schneeman Date: Thu, 28 Jan 2021 09:20:53 -0600 Subject: [PATCH 3/5] Rails 4 LTS tests --- hatchet.json | 7 +-- hatchet.lock | 14 +----- spec/hatchet/rails4_spec.rb | 95 +++++++++++++------------------------ 3 files changed, 36 insertions(+), 80 deletions(-) diff --git a/hatchet.json b/hatchet.json index cb29459b9..483c09c1a 100644 --- a/hatchet.json +++ b/hatchet.json @@ -45,13 +45,8 @@ "rails_versions": [ "sharpstone/rails_lts_23_default_ruby", "sharpstone/rails3_default_ruby", - "sharpstone/rails3-to-4-no-bin", - "sharpstone/rails4-manifest", "sharpstone/rails4_windows_mri193", - "sharpstone/rails4-fail-assets-compile", - "sharpstone/rails41_scaffold", - "sharpstone/rails42_scaffold", - "sharpstone/rails42_sprockets3_manifest", + "sharpstone/rails42_default_ruby", "sharpstone/rails5", "schneems/rails51_webpacker", "sharpstone/active_storage_non_local", diff --git a/hatchet.lock b/hatchet.lock index 91c41eac4..80a01b175 100644 --- a/hatchet.lock +++ b/hatchet.lock @@ -49,20 +49,10 @@ - e2119af6ddd4bc21fda9bc7da6401e7aa256e38d - - "./repos/rails_versions/active_storage_non_local" - cba59b7559f1f806684b65654228d44fcda91a82 -- - "./repos/rails_versions/rails3-to-4-no-bin" - - 3fd6e84f5d8eaaadb6d95aeb1f367f62da28cc62 - - "./repos/rails_versions/rails3_default_ruby" - a6b44db674c0d3538633989295e2cfd5e8e1ba0d -- - "./repos/rails_versions/rails4-fail-assets-compile" - - 7f65fbb04ca49be526906a1b0d9155cd24941b8e -- - "./repos/rails_versions/rails4-manifest" - - b700f4683f601f102ab4b65a7e5052e40f2b4def -- - "./repos/rails_versions/rails41_scaffold" - - d98e9ccee771b3745f1ab1936a697a05229392df -- - "./repos/rails_versions/rails42_scaffold" - - 5da1259651bf29b80af2bb27789422def02be5a8 -- - "./repos/rails_versions/rails42_sprockets3_manifest" - - 4ea4b080599b4394bdf6753a7b392d9ed6b844a7 +- - "./repos/rails_versions/rails42_default_ruby" + - dfa0f0133dafa62064968ea2efb6432f54350138 - - "./repos/rails_versions/rails4_windows_mri193" - f4c7b6209835050468bbb87827acf652b8f4d8ce - - "./repos/rails_versions/rails5" diff --git a/spec/hatchet/rails4_spec.rb b/spec/hatchet/rails4_spec.rb index 1b6facc54..624aa9f53 100644 --- a/spec/hatchet/rails4_spec.rb +++ b/spec/hatchet/rails4_spec.rb @@ -1,81 +1,52 @@ require_relative '../spec_helper' describe "Rails 4.x" do - it "set RAILS_SERVE_STATIC_FILES" do - Hatchet::Runner.new("rails42_scaffold").deploy do |app, heroku| - output = app.run("rails runner 'puts ENV[%Q{RAILS_SERVE_STATIC_FILES}].present?'") - expect(output).to match(/true/) - end - end - it "should be able to run a migration without heroku specific database.yml" do - Hatchet::Runner.new("rails41_scaffold").deploy do |app, heroku| - expect(app.output).not_to include("Writing config/database.yml to read from DATABASE_URL") - expect(app.run("rake db:migrate")).to include("20140218165801 CreatePeople") - end - end - - it "should not overwrite existing files with cached files" do - string = SecureRandom.hex(13) - new_string = SecureRandom.hex(13) + skip("Need RAILS_LTS_CREDS env var set") unless ENV["RAILS_LTS_CREDS"] - Hatchet::Runner.new("rails41_scaffold").deploy do |app, heroku| - # First Deploy - run!(%Q{mkdir public/assets}) - run!(%Q{echo #{string} > public/assets/file.txt}) - run!(%Q{git add -A; git commit -m 'adding file.txt'}) - app.push! + Hatchet::Runner.new("rails42_default_ruby", config: rails_lts_config).tap do |app| + app.before_deploy do + Pathname("Gemfile").write("ruby '2.7.2'", mode: "a") + end + app.deploy do + # it Don't over-write database.yml + expect(app.output).not_to include("Writing config/database.yml to read from DATABASE_URL") - # Second Deploy - run!(%Q{echo #{new_string} > public/assets/file.txt}) - run!(%Q{git add -A; git commit -m 'updating file.txt'}) - app.push! - - # Asserts - result = app.run('cat public/assets/file.txt') - expect(result).not_to match(string) - expect(result).to match(new_string) + # it sets RAILS_SERVE_STATIC_FILES env var + output = app.run("rails runner 'puts ENV[%Q{RAILS_SERVE_STATIC_FILES}].present?'") + expect(output).to match(/true/) + end end end - it "should detect rails successfully" do - Hatchet::App.new('rails4-manifest').in_directory_fork do - expect(LanguagePack::Rails4.use?).to eq(true) - end - Hatchet::App.new('rails4-manifest').in_directory_fork do - expect(LanguagePack::Rails3.use?).to eq(false) - end - end + # before_deploy, add manifest file + it "should skip asset compilation when deployed with NEW manifest file" do + skip("Need RAILS_LTS_CREDS env var set") unless ENV["RAILS_LTS_CREDS"] - it "should skip asset compilation when deployed with manifest file" do - Hatchet::Runner.new("rails4-manifest").deploy do |app, heroku| - expect(app.output).to include("Detected manifest file, assuming assets were compiled locally") - expect(app.output).not_to match("Include 'rails_12factor' gem to enable all platform features") - end - end + Hatchet::Runner.new("rails42_default_ruby", config: rails_lts_config).tap do |app| + app.before_deploy do + Pathname("Gemfile").write("ruby '2.7.2'", mode: "a") + Pathname("public/assets/manifest-ccf61eade4793995271564a4767ce6b6.json").tap {|p| p.dirname.mkpath; FileUtils.touch(p) } + end - it "detects new manifest file (sprockets 3.x: .sprockets-manifest-.json) Rails 4.2" do - Hatchet::Runner.new("rails42_sprockets3_manifest").deploy do |app, heroku| - expect(app.output).to include("Detected manifest file, assuming assets were compiled locally") + app.deploy do + expect(app.output).to include("Detected manifest file, assuming assets were compiled locally") + end end end - it "upgraded from 3 to 4.2 missing ./bin still works" do - Hatchet::Runner.new("rails3-to-4-no-bin").deploy do |app, heroku| - expect(app.output).to include("Asset precompilation completed") + it "should skip asset compilation when deployed with OLD manifest file" do + skip("Need RAILS_LTS_CREDS env var set") unless ENV["RAILS_LTS_CREDS"] - expect(app.output).to match("WARNING") - expect(app.output).to match("Include 'rails_12factor' gem to enable all platform features") - - output = app.run("rails runner 'puts %Q{hello} + %Q{world}'") - expect(output).to match('helloworld') - end - end + Hatchet::Runner.new("rails42_default_ruby", config: rails_lts_config).tap do |app| + app.before_deploy do + Pathname("Gemfile").write("ruby '2.7.2'", mode: "a") + Pathname("public/assets/.sprockets-manifest-040763ccc5036260c52c6adcf77d73f7.json").tap {|p| p.dirname.mkpath; FileUtils.touch(p) } + end - it "fails compile if assets:precompile fails rails 4.2" do - Hatchet::Runner.new("rails4-fail-assets-compile", allow_failure: true).deploy do |app, heroku| - expect(app.output).to include("raising on assets:precompile on purpose") - expect(app).not_to be_deployed + app.deploy do + expect(app.output).to include("Detected manifest file, assuming assets were compiled locally") + end end end end From c532310930f57a50d73491e876d1e971bb995ccf Mon Sep 17 00:00:00 2001 From: Richard Schneeman Date: Thu, 28 Jan 2021 10:36:50 -0600 Subject: [PATCH 4/5] Use Ruby 2.7.2 for Rails LTS tests --- spec/hatchet/rails23_spec.rb | 2 +- spec/hatchet/rails3_spec.rb | 2 +- spec/hatchet/rails4_spec.rb | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/hatchet/rails23_spec.rb b/spec/hatchet/rails23_spec.rb index dd5c37b87..9c198e1da 100644 --- a/spec/hatchet/rails23_spec.rb +++ b/spec/hatchet/rails23_spec.rb @@ -6,7 +6,7 @@ Hatchet::Runner.new('rails_lts_23_default_ruby', config: rails_lts_config).tap do |app| app.before_deploy do - File.open("Gemfile", mode: "a") {|f| f.puts "ruby '2.6.6'" } + Pathname("Gemfile").write("ruby '2.7.2'", mode: "a") end app.deploy do diff --git a/spec/hatchet/rails3_spec.rb b/spec/hatchet/rails3_spec.rb index c1c40e9be..e4c9faf50 100644 --- a/spec/hatchet/rails3_spec.rb +++ b/spec/hatchet/rails3_spec.rb @@ -6,7 +6,7 @@ Hatchet::Runner.new("rails3_default_ruby", config: rails_lts_config).tap do |app| app.before_deploy do - File.open("Gemfile", mode: "a") {|f| f.puts "ruby '2.6.6'" } + Pathname("Gemfile").write("ruby '2.7.2'", mode: "a") end app.deploy do diff --git a/spec/hatchet/rails4_spec.rb b/spec/hatchet/rails4_spec.rb index 624aa9f53..de55b67f4 100644 --- a/spec/hatchet/rails4_spec.rb +++ b/spec/hatchet/rails4_spec.rb @@ -19,7 +19,6 @@ end end - # before_deploy, add manifest file it "should skip asset compilation when deployed with NEW manifest file" do skip("Need RAILS_LTS_CREDS env var set") unless ENV["RAILS_LTS_CREDS"] From 491f76f1d723aa85c1289e15446a711390e6de5d Mon Sep 17 00:00:00 2001 From: Richard Schneeman Date: Thu, 28 Jan 2021 10:44:14 -0600 Subject: [PATCH 5/5] Clean up hatchet apps --- hatchet.json | 2 -- hatchet.lock | 4 ---- spec/hatchet/ci_spec.rb | 6 ------ 3 files changed, 12 deletions(-) diff --git a/hatchet.json b/hatchet.json index 483c09c1a..a42cf1e30 100644 --- a/hatchet.json +++ b/hatchet.json @@ -64,8 +64,6 @@ "sharpstone/rails5_ruby_schema_format", "sharpstone/heroku-ci-json-example", "sharpstone/rails5_sql_schema_format", - "sharpstone/rails_31_ruby_schema_format", - "sharpstone/rails_31_sql_schema_format", "sharpstone/ruby_no_rails_test", "sharpstone/activerecord_rake_tasks_does_not_exist", "sharpstone/ci_fails_ruby_default_bundler" diff --git a/hatchet.lock b/hatchet.lock index 80a01b175..07afb37c4 100644 --- a/hatchet.lock +++ b/hatchet.lock @@ -23,10 +23,6 @@ - d76be86c66ae8f45ec611fb2c4d8eb3adac0ad4b - - "./repos/ci/rails5_sql_schema_format" - df48237c57f89bb3629937ae6b1d6af070100ed3 -- - "./repos/ci/rails_31_ruby_schema_format" - - 76dacc65e0483c7c0b659504d8d56e6cfaee4bf1 -- - "./repos/ci/rails_31_sql_schema_format" - - 540ec776eff3111ad9bb01af204c62725c94a11d - - "./repos/ci/ruby_no_rails_test" - 3916137106d59b008b67d738abe6a1438f8fbde6 - - "./repos/heroku/ruby-getting-started" diff --git a/spec/hatchet/ci_spec.rb b/spec/hatchet/ci_spec.rb index 473ab270b..832db823e 100644 --- a/spec/hatchet/ci_spec.rb +++ b/spec/hatchet/ci_spec.rb @@ -22,12 +22,6 @@ end end - it "Works with Rails 3.1 ruby schema apps" do - Hatchet::Runner.new("rails_31_ruby_schema_format").run_ci do |test_run| - expect(test_run.output).to match("db:schema:load completed") - end - end - it "Works with a vanilla ruby app" do Hatchet::Runner.new("ruby_no_rails_test").run_ci do |test_run| # Test no whitespace in front of output