mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
spec_helper: retry failing CI tests.
This should help avoid a bit of the flakiness we see in builds at the cost of a slight slowdown on retries.
This commit is contained in:
parent
4398e7bf79
commit
3fc76171ca
@ -78,6 +78,17 @@ RSpec.configure do |config|
|
|||||||
c.max_formatted_output_length = 200
|
c.max_formatted_output_length = 200
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Use rspec-retry in CI.
|
||||||
|
if ENV["CI"]
|
||||||
|
config.verbose_retry = true
|
||||||
|
config.display_try_failure_messages = true
|
||||||
|
config.default_retry_count = 2
|
||||||
|
|
||||||
|
config.around(:each, :needs_network) do |example|
|
||||||
|
example.run_with_retry retry: 3, retry_wait: 3
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Never truncate output objects.
|
# Never truncate output objects.
|
||||||
RSpec::Support::ObjectFormatter.default_instance.max_formatted_output_length = nil
|
RSpec::Support::ObjectFormatter.default_instance.max_formatted_output_length = nil
|
||||||
|
|
||||||
@ -124,10 +135,6 @@ RSpec.configure do |config|
|
|||||||
skip "Requires network connection." unless ENV["HOMEBREW_TEST_ONLINE"]
|
skip "Requires network connection." unless ENV["HOMEBREW_TEST_ONLINE"]
|
||||||
end
|
end
|
||||||
|
|
||||||
config.around(:each, :needs_network) do |example|
|
|
||||||
example.run_with_retry retry: 3, retry_wait: 1
|
|
||||||
end
|
|
||||||
|
|
||||||
config.before(:each, :needs_svn) do
|
config.before(:each, :needs_svn) do
|
||||||
skip "subversion not installed." unless quiet_system "#{HOMEBREW_SHIMS_PATH}/scm/svn", "--version"
|
skip "subversion not installed." unless quiet_system "#{HOMEBREW_SHIMS_PATH}/scm/svn", "--version"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user