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

partition_management_worker_spec.rb « database « workers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9ded36743a817c94c502c403c4192bc06e711f16 (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
27
# frozen_string_literal: true

require "spec_helper"

RSpec.describe Database::PartitionManagementWorker do
  describe '#perform' do
    subject { described_class.new.perform }

    let(:monitoring) { instance_double('PartitionMonitoring', report_metrics: nil) }

    before do
      allow(Gitlab::Database::Partitioning::PartitionMonitoring).to receive(:new).and_return(monitoring)
    end

    it 'delegates to Partitioning' do
      expect(Gitlab::Database::Partitioning).to receive(:sync_partitions)

      subject
    end

    it 'reports partition metrics' do
      expect(monitoring).to receive(:report_metrics)

      subject
    end
  end
end