diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-08-07 22:06:11 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-08-09 11:56:14 +0200 |
commit | 016522dd5fc115e6a96155cf6192ff27f52c304c (patch) | |
tree | 8a3939afc1756cdbeb3aa7e16e3c2f13b200070d /spec/support/stub_configuration.rb | |
parent | 0ff90166ff607fc8fb71d4b7312457be7941be78 (diff) | |
download | gitlab-ce-016522dd5fc115e6a96155cf6192ff27f52c304c.tar.gz |
Add a helper to stub storage settings with defaultsbvl-port-storage-spec-helpers-from-ee
Diffstat (limited to 'spec/support/stub_configuration.rb')
-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 |