Commit c79f6bf3 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Factorized a utility to change hashed storage setting

It takes care of the restart etc, and hopefully that's where
we may become able to remove it (assuming GitLab 13 does not
remove the legacy storage altogether)
parent cf686dfb6150
......@@ -13,11 +13,8 @@ parametrize = pytest.mark.parametrize
@parametrize('hashed_storage', [True, False])
def test_group_project(app_settings, breaks_concurrent, hashed_storage):
heptapod = app_settings
heptapod.set_application_settings(hashed_storage_enabled=hashed_storage)
heptapod.restart_rails()
# recheck that the setting is applied
heptapod.sync_application_settings()
assert heptapod.settings['hashed_storage_enabled'] is hashed_storage
heptapod.apply_hashed_storage_setting(hashed_storage)
group = None
group_name = unique_name('test_group')
try:
......@@ -61,11 +58,7 @@ def test_group_project(app_settings, breaks_concurrent, hashed_storage):
@parametrize('hashed_storage', [True, False])
def test_subgroups(app_settings, breaks_concurrent, hashed_storage):
heptapod = app_settings
heptapod.set_application_settings(hashed_storage_enabled=hashed_storage)
heptapod.restart_rails()
# recheck that the setting is applied
heptapod.sync_application_settings()
assert heptapod.settings['hashed_storage_enabled'] is hashed_storage
heptapod.apply_hashed_storage_setting(hashed_storage)
user_name = 'test_basic'
group = subgroup = None
......
......@@ -383,6 +383,18 @@ class DockerHeptapod(Heptapod):
self.run_shell(('gitlab-ctl', 'restart', service))
self.wait_startup()
def apply_hashed_storage_setting(self, hashed_storage):
# TODO it would be tempting not to restart if the setting is already
# at the wished value, but this currently cannot take into account
# rollbacked values that aren't followed by a restart. This will
# be more complicated and take more time than we can afford right now
# to really make work.
self.set_application_settings(hashed_storage_enabled=hashed_storage)
self.restart_rails()
# recheck that the setting is applied
self.sync_application_settings()
assert self.settings['hashed_storage_enabled'] is hashed_storage
class SourceHeptapod(Heptapod):
"""An Heptapod server installed from source on the same system.
......
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