summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-02-07 10:31:56 +0100
committerRémy Coutable <remy@rymai.me>2018-02-12 16:54:21 +0100
commitd1eac99b92635429eb0ea4e11c6f61e0494f9eb7 (patch)
tree3cf074f96d355c504664e9f0f90e0ff88a063657
parent4af914c25c44e88556b93ac5b08d63ee22e27c5c (diff)
downloadgitlab-ce-d1eac99b92635429eb0ea4e11c6f61e0494f9eb7.tar.gz
Use the :migration metadata in migration specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb7
-rw-r--r--spec/support/db_cleaner.rb4
2 files changed, 6 insertions, 5 deletions
diff --git a/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb b/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb
index 5caf7e6cc4c..fb3f29ff4c9 100644
--- a/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb
+++ b/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb
@@ -1,6 +1,11 @@
require 'spec_helper'
-describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :sidekiq, :delete_no_cache do
+# This migration is using UploadService, which sets uploads.secret that is only
+# added to the DB schema in 20180129193323. Since the test isn't isolated, we
+# just use the latest schema when testing this migration.
+# Ideally, the test should not use factories nor UploadService, and rely on the
+# `table` helper instead.
+describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :sidekiq, :migration, schema: 20180129193323 do
include TrackUntrackedUploadsHelpers
subject { described_class.new }
diff --git a/spec/support/db_cleaner.rb b/spec/support/db_cleaner.rb
index 259e45ed8e2..1809ae1d141 100644
--- a/spec/support/db_cleaner.rb
+++ b/spec/support/db_cleaner.rb
@@ -35,10 +35,6 @@ RSpec.configure do |config|
DatabaseCleaner.strategy = :deletion
end
- config.before(:each, :delete_no_cache) do
- DatabaseCleaner.strategy = :deletion, { cache_tables: false }
- end
-
config.before(:each, :migration) do
DatabaseCleaner.strategy = :deletion, { cache_tables: false }
end