diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-01-31 11:31:29 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-01-31 11:31:29 +0000 |
commit | 5d8bb33d48826abc7cd348a7c151c5b6985f0ade (patch) | |
tree | 24fdd6e911e931888c7786302016e603543c68f7 /spec/lib | |
parent | 4251c6565fa18ecd64befe3a2561df30d48d1846 (diff) | |
parent | 94a3dbca33634dd4f6a1de8b14cd2a4f0a9a0abc (diff) | |
download | gitlab-ce-5d8bb33d48826abc7cd348a7c151c5b6985f0ade.tar.gz |
Merge branch 'zj-gitaly-server-info' into 'master'
Gitaly Server info for admin panel
See merge request gitlab-org/gitlab-ce!16794
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitaly/server_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/lib/gitaly/server_spec.rb b/spec/lib/gitaly/server_spec.rb new file mode 100644 index 00000000000..ed5d56e91d4 --- /dev/null +++ b/spec/lib/gitaly/server_spec.rb @@ -0,0 +1,30 @@ +require 'spec_helper' + +describe Gitaly::Server do + describe '.all' do + let(:storages) { Gitlab.config.repositories.storages } + + it 'includes all storages' do + expect(storages.count).to eq(described_class.all.count) + expect(storages.keys).to eq(described_class.all.map(&:storage)) + end + end + + subject { described_class.all.first } + + it { is_expected.to respond_to(:server_version) } + it { is_expected.to respond_to(:git_binary_version) } + it { is_expected.to respond_to(:up_to_date?) } + it { is_expected.to respond_to(:address) } + + describe 'request memoization' do + context 'when requesting multiple properties', :request_store do + it 'uses memoization for the info request' do + expect do + subject.server_version + subject.up_to_date? + end.to change { Gitlab::GitalyClient.get_request_count }.by(1) + end + end + end +end |