diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-08-23 08:51:59 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-08-23 08:51:59 +0000 |
commit | 08c07ad145eeac455536a91ca35f183dbc67c9a6 (patch) | |
tree | c258f731882d5335f4c795ef4a863c6ca55fab9b | |
parent | 459631acdbbfabe1eadda8feb45d49d4a0c3e412 (diff) | |
parent | a6fbd8648e782d871482cad5719a4fdd9fa5a6bc (diff) | |
download | gitlab-ce-08c07ad145eeac455536a91ca35f183dbc67c9a6.tar.gz |
Merge branch 'rs-stub-storage-availability-check' into 'master'
Stub `ForkedStorageCheck.storage_available?` by default in all specs
See merge request !13726
-rw-r--r-- | spec/lib/gitlab/git/storage/forked_storage_check_spec.rb | 2 | ||||
-rw-r--r-- | spec/spec_helper.rb | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/spec/lib/gitlab/git/storage/forked_storage_check_spec.rb b/spec/lib/gitlab/git/storage/forked_storage_check_spec.rb index 12366151f44..c708b15853a 100644 --- a/spec/lib/gitlab/git/storage/forked_storage_check_spec.rb +++ b/spec/lib/gitlab/git/storage/forked_storage_check_spec.rb @@ -1,6 +1,6 @@ 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 existing_path = TestEnv.repos_path FileUtils.mkdir_p(existing_path) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c10197ff651..ff1754fbe7e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -105,6 +105,18 @@ RSpec.configure do |config| reset_delivered_emails! end + # Stub the `ForkedStorageCheck.storage_available?` method unless + # `:broken_storage` metadata is defined + # + # 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 + config.around(:each, :use_clean_rails_memory_store_caching) do |example| caching_store = Rails.cache Rails.cache = ActiveSupport::Cache::MemoryStore.new |