diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-08-09 14:40:38 +0300 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-08-11 18:28:12 +0300 |
commit | 0bdde472e5fdc3ea31bfee6ba241f487334995c9 (patch) | |
tree | 0a952456a8c9e58a9a8576e8bc0ebc40200a2d41 /spec | |
parent | bb4704b9da7dcdb1539e6108d741dc6fa3a20459 (diff) |
Merge branch 'bvl-port-storage-spec-helpers-from-ee' into 'master'
Add a helper to stub storage settings with defaults
See merge request !13419
Diffstat (limited to 'spec')
-rw-r--r-- | spec/support/stub_configuration.rb | 11 |
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 |