Skip to content
Snippets Groups Projects
Commit 98e433d1 authored by Marius Bobin's avatar Marius Bobin Committed by Reuben Pereira
Browse files

Merge branch 'ka/broken-master/3341' into 'master'

Improve test clean up for migration spec

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/129690



Merged-by: default avatarMarius Bobin <mbobin@gitlab.com>
Approved-by: default avatarMarius Bobin <mbobin@gitlab.com>
Co-authored-by: default avatarKrasimir Angelov <kangelov@gitlab.com>

(cherry picked from commit a662e9e2)

30449e6b Improve test clean up
parent 031783e2
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -50,6 +50,11 @@
connection.execute('ALTER TABLE epic_user_mentions ADD COLUMN IF NOT EXISTS note_id_convert_to_bigint integer')
end
 
after do
connection = described_class.new.connection
connection.execute('ALTER TABLE epic_user_mentions DROP COLUMN IF EXISTS note_id_convert_to_bigint')
end
it 'does not swap the columns' do
# rubocop: disable RSpec/AnyInstanceOf
allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(false)
Loading
Loading
@@ -115,6 +120,11 @@
BEGIN NEW."note_id_convert_to_bigint" := NEW."note_id"; RETURN NEW; END; $$;')
end
 
after do
connection = described_class.new.connection
connection.execute('ALTER TABLE epic_user_mentions DROP COLUMN IF EXISTS note_id_convert_to_bigint')
end
it 'swaps the columns' do
# rubocop: disable RSpec/AnyInstanceOf
allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(false)
Loading
Loading
Loading
Loading
@@ -50,6 +50,11 @@
connection.execute('ALTER TABLE suggestions ADD COLUMN IF NOT EXISTS note_id_convert_to_bigint integer')
end
 
after do
connection = described_class.new.connection
connection.execute('ALTER TABLE suggestions DROP COLUMN IF EXISTS note_id_convert_to_bigint')
end
it 'does not swap the columns' do
# rubocop: disable RSpec/AnyInstanceOf
allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(false)
Loading
Loading
@@ -115,6 +120,11 @@
BEGIN NEW."note_id_convert_to_bigint" := NEW."note_id"; RETURN NEW; END; $$;')
end
 
after do
connection = described_class.new.connection
connection.execute('ALTER TABLE suggestions DROP COLUMN IF EXISTS note_id_convert_to_bigint')
end
it 'swaps the columns' do
# rubocop: disable RSpec/AnyInstanceOf
allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(false)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment