debian-mirror-gitlab/spec/lib/gitlab/health_checks/redis_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
869 B
Ruby
Raw Normal View History

2022-10-11 01:57:18 +05:30
# frozen_string_literal: true
require 'spec_helper'
require_relative './simple_check_shared'
RSpec.describe Gitlab::HealthChecks::Redis do
describe "ALL_INSTANCE_CHECKS" do
subject { described_class::ALL_INSTANCE_CHECKS }
it { is_expected.to include(described_class::CacheCheck, described_class::QueuesCheck) }
it "contains a check for each redis instance" do
expect(subject.map(&:redis_instance_class_name)).to contain_exactly(*Gitlab::Redis::ALL_CLASSES)
end
end
describe 'all checks' do
described_class::ALL_INSTANCE_CHECKS.each do |check|
describe check do
include_examples 'simple_check',
"redis_#{check.redis_instance_class_name.store_name.underscore}_ping",
check.redis_instance_class_name.store_name,
'PONG'
end
end
end
end