Commit bc70d156 authored by Douwe Maan's avatar Douwe Maan Committed by Jose Ivan Vargas

Merge branch 'rs-stub-storage-availability-check' into 'master'

Stub `ForkedStorageCheck.storage_available?` by default in all specs

See merge request !13726
parent 23eae7ed
require 'spec_helper' require 'spec_helper'
describe Gitlab::Git::Storage::ForkedStorageCheck, skip_database_cleaner: true do describe Gitlab::Git::Storage::ForkedStorageCheck, broken_storage: true, skip_database_cleaner: true do
let(:existing_path) do let(:existing_path) do
existing_path = TestEnv.repos_path existing_path = TestEnv.repos_path
FileUtils.mkdir_p(existing_path) FileUtils.mkdir_p(existing_path)
......
...@@ -97,9 +97,15 @@ RSpec.configure do |config| ...@@ -97,9 +97,15 @@ RSpec.configure do |config|
reset_delivered_emails! reset_delivered_emails!
end end
if ENV['CI'] # Stub the `ForkedStorageCheck.storage_available?` method unless
config.around(:each) do |ex| # `:broken_storage` metadata is defined
ex.run_with_retry retry: 2 #
# This check can be slow and is unnecessary in a test environment where we
# know the storage is available, because we create it at runtime
config.before(:example) do |example|
unless example.metadata[:broken_storage]
allow(Gitlab::Git::Storage::ForkedStorageCheck)
.to receive(:storage_available?).and_return(true)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment