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

redis_spec.rb « health_checks « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2460f57a9ec9af2ab230e9a0a81c1c67d1162ec6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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