Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #593 from rspec/update-ci-build-scripts-2024-02-23…
Browse files Browse the repository at this point in the history
…-for-main

Updates from rspec-dev (2024-02-23)
  • Loading branch information
JonRowe committed Feb 23, 2024
1 parent d828b34 commit b34c206
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo.
# This file was generated on 2024-02-23T14:21:37+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.

version: 2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo.
# This file was generated on 2024-02-23T14:21:37+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
Expand Down
2 changes: 1 addition & 1 deletion .rubocop_rspec_base.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo.
# This file was generated on 2024-02-23T14:21:37+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
Expand Down
11 changes: 10 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ branch = File.read(File.expand_path("../maintenance-branch", __FILE__)).chomp
if File.exist?(library_path) && !ENV['USE_GIT_REPOS']
gem lib, :path => library_path
else
gem lib, :git => "https://github.com/rspec/#{lib}.git", :branch => branch
if lib == 'rspec'
gem 'rspec', :git => "https://github.com/rspec/rspec-metagem.git", :branch => branch
else
gem lib, :git => "https://github.com/rspec/#{lib}.git", :branch => branch
end
end
end

Expand All @@ -27,6 +31,11 @@ else
gem 'diff-lcs', '~> 1.4', '>= 1.4.3'
end

if RUBY_VERSION >= '3.3.0'
# This is being extracted in Ruby 3.4 and issues a warning on 3.3
gem 'bigdecimal', :require => false
end

if RUBY_VERSION < '2.3.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/)
gem "childprocess", "< 1.0.0"
elsif RUBY_VERSION < '2.0.0'
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/support/caller_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CallerFilter
# when `CallerFilter.first_non_rspec_line` is called from the top level of a required
# file, but it depends on if rubygems is loaded or not. We don't want to have to deal
# with this complexity in our `RSpec.deprecate` calls, so we ignore it here.
IGNORE_REGEX = Regexp.union(LIB_REGEX, "rubygems/core_ext/kernel_require.rb", "<internal:")
IGNORE_REGEX = Regexp.union(LIB_REGEX, "rubygems/core_ext/kernel_require.rb", "<internal:", %r{/lib/ruby/[^/]+/bundled_gems\.rb})

if RSpec::Support::RubyFeatures.caller_locations_supported?
# This supports args because it's more efficient when the caller specifies
Expand Down
30 changes: 3 additions & 27 deletions script/ci_functions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo.
# This file was generated on 2024-02-23T14:21:37+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:
Expand Down Expand Up @@ -30,41 +30,17 @@ nano_cmd="$(type -p gdate date | head -1)"
nano_format="+%s%N"
[ "$(uname -s)" != "Darwin" ] || nano_format="${nano_format/%N/000000000}"

travis_time_start() {
travis_timer_id=$(printf %08x $(( RANDOM * RANDOM )))
travis_start_time=$($nano_cmd -u "$nano_format")
printf "travis_time:start:%s\r\e[0m" $travis_timer_id
}

travis_time_finish() {
local travis_end_time=$($nano_cmd -u "$nano_format")
local duration=$(($travis_end_time-$travis_start_time))
printf "travis_time:end:%s:start=%s,finish=%s,duration=%s\r\e[0m" \
$travis_timer_id $travis_start_time $travis_end_time $duration
}

fold() {
local name="$1"
local status=0
shift 1
if [ -n "$TRAVIS" ]; then
printf "travis_fold:start:%s\r\e[0m" "$name"
travis_time_start
else
echo "============= Starting $name ==============="
fi
echo "============= Starting $name ==============="

"$@"
status=$?

[ -z "$TRAVIS" ] || travis_time_finish

if [ "$status" -eq 0 ]; then
if [ -n "$TRAVIS" ]; then
printf "travis_fold:end:%s\r\e[0m" "$name"
else
echo "============= Ending $name ==============="
fi
echo "============= Ending $name ==============="
else
STATUS="$status"
fi
Expand Down
4 changes: 2 additions & 2 deletions script/clone_all_rspec_repos
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo.
# This file was generated on 2024-02-23T14:21:37+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
Expand All @@ -8,7 +8,7 @@ source script/functions.sh
if is_mri; then
pushd ..

clone_repo "rspec"
clone_repo "rspec-metagem" "rspec"
clone_repo "rspec-core"
clone_repo "rspec-expectations"
clone_repo "rspec-mocks"
Expand Down
2 changes: 1 addition & 1 deletion script/cucumber.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo.
# This file was generated on 2024-02-23T14:21:37+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
Expand Down
13 changes: 9 additions & 4 deletions script/functions.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo.
# This file was generated on 2024-02-23T14:21:37+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 )"
source $SCRIPT_DIR/ci_functions.sh
source $SCRIPT_DIR/predicate_functions.sh

# If JRUBY_OPTS isn't set, use these.
# see https://docs.travis-ci.com/user/ci-environment/
export JRUBY_OPTS=${JRUBY_OPTS:-"--server -Xcompile.invokedynamic=false"}
SPECS_HAVE_RUN_FILE=specs.out
MAINTENANCE_BRANCH=`cat maintenance-branch`
Expand All @@ -20,12 +19,18 @@ fi
function clone_repo {
if [ ! -d $1 ]; then # don't clone if the dir is already there
if [ -z "$2" ]; then
DIR_TARGET="$1"
else
DIR_TARGET="$2"
fi

if [ -z "$3" ]; then
BRANCH_TO_CLONE="${MAINTENANCE_BRANCH?}";
else
BRANCH_TO_CLONE="$2";
BRANCH_TO_CLONE="$3";
fi;

ci_retry eval "git clone https://github.com/rspec/$1 --depth 1 --branch ${BRANCH_TO_CLONE?}"
ci_retry eval "git clone https://github.com/rspec/$1 --depth 1 --branch ${BRANCH_TO_CLONE?} ${DIR_TARGET?}"
fi;
}

Expand Down
2 changes: 1 addition & 1 deletion script/legacy_setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo.
# This file was generated on 2024-02-23T14:21:37+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
Expand Down
2 changes: 1 addition & 1 deletion script/predicate_functions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo.
# This file was generated on 2024-02-23T14:21:37+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 {
Expand Down
2 changes: 1 addition & 1 deletion script/run_build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo.
# This file was generated on 2024-02-23T14:21:37+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
Expand Down
2 changes: 1 addition & 1 deletion script/run_rubocop
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo.
# This file was generated on 2024-02-23T14:21:37+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
Expand Down
8 changes: 4 additions & 4 deletions script/update_rubygems_and_install_bundler
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash
# This file was generated on 2023-12-25T16:07:50+00:00 from the rspec-dev repo.
# This file was generated on 2024-02-23T14:21:37+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
source script/functions.sh

if is_ruby_31_plus; then
echo "Installing rubygems 3.3.6 / bundler 2.3.6"
yes | gem update --system '3.3.6'
yes | gem install bundler -v '2.3.6'
echo "Installing most recent rubygems / bundler"
yes | gem update --no-document --system
yes | gem install --no-document bundler
elif is_ruby_23_plus; then
echo "Installing rubygems 3.2.22 / bundler 2.2.22"
yes | gem update --system '3.2.22'
Expand Down
4 changes: 2 additions & 2 deletions spec/rspec/support/fuzzy_matcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def ==(other)
end

before(:context) do
expect { Color.new(0, 0, 0) == Object.new }.to raise_error(NoMethodError, /undefined method `r'/)
expect { Color.new(0, 0, 0) == Object.new }.to raise_error(NoMethodError, /undefined method [`']r'/)
end

it 'can match against an expected value that matches anything' do
Expand All @@ -78,7 +78,7 @@ def o.===(*); true; end
it 'surfaces the `NoMethodError` when used as the expected value' do
expect {
FuzzyMatcher.values_match?(Color.new(0, 0, 0), Object.new)
}.to raise_error(NoMethodError, /undefined method `r'/)
}.to raise_error(NoMethodError, /undefined method [`']r'/)
end

it 'can match against objects of the same type' do
Expand Down

0 comments on commit b34c206

Please sign in to comment.