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:
Diffstat (limited to 'spec/lib/gitlab/health_checks/redis_spec.rb')
-rw-r--r--spec/lib/gitlab/health_checks/redis_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/lib/gitlab/health_checks/redis_spec.rb b/spec/lib/gitlab/health_checks/redis_spec.rb
new file mode 100644
index 00000000000..2460f57a9ec
--- /dev/null
+++ b/spec/lib/gitlab/health_checks/redis_spec.rb
@@ -0,0 +1,26 @@
+# 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