From 53d92ebc9ccd371cd5c2bf7fe1241b7972b3f028 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Sun, 6 Dec 2020 22:04:39 +0000 Subject: [PATCH] Merge pull request #2785 from rspec/update-ci-build-scripts-2020-11-22-for-main Updates from rspec-dev (2020-11-22) --- .github/workflows/ci.yml | 32 +++++++++++++++---- .rubocop_rspec_base.yml | 2 +- .travis.yml | 13 +------- Gemfile | 3 ++ script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/functions.sh | 2 +- script/predicate_functions.sh | 2 +- script/run_build | 2 +- script/update_rubygems_and_install_bundler | 2 +- spec/integration/suite_hooks_errors_spec.rb | 21 ++++++++++-- .../formatters/exception_presenter_spec.rb | 8 +++-- 12 files changed, 61 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70c3531e7c..023c590af0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -13,8 +13,8 @@ on: - '*' jobs: test: - name: Ruby ${{ matrix.ruby }} - runs-on: ubuntu-20.04 + name: Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }} + runs-on: ${{ matrix.os || 'ubuntu-20.04' }} strategy: matrix: ruby: @@ -27,15 +27,35 @@ jobs: - 2.2 - 2.1.9 - ruby-head + env: + - + DIFF_LCS_VERSION: "> 1.4.3" + include: + - ruby: jruby-9.2.13.0 + env: + JRUBY_OPTS: "--dev" + - ruby: jruby-9.1.17.0 + bundler: 1 + os: ubuntu-18.04 + env: + JRUBY_OPTS: "--dev" + - ruby: 2.7 + name_extra: "with diff-lcs 1.3" + env: + DIFF_LCS_VERSION: "~> 1.3.0" + - ruby: 2.7 + name_extra: "with diff-lcs 1.4.3" + env: + DIFF_LCS_VERSION: "1.4.3" fail-fast: false - continue-on-error: ${{ matrix.ruby == 'jruby-9.2.13.0' || endsWith(matrix.ruby, 'head') }} + continue-on-error: ${{ matrix.allow_failure || endsWith(matrix.ruby, 'head') }} + env: ${{ matrix.env }} steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: - bundler: ${{ (matrix.ruby == 'jruby-9.1.17.0' && 1) || 2 }} + bundler: ${{ matrix.bundler || 2 }} ruby-version: ${{ matrix.ruby }} - bundler-cache: true - run: script/update_rubygems_and_install_bundler - run: script/clone_all_rspec_repos - run: bundle install --binstubs --standalone diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 76b1b03dc5..6a42ca4b6f 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/.travis.yml b/.travis.yml index fc0b5d440e..a381fd7129 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # In order to install old Rubies, we need to use old Ubuntu distibution. @@ -20,9 +20,6 @@ rvm: - 1.9.3 - 2.0.0 - ree - - rbx-3 - - jruby-9.1.7.0 # pin JRuby to this until travis/rvm can install later versions - - jruby-head - jruby-1.7 env: - JRUBY_OPTS='--dev' @@ -30,14 +27,6 @@ matrix: include: - rvm: jruby-1.7 env: JRUBY_OPTS='--dev --1.8' - - rvm: 2.7.1 - env: DIFF_LCS_VERSION="~> 1.3.0" - - rvm: 2.7.1 - env: DIFF_LCS_VERSION="1.4.3" - allow_failures: - - rvm: jruby-head - - rvm: ruby-head - - rvm: rbx-3 fast_finish: true branches: only: diff --git a/Gemfile b/Gemfile index b50ea038ce..174b4073ae 100644 --- a/Gemfile +++ b/Gemfile @@ -46,6 +46,9 @@ elsif RUBY_VERSION < '2.0' gem 'ffi', '< 1.9.19' # ffi dropped Ruby 1.8 support in 1.9.19 elsif RUBY_VERSION < '2.3.0' gem 'ffi', '~> 1.12.0' +elsif defined?(RUBY_PLATFORM) && RUBY_PLATFORM == 'java' + # Until 1.13.2 is released + gem 'ffi', '~> 1.12.0' else gem 'ffi', '~> 1.13.0' end diff --git a/script/ci_functions.sh b/script/ci_functions.sh index b609ccc23a..5110b3622f 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index b720d98234..4261f5c2a5 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index f371e6e831..9a64d550d5 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index 8eb728b084..181df17e47 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { diff --git a/script/run_build b/script/run_build index 2d2aa5c05b..d4444c8b11 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index de69b3c49f..558923ac85 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2020-11-18T09:45:41+00:00 from the rspec-dev repo. +# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/spec/integration/suite_hooks_errors_spec.rb b/spec/integration/suite_hooks_errors_spec.rb index b4a862d2fe..9932a54d76 100644 --- a/spec/integration/suite_hooks_errors_spec.rb +++ b/spec/integration/suite_hooks_errors_spec.rb @@ -8,7 +8,9 @@ let(:failure_exit_code) { rand(97) + 2 } # 2..99 let(:error_exit_code) { failure_exit_code + 2 } # 4..101 - if RSpec::Support::Ruby.jruby_9000? + if RSpec::Support::Ruby.jruby_9000? && RSpec::Support::Ruby.jruby_version > '9.2.0.0' + let(:spec_line_suffix) { ":in `block in
'" } + elsif RSpec::Support::Ruby.jruby_9000? let(:spec_line_suffix) { ":in `block in (root)'" } elsif RSpec::Support::Ruby.jruby? let(:spec_line_suffix) { ":in `(root)'" } @@ -97,6 +99,19 @@ def run_spec_expecting_non_zero(before_or_after) end " + cause = + if RSpec::Support::Ruby.jruby_9000? && RSpec::Support::Ruby.jruby_version > '9.2.0.0' + unindent(<<-EOS) + # ------------------ + # --- Caused by: --- + # RuntimeError: + # before 1 + # ./the_spec.rb:3:in `block in
' + EOS + else + "" + end + run_command "the_spec.rb" expect(last_cmd_exit_status).to eq(error_exit_code) output = normalize_durations(last_cmd_stdout) @@ -116,14 +131,14 @@ def run_spec_expecting_non_zero(before_or_after) RuntimeError: after 2 # ./the_spec.rb:6#{spec_line_suffix} - + #{ cause } An error occurred in an `after(:suite)` hook. Failure/Error: c.after(:suite) { raise 'after 1' } RuntimeError: after 1 # ./the_spec.rb:5#{spec_line_suffix} - + #{ cause } Finished in n.nnnn seconds (files took n.nnnn seconds to load) 0 examples, 0 failures, 3 errors occurred outside of examples diff --git a/spec/rspec/core/formatters/exception_presenter_spec.rb b/spec/rspec/core/formatters/exception_presenter_spec.rb index a87815a68f..199b71c453 100644 --- a/spec/rspec/core/formatters/exception_presenter_spec.rb +++ b/spec/rspec/core/formatters/exception_presenter_spec.rb @@ -509,7 +509,9 @@ def read_failed_lines context 'and the line count does not exceed RSpec.configuration.max_displayed_failure_line_count' do it 'returns all the lines' do - pending 'https://github.com/jruby/jruby/issues/4737' if RSpec::Support::Ruby.jruby_9000? + if RSpec::Support::Ruby.jruby_9000? && RSpec::Support::Ruby.jruby_version < '9.2.0.0' + pending 'https://github.com/jruby/jruby/issues/4737' + end expect(read_failed_lines).to eq([ " expect('RSpec').to be_a(String).", " and start_with('R').", @@ -524,7 +526,9 @@ def read_failed_lines end it 'returns the lines without exceeding the max count' do - pending 'https://github.com/jruby/jruby/issues/4737' if RSpec::Support::Ruby.jruby_9000? + if RSpec::Support::Ruby.jruby_9000? && RSpec::Support::Ruby.jruby_version < '9.2.0.0' + pending 'https://github.com/jruby/jruby/issues/4737' + end expect(read_failed_lines).to eq([ " expect('RSpec').to be_a(String).", " and start_with('R')."