blob: f7713237b38b65d9230d51088e0f40b4ee78deb2 (
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
|
# frozen_string_literal: true
module Gitlab
module Database
module Migrations
class TestBackgroundRunner < BaseBackgroundRunner
def initialize(result_dir:)
super(result_dir: result_dir)
@job_coordinator = Gitlab::BackgroundMigration.coordinator_for_database(Gitlab::Database::MAIN_DATABASE_NAME)
end
def traditional_background_migrations
@job_coordinator.pending_jobs
end
def jobs_by_migration_name
traditional_background_migrations.group_by { |j| class_name_for_job(j) }
end
private
def run_job(job)
Gitlab::BackgroundMigration.perform(job.args[0], job.args[1])
end
def class_name_for_job(job)
job.args[0]
end
end
end
end
end
|