summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-08-07 22:06:11 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2017-08-09 11:56:14 +0200
commit016522dd5fc115e6a96155cf6192ff27f52c304c (patch)
tree8a3939afc1756cdbeb3aa7e16e3c2f13b200070d
parent0ff90166ff607fc8fb71d4b7312457be7941be78 (diff)
downloadgitlab-ce-bvl-port-storage-spec-helpers-from-ee.tar.gz
Add a helper to stub storage settings with defaultsbvl-port-storage-spec-helpers-from-ee
-rw-r--r--spec/support/stub_configuration.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/support/stub_configuration.rb b/spec/support/stub_configuration.rb
index 516f8878679..37c89d37aa0 100644
--- a/spec/support/stub_configuration.rb
+++ b/spec/support/stub_configuration.rb
@@ -38,6 +38,17 @@ module StubConfiguration
allow(Gitlab.config.backup).to receive_messages(to_settings(messages))
end
+ def stub_storage_settings(messages)
+ messages.each do |storage_name, storage_settings|
+ storage_settings['failure_count_threshold'] ||= 10
+ storage_settings['failure_wait_time'] ||= 30
+ storage_settings['failure_reset_time'] ||= 1800
+ storage_settings['storage_timeout'] ||= 5
+ end
+
+ allow(Gitlab.config.repositories).to receive(:storages).and_return(messages)
+ end
+
private
# Modifies stubbed messages to also stub possible predicate versions