Commit cfa07577 authored by Rémy Coutable's avatar Rémy Coutable

Automatically add the :geo metadata to Geo spec files

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 39d01237
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe Gitlab::BackgroundMigration::PruneOrphanedGeoEvents, :migration, :postgresql, schema: 20180626125654 do
describe Gitlab::BackgroundMigration::PruneOrphanedGeoEvents, :migration, geo: false, schema: 20180626125654 do
let(:event_table_name) { 'geo_repository_updated_events' }
let(:geo_event_log) { table(:geo_event_log) }
let(:geo_updated_events) { table(event_table_name) }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('ee', 'db', 'migrate', '20181017131623_add_missing_geo_even_log_indexes.rb')
describe AddMissingGeoEvenLogIndexes, :migration do
describe AddMissingGeoEvenLogIndexes, :migration, geo: false do
let(:namespace) { table(:namespaces).create(path: 'ns', name: 'Namespace') }
let(:project) { table(:projects).create(namespace_id: namespace.id, path: 'pj') }
let(:geo_event_log) { table(:geo_event_log) }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('ee', 'db', 'post_migrate', '20180417102933_drop_repository_storage_events_for_geo_events.rb')
describe DropRepositoryStorageEventsForGeoEvents, :migration, schema: 20180416112831 do
describe DropRepositoryStorageEventsForGeoEvents, :migration, geo: false, schema: 20180416112831 do
describe '#up' do
before do
schema_migrate_up!
......
require 'spec_helper'
require Rails.root.join('ee', 'db', 'post_migrate', '20170811082658_remove_system_hook_from_geo_nodes.rb')
describe RemoveSystemHookFromGeoNodes, :migration do
describe RemoveSystemHookFromGeoNodes, :migration, geo: false do
let(:geo_nodes) { table(:geo_nodes) }
let(:web_hooks) { table(:web_hooks) }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
require Rails.root.join('ee', 'db', 'post_migrate', '20180618193715_schedule_prune_orphaned_geo_events.rb')
describe SchedulePruneOrphanedGeoEvents, :migration, schema: 20180615152524 do
describe SchedulePruneOrphanedGeoEvents, :migration, geo: false, schema: 20180615152524 do
describe '#up' do
it 'delegates work to Gitlab::BackgroundMigration::PruneOrphanedGeoEvents', :postgresql do
expect(BackgroundMigrationWorker).to receive(:perform_async).with('PruneOrphanedGeoEvents')
......
......@@ -6,6 +6,12 @@ Dir[Rails.root.join("ee/spec/support/**/*.rb")].each { |f| require f }
RSpec.configure do |config|
config.include EE::LicenseHelpers
config.define_derived_metadata(file_path: %r{ee/spec/}) do |metadata|
location = metadata[:location]
metadata[:geo] = metadata.fetch(:geo, true) if location =~ %r{[/_]geo[/_]}
end
config.before(:all) do
License.destroy_all # rubocop: disable DestroyAll
TestLicense.init
......
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