Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-01-30 13:11:47 +0300
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-01-31 10:54:45 +0300
commit94a3dbca33634dd4f6a1de8b14cd2a4f0a9a0abc (patch)
tree6a21432626eb9b37b748cb8a94403ea771025f22 /spec/lib/gitaly
parente74e6fcb5eecb7841a412cb0d3e9627556d83eaf (diff)
Gitaly Server info for admin panel
Implements the client side for gitlab-org/gitaly#819. Which is a server info command. This checks the server version and git binairy version on the server. A small UI was added for administrators, so they can check the status of the Gitaly server. This is done for each storage the monolith knows. Because of this commit, gitlab-org/gitlab-ce!15580 is now closed. That MR removed the Git version too, but didn't replace it with anything.
Diffstat (limited to 'spec/lib/gitaly')
-rw-r--r--spec/lib/gitaly/server_spec.rb30
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