Skip to content
Snippets Groups Projects
Unverified Commit 7739ec3a authored by Stan Hu's avatar Stan Hu Committed by GitLab
Browse files

Merge branch 'sh-fix-geo-spec-16-1' into '16-1-stable-ee'

Fix Geo migration spec

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



Merged-by: default avatarStan Hu <stanhu@gmail.com>
Approved-by: default avatarRémy Coutable <remy@rymai.me>
Co-authored-by: default avataragius <andrew@atevans.com>
parents e0afdb14 056759a5
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -14,11 +14,17 @@
file_registry.create!(file_id: 4, file_type: 'job_artifact', success: false, bytes: 4096, sha256: '2' * 64)
end
 
def migrate_and_reset_registry_columns!
migrate!
[file_registry, job_artifact_registry].each(&:reset_column_information)
end
describe '#up' do
it 'migrates all job artifacts to its own data table' do
expect(file_registry.all.count).to eq(4)
 
migrate!
migrate_and_reset_registry_columns!
 
expect(file_registry.all.count).to eq(4)
expect(job_artifact_registry.all.count).to eq(3)
Loading
Loading
@@ -30,7 +36,7 @@
end
 
it 'creates a new artifact with the trigger' do
migrate!
migrate_and_reset_registry_columns!
 
expect(job_artifact_registry.all.count).to eq(3)
 
Loading
Loading
@@ -41,7 +47,7 @@
end
 
it 'updates a new artifact with the trigger' do
migrate!
migrate_and_reset_registry_columns!
 
expect(job_artifact_registry.all.count).to eq(3)
 
Loading
Loading
@@ -54,7 +60,7 @@
end
 
it 'creates a new artifact using the next ID' do
migrate!
migrate_and_reset_registry_columns!
 
max_id = job_artifact_registry.maximum(:id)
last_id = job_artifact_registry.create!(artifact_id: 5, success: true).id
Loading
Loading
@@ -65,7 +71,7 @@
 
describe '#down' do
it 'rolls back data properly' do
migrate!
migrate_and_reset_registry_columns!
 
expect(file_registry.all.count).to eq(4)
expect(job_artifact_registry.all.count).to eq(3)
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