Commit 4419289b authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fix migration specs that can not run within transaction

parent 3fd4a37d
...@@ -3,6 +3,8 @@ class MigrateBuildStageReference < ActiveRecord::Migration ...@@ -3,6 +3,8 @@ class MigrateBuildStageReference < ActiveRecord::Migration
DOWNTIME = false DOWNTIME = false
disable_ddl_transaction!
def up def up
disable_statement_timeout disable_statement_timeout
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase do describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :truncate do
let(:migration) { FakeRenameReservedPathMigrationV1.new } let(:migration) { FakeRenameReservedPathMigrationV1.new }
let(:subject) { described_class.new(['the-path'], migration) } let(:subject) { described_class.new(['the-path'], migration) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameProjects do describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameProjects, :truncate do
let(:migration) { FakeRenameReservedPathMigrationV1.new } let(:migration) { FakeRenameReservedPathMigrationV1.new }
let(:subject) { described_class.new(['the-path'], migration) } let(:subject) { described_class.new(['the-path'], migration) }
......
...@@ -13,7 +13,7 @@ shared_examples 'renames child namespaces' do |type| ...@@ -13,7 +13,7 @@ shared_examples 'renames child namespaces' do |type|
end end
end end
describe Gitlab::Database::RenameReservedPathsMigration::V1 do describe Gitlab::Database::RenameReservedPathsMigration::V1, :truncate do
let(:subject) { FakeRenameReservedPathMigrationV1.new } let(:subject) { FakeRenameReservedPathMigrationV1.new }
before do before do
......
require 'spec_helper' require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20170508170547_add_head_pipeline_for_each_merge_request.rb') require Rails.root.join('db', 'post_migrate', '20170508170547_add_head_pipeline_for_each_merge_request.rb')
describe AddHeadPipelineForEachMergeRequest do describe AddHeadPipelineForEachMergeRequest, :truncate do
let(:migration) { described_class.new } let(:migration) { described_class.new }
let!(:project) { create(:empty_project) } let!(:project) { create(:empty_project) }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20170324160416_migrate_user_activities_to_users_last_activity_on.rb') require Rails.root.join('db', 'post_migrate', '20170324160416_migrate_user_activities_to_users_last_activity_on.rb')
describe MigrateUserActivitiesToUsersLastActivityOn, :redis do describe MigrateUserActivitiesToUsersLastActivityOn, :redis, :truncate do
let(:migration) { described_class.new } let(:migration) { described_class.new }
let!(:user_active_1) { create(:user) } let!(:user_active_1) { create(:user) }
let!(:user_active_2) { create(:user) } let!(:user_active_2) { create(:user) }
......
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