Commit 1da119ac authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'sh-check-features-table-gitaly' into 'master'

Fix rake gitlab:setup failing on new installs

Closes #212759

See merge request gitlab-org/gitlab!28270
parents c5e82147 65ce9d24
---
title: Fix rake gitlab:setup failing on new installs
merge_request: 28270
author:
type: fixed
......@@ -14,6 +14,9 @@ class Feature
end
def server_feature_flags
# We need to check that both the DB connection and table exists
return {} unless ::Gitlab::Database.cached_table_exists?(FlipperFeature.table_name)
Feature.persisted_names
.select { |f| f.start_with?(PREFIX) }
.map do |f|
......
......@@ -32,5 +32,15 @@ describe Feature::Gitaly do
it { is_expected.to be_a(Hash) }
it { is_expected.to eq("gitaly-feature-mep-mep" => "true") }
context 'when table does not exist' do
before do
allow(::Gitlab::Database).to receive(:cached_table_exists?).and_return(false)
end
it 'returns an empty Hash' do
expect(subject).to eq({})
end
end
end
end
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