diff options
Diffstat (limited to 'spec/lib/gitlab/health_checks/gitaly_check_spec.rb')
-rw-r--r-- | spec/lib/gitlab/health_checks/gitaly_check_spec.rb | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/spec/lib/gitlab/health_checks/gitaly_check_spec.rb b/spec/lib/gitlab/health_checks/gitaly_check_spec.rb index 948452c0b58..64c4e92f80b 100644 --- a/spec/lib/gitlab/health_checks/gitaly_check_spec.rb +++ b/spec/lib/gitlab/health_checks/gitaly_check_spec.rb @@ -14,36 +14,20 @@ RSpec.describe Gitlab::HealthChecks::GitalyCheck do subject { described_class.readiness } before do - expect(Gitlab::GitalyClient::HealthCheckService).to receive(:new).and_return(healthy_check) + expect(Gitlab::GitalyClient::HealthCheckService).to receive(:new).and_return(gitaly_check) end context 'Gitaly server is up' do - before do - expect(Gitlab::GitalyClient::ServerService).to receive(:new).and_return(ready_check) - end - - let(:healthy_check) { double(check: { success: true }) } - let(:ready_check) { double(readiness_check: { success: true }) } + let(:gitaly_check) { double(check: { success: true }) } it { is_expected.to eq([result_class.new('gitaly_check', true, nil, shard: 'default')]) } end context 'Gitaly server is down' do - let(:healthy_check) { double(check: { success: false, message: 'Connection refused' }) } + let(:gitaly_check) { double(check: { success: false, message: 'Connection refused' }) } it { is_expected.to eq([result_class.new('gitaly_check', false, 'Connection refused', shard: 'default')]) } end - - context 'Gitaly server is not ready' do - before do - expect(Gitlab::GitalyClient::ServerService).to receive(:new).and_return(ready_check) - end - - let(:healthy_check) { double(check: { success: true }) } - let(:ready_check) { double(readiness_check: { success: false, message: 'A readiness check has failed' }) } - - it { is_expected.to match_array([result_class.new('gitaly_check', false, 'A readiness check has failed', shard: 'default')]) } - end end describe '#metrics' do |