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

job_delay_calculator_spec.rb « github_import « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3ddf8136dcf88818c855348686c67d2403bfd985 (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
28
29
30
31
32
33
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::GithubImport::JobDelayCalculator, feature_category: :importers do
  let(:project) { build(:project) }

  let(:importer_class) do
    Class.new do
      attr_reader :project

      def initialize(project)
        @project = project
      end

      include Gitlab::GithubImport::JobDelayCalculator
    end
  end

  describe "#parallel_import_batch" do
    subject { importer_class.new(project).parallel_import_batch }

    it { is_expected.to eq({ size: 5000, delay: 1.minute }) }

    context 'when `github_import_increased_concurrent_workers` feature flag is disabled' do
      before do
        stub_feature_flags(github_import_increased_concurrent_workers: false)
      end

      it { is_expected.to eq({ size: 1000, delay: 1.minute }) }
    end
  end
end