Skip to content
Snippets Groups Projects
Unverified Commit a2109e72 authored by agius's avatar agius Committed by Stan Hu
Browse files

Fix Geo migration spec

The test was failing in CI because the Geo CI job artifact registry
had cached the newer state of the columns that no longer had the
`success` column. `migrate!` doesn't reset the column information.
This change resets the state so that the migration spec passes.
parent ff1e5889
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