Commit f109dc13 authored by Vasilii Iakliushin's avatar Vasilii Iakliushin

Merge branch 'stomlinson/remove-old-migration-testing-rake-task' into 'master'

Remove the gitlab:db:migration_testing rake task

See merge request gitlab-org/gitlab!71931
parents 397ad628 16eadd2b
......@@ -7,14 +7,8 @@ module Gitlab
BASE_RESULT_DIR = Rails.root.join('tmp', 'migration-testing').freeze
class << self
def up(legacy_pipeline: false)
result_dir = if legacy_pipeline
BASE_RESULT_DIR
else
BASE_RESULT_DIR.join('up')
end
Runner.new(direction: :up, migrations: migrations_for_up, result_dir: result_dir)
def up
Runner.new(direction: :up, migrations: migrations_for_up, result_dir: BASE_RESULT_DIR.join('up'))
end
def down
......
......@@ -223,12 +223,6 @@ namespace :gitlab do
end
end
# TODO: Remove this rake task after migrating the database testing runner to :up / :down versions of it
desc 'Run migrations with instrumentation'
task migration_testing: :environment do
Gitlab::Database::Migrations::Runner.up(legacy_pipeline: true).run
end
desc 'Run all pending batched migrations'
task execute_batched_migrations: :environment do
Gitlab::Database::BackgroundMigration::BatchedMigration.active.queue_order.each do |migration|
......
......@@ -57,18 +57,10 @@ RSpec.describe Gitlab::Database::Migrations::Runner do
describe '.up' do
context 'result directory' do
context 'legacy mode' do
it 'uses the root result directory' do
expect(described_class.up(legacy_pipeline: true).result_dir).to eq(result_dir)
end
end
context 'not legacy mode' do
it 'uses the /up subdirectory' do
expect(described_class.up.result_dir).to eq(result_dir.join('up'))
end
end
end
context 'migrations to run' do
subject(:up) { described_class.up }
......
......@@ -312,19 +312,6 @@ RSpec.describe 'gitlab:db namespace rake task', :silence_stdout do
subject
end
end
describe 'legacy rake task' do
subject { run_rake_task('gitlab:db:migration_testing') }
let(:runner) { double(Gitlab::Database::Migrations::Runner) }
it 'delegates to the migration runner in legacy mode' do
expect(::Gitlab::Database::Migrations::Runner).to receive(:up).with(legacy_pipeline: true).and_return(runner)
expect(runner).to receive(:run)
subject
end
end
end
describe '#execute_batched_migrations' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment