From 4613b077b2411804e64f7387d97dd0e1faa8b5ac Mon Sep 17 00:00:00 2001 From: Nick Charlton Date: Mon, 13 Feb 2023 16:22:28 +0000 Subject: [PATCH] Drop support for Travis CI (#208) This removes all references, including the config file, documentation and CLI helper we have. --- .travis.yml | 18 ---- README.md | 37 +------- lib/appraisal/cli.rb | 8 -- lib/appraisal/travis_ci_helper.rb | 69 -------------- spec/acceptance/travis_ci_integration_spec.rb | 94 ------------------- 5 files changed, 2 insertions(+), 224 deletions(-) delete mode 100644 .travis.yml delete mode 100644 lib/appraisal/travis_ci_helper.rb delete mode 100644 spec/acceptance/travis_ci_integration_spec.rb diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 52dfa50d..00000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -before_install: gem install bundler:2.3.7 - -rvm: - - 2.3 - - 2.4 - - 2.5 - - 2.6 - - 2.7 - - jruby-9.2.9.0 - - ruby-head - - jruby-head - -matrix: - fast_finish: true - allow_failures: - - rvm: ruby-head - - rvm: jruby-head diff --git a/README.md b/README.md index ff5b7b3a..36638c3f 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,8 @@ Appraisal ========= -[![Build Status][Build Status Image]][Build Status] - Find out what your Ruby gems are worth. -[Build Status Image]: https://secure.travis-ci.org/thoughtbot/appraisal.svg?branch=master -[Build Status]: http://travis-ci.org/thoughtbot/appraisal - Synopsis -------- @@ -89,7 +84,7 @@ your real default task, which usually is your `test` task.) Note that this may conflict with your CI setup if you decide to split the test into multiple processes by Appraisal and you are using `rake` to run tests by -default. Please see **Travis CI Integration** for more detail. +default. ### Commands @@ -201,35 +196,7 @@ Version Control When using Appraisal, we recommend you check in the Gemfiles that Appraisal generates within the gemfiles directory, but exclude the lockfiles there (`*.gemfile.lock`.) The Gemfiles are useful when running your tests against a -continuous integration server such as [Travis CI][Travis CI]. - -[Travis CI]: https://travis-ci.org - -Travis CI integration ---------------------- - -If you're using Appraisal and using Travis CI, we're recommending you to setup -Travis to run the test against multiple generated Gemfiles. This can be done -by using `gemfile` setting: - - # In .travis.yml - gemfile: - - gemfiles/3.0.gemfile - - gemfiles/3.1.gemfile - - gemfiles/3.2.gemfile - -Please note that if you've set your default rake task to run the test against -all versions of its dependency, you might have to set a `script` setting: - - script: "bundle exec rake test" - -That will make sure that each of the test sub-job are not getting run more than -one time. - -You can also run your tests against multiple versions of Ruby locally, just -like running on Travis CI, by using [WWTD]. - -[WWTD]: https://github.com/grosser/wwtd +continuous integration server. Circle CI Integration --------------------- diff --git a/lib/appraisal/cli.rb b/lib/appraisal/cli.rb index 45a0294a..c6970a35 100644 --- a/lib/appraisal/cli.rb +++ b/lib/appraisal/cli.rb @@ -1,6 +1,5 @@ require 'thor' require 'fileutils' -require "appraisal/travis_ci_helper" module Appraisal class CLI < Thor @@ -63,17 +62,10 @@ def install end desc 'generate', 'Generate a gemfile for each appraisal' - method_option "travis", :type => :boolean, :default => false def generate AppraisalFile.each do |appraisal| appraisal.write_gemfile end - - if options[:travis] - TravisCIHelper.display_instruction - else - TravisCIHelper.validate_configuration_file - end end desc 'clean', 'Remove all generated gemfiles and lockfiles from gemfiles folder' diff --git a/lib/appraisal/travis_ci_helper.rb b/lib/appraisal/travis_ci_helper.rb deleted file mode 100644 index c8a1bf6b..00000000 --- a/lib/appraisal/travis_ci_helper.rb +++ /dev/null @@ -1,69 +0,0 @@ -require "appraisal/appraisal_file" -require "yaml" - -module Appraisal - class TravisCIHelper - NO_CONFIGURATION_WARNING = <<-WARNING.strip.gsub(/\s+/, " ") - Note: Run `appraisal generate --travis` to generate Travis CI - configuration. - WARNING - - INVALID_CONFIGURATION_WARNING = <<-WARNING.strip.gsub(/\s+/, " ") - Warning: Your gemfiles directive in .travis.yml is incorrect. Run - `appraisal generate --travis` to get the correct configuration. - WARNING - - # @see http://docs.travis-ci.com/user/languages/ruby/ - GEMFILES_CONFIGURATION_KEY = "gemfile".freeze - - def self.display_instruction - puts "# Put this in your .travis.yml" - puts "#{GEMFILES_CONFIGURATION_KEY}:" - - AppraisalFile.each do |appraisal| - puts " - #{appraisal.relative_gemfile_path}" - end - end - - def self.validate_configuration_file - ConfigurationValidator.new.validate - end - - class ConfigurationValidator - CONFIGURATION_FILE = ".travis.yml" - - def validate - if has_configuration_file? - if has_no_gemfiles_configuration? - $stderr.puts(NO_CONFIGURATION_WARNING) - elsif has_invalid_gemfiles_configuration? - $stderr.puts(INVALID_CONFIGURATION_WARNING) - end - end - end - - private - - def has_configuration_file? - File.exist?(CONFIGURATION_FILE) - end - - def has_no_gemfiles_configuration? - !(configuration && configuration.has_key?(GEMFILES_CONFIGURATION_KEY)) - end - - def has_invalid_gemfiles_configuration? - if configuration && configuration[GEMFILES_CONFIGURATION_KEY] - appraisal_paths = - AppraisalFile.new.appraisals.map(&:relative_gemfile_path).sort - travis_gemfile_paths = configuration[GEMFILES_CONFIGURATION_KEY].sort - appraisal_paths != travis_gemfile_paths - end - end - - def configuration - YAML.load_file(CONFIGURATION_FILE) rescue nil - end - end - end -end diff --git a/spec/acceptance/travis_ci_integration_spec.rb b/spec/acceptance/travis_ci_integration_spec.rb deleted file mode 100644 index 19e1000f..00000000 --- a/spec/acceptance/travis_ci_integration_spec.rb +++ /dev/null @@ -1,94 +0,0 @@ -require "spec_helper" -require "active_support/core_ext/kernel/reporting" -require "appraisal/travis_ci_helper" - -describe "Travis CI integration" do - before do - build_appraisal_file <<-Appraisals.strip_heredoc - appraise "1.0.0" do - gem "dummy", "1.0.0" - end - - appraise "1.1.0" do - gem "dummy", "1.1.0" - end - Appraisals - end - - context "when user runs `appraisal generate --travis`" do - it "displays a correct Gemfile directive" do - output = run("appraisal generate --travis") - - expect(output).to include <<-stdout.strip_heredoc - # Put this in your .travis.yml - gemfile: - - gemfiles/1.0.0.gemfile - - gemfiles/1.1.0.gemfile - stdout - end - end - - context "When user has .travis.yml" do - context "with no gemfiles directive" do - before do - write_file ".travis.yml", "" - end - - it "displays a warning message when run `appraisal generate`" do - warning = run "appraisal generate 2>&1" - - expect(warning).to include no_configuration_warning - end - end - - context "with incorrect gemfiles directive" do - before do - write_file ".travis.yml", <<-travis_yml - gemfile: - - gemfiles/1.0.0.gemfile - - gemfiles/1.0.1.gemfile - travis_yml - end - - it "displays a warning message when run `appraisal generate`" do - warning = run "appraisal generate 2>&1" - - expect(warning).to include invalid_configuration_warning - end - end - - context "with correct gemfiles directive" do - before do - write_file ".travis.yml", <<-travis_yml - gemfile: - - gemfiles/1.0.0.gemfile - - gemfiles/1.1.0.gemfile - travis_yml - end - - it "does not display any warning when run `appraisal generate`" do - warning = run "appraisal generate 2>&1" - - expect(warning).not_to include no_configuration_warning - expect(warning).not_to include invalid_configuration_warning - end - end - end - - context "when user does not have .travis.yml" do - it "does not display any warning when run `appraisal generate`" do - warning = run "appraisal generate 2>&1" - - expect(warning).not_to include no_configuration_warning - expect(warning).not_to include invalid_configuration_warning - end - end - - def no_configuration_warning - Appraisal::TravisCIHelper::NO_CONFIGURATION_WARNING - end - - def invalid_configuration_warning - Appraisal::TravisCIHelper::INVALID_CONFIGURATION_WARNING - end -end