Commit 0620215f authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'sh-fix-order-dependent-migration-specs' into 'master'

Fix order-dependent migration specs

Closes #215093

See merge request gitlab-org/gitlab!29986
parents 88317a4d 8286a3d8
...@@ -4,11 +4,10 @@ require 'spec_helper' ...@@ -4,11 +4,10 @@ require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20200217210353_cleanup_optimistic_locking_nulls_pt2') require Rails.root.join('db', 'post_migrate', '20200217210353_cleanup_optimistic_locking_nulls_pt2')
describe CleanupOptimisticLockingNullsPt2, :migration do describe CleanupOptimisticLockingNullsPt2, :migration do
TABLES = %w(ci_stages ci_builds ci_pipelines).freeze let(:ci_stages) { table(:ci_stages) }
TABLES.each do |table| let(:ci_builds) { table(:ci_builds) }
let(table.to_sym) { table(table.to_sym) } let(:ci_pipelines) { table(:ci_pipelines) }
end let(:tables) { [ci_stages, ci_builds, ci_pipelines] }
let(:tables) { TABLES.map { |t| method(t.to_sym).call } }
before do before do
# Create necessary rows # Create necessary rows
......
...@@ -4,11 +4,10 @@ require 'spec_helper' ...@@ -4,11 +4,10 @@ require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20200128210353_cleanup_optimistic_locking_nulls') require Rails.root.join('db', 'post_migrate', '20200128210353_cleanup_optimistic_locking_nulls')
describe CleanupOptimisticLockingNulls do describe CleanupOptimisticLockingNulls do
TABLES = %w(epics merge_requests issues).freeze let(:epics) { table(:epics) }
TABLES.each do |table| let(:merge_requests) { table(:merge_requests) }
let(table.to_sym) { table(table.to_sym) } let(:issues) { table(:issues) }
end let(:tables) { [epics, merge_requests, issues] }
let(:tables) { TABLES.map { |t| method(t.to_sym).call } }
let(:namespaces) { table(:namespaces) } let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) } let(:projects) { table(:projects) }
......
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