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

Tweaks to prevent flakeyness with local builds #2898

Merged
merged 4 commits into from
Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ elsif RUBY_VERSION < '2.0'
elsif RUBY_VERSION < '2.3.0'
gem 'ffi', '~> 1.12.0'
else
# Until 1.13.2 is released due to Rubygems usage
gem 'ffi', '~> 1.12.0'
gem 'ffi', '~> 1.15.0'
end

if RUBY_VERSION < '2.3.0' && !!(RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/)
Expand Down
10 changes: 7 additions & 3 deletions script/predicate_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,13 @@ function documentation_enforced {
}

function style_and_lint_enforced {
if [ -x ./bin/rubocop ]; then
return 0
else
if is_ruby_head; then
return 1
else
if [ -x ./bin/rubocop ]; then
return 0
else
return 1
fi
fi
}
1 change: 1 addition & 0 deletions spec/integration/spec_file_load_errors_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

RSpec.configure do |c|
c.filter_gems_from_backtrace "gems/aruba"
c.filter_gems_from_backtrace "gems/bundler"
c.backtrace_exclusion_patterns << %r{/rspec-core/spec/} << %r{rspec_with_simplecov}
c.failure_exit_code = failure_exit_code
c.error_exit_code = error_exit_code
Expand Down
1 change: 1 addition & 0 deletions spec/integration/suite_hooks_errors_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

RSpec.configure do |c|
c.filter_gems_from_backtrace "gems/aruba"
c.filter_gems_from_backtrace "gems/bundler"
c.backtrace_exclusion_patterns << %r{/rspec-core/spec/} << %r{rspec_with_simplecov}
c.failure_exit_code = failure_exit_code
c.error_exit_code = error_exit_code
Expand Down
4 changes: 2 additions & 2 deletions spec/rspec/core/formatters/base_text_formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,15 @@ def run_all_and_dump_failures
it "does not show the error class" do
group.example("example name") { expect("this").to eq("that") }
run_all_and_dump_failures
expect(formatter_output.string).not_to match(/RSpec/m)
expect(formatter_output.string).not_to match(/RSpec::/m)
end
end

context "with a failed message expectation (rspec-mocks)" do
it "does not show the error class" do
group.example("example name") { expect("this").to receive("that") }
run_all_and_dump_failures
expect(formatter_output.string).not_to match(/RSpec/m)
expect(formatter_output.string).not_to match(/RSpec::/m)
end
end

Expand Down
12 changes: 7 additions & 5 deletions spec/support/formatter_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def run_rspec_with_formatter(formatter, options={})

runner = RSpec::Core::Runner.new(options)
configuration = runner.configuration
configuration.filter_gems_from_backtrace "gems/bundler"
configuration.backtrace_formatter.exclusion_patterns << /rspec_with_simplecov/
configuration.backtrace_formatter.inclusion_patterns = []

Expand All @@ -41,6 +42,7 @@ def run_rspec_with_formatter(formatter, options={})
runner.run(err, out)
out.string
end
RUN_LINE = __LINE__ - 3

def normalize_durations(output)
output.gsub(/(?:\d+ minutes? )?\d+(?:\.\d+)?(s| seconds?)/) do |dur|
Expand All @@ -67,7 +69,7 @@ def expected_summary_output_for_example_specs
|
| (compared using ==)
| # ./spec/rspec/core/resources/formatter_specs.rb:18
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
| # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter'
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
| # ./spec/support/sandboxing.rb:16
| # ./spec/support/sandboxing.rb:7
Expand All @@ -87,7 +89,7 @@ def expected_summary_output_for_example_specs
|
| (compared using ==)
| # ./spec/rspec/core/resources/formatter_specs.rb:37
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
| # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter'
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
| # ./spec/support/sandboxing.rb:16
| # ./spec/support/sandboxing.rb:7
Expand Down Expand Up @@ -162,7 +164,7 @@ def expected_summary_output_for_example_specs
|
| (compared using ==)
| # ./spec/rspec/core/resources/formatter_specs.rb:18:in `block (3 levels) in <top (required)>'
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
| # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter'
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
| # ./spec/support/sandboxing.rb:16:in `block (3 levels) in <top (required)>'
| # ./spec/support/sandboxing.rb:7:in `block (2 levels) in <top (required)>'
Expand All @@ -182,7 +184,7 @@ def expected_summary_output_for_example_specs
|
| (compared using ==)
| # ./spec/rspec/core/resources/formatter_specs.rb:37:in `block (2 levels) in <top (required)>'
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
| # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter'
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
| # ./spec/support/sandboxing.rb:16:in `block (3 levels) in <top (required)>'
| # ./spec/support/sandboxing.rb:7:in `block (2 levels) in <top (required)>'
Expand Down Expand Up @@ -213,7 +215,7 @@ def expected_summary_output_for_example_specs
| foo
| # (erb):1:in `<main>'
| # ./spec/rspec/core/resources/formatter_specs.rb:50:in `block (2 levels) in <top (required)>'
| # ./spec/support/formatter_support.rb:41:in `run_rspec_with_formatter'
| # ./spec/support/formatter_support.rb:#{RUN_LINE}:in `run_rspec_with_formatter'
| # ./spec/support/formatter_support.rb:3:in `run_example_specs_with_formatter'
| # ./spec/support/sandboxing.rb:16:in `block (3 levels) in <top (required)>'
| # ./spec/support/sandboxing.rb:7:in `block (2 levels) in <top (required)>'
Expand Down