Commit 0e8e9ab1 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'remove_without_index_namespace_callback_trait' into 'master'

Remove without_index_namespace_callback trait

See merge request gitlab-org/gitlab!42082
parents 9d8a64bb 214c0846
---
title: Remove without_index_namespace_callback trait
merge_request: 42082
author: Andrei Cirnici @acirnici
type: other
...@@ -43,17 +43,5 @@ FactoryBot.define do ...@@ -43,17 +43,5 @@ FactoryBot.define do
trait :gold do trait :gold do
association :hosted_plan, factory: :gold_plan association :hosted_plan, factory: :gold_plan
end end
# for testing elasticsearch_indexed_namespace and elastic_namespace_rollout_worker which
# eventually will not be required once all paid groups are indexed
trait :without_index_namespace_callback do
after(:build) do |gitlab_subcription|
GitlabSubscription.skip_callback(:commit, :after, :index_namespace)
end
after(:create) do
GitlabSubscription.set_callback(:commit, :after, :index_namespace)
end
end
end end
end end
...@@ -41,9 +41,9 @@ RSpec.describe ElasticsearchIndexedNamespace do ...@@ -41,9 +41,9 @@ RSpec.describe ElasticsearchIndexedNamespace do
end end
let_it_be(:namespaces) { create_list(:namespace, 3) } let_it_be(:namespaces) { create_list(:namespace, 3) }
let_it_be(:subscription1) { create(:gitlab_subscription, :without_index_namespace_callback, namespace: namespaces[2]) } let_it_be(:subscription1) { create(:gitlab_subscription, namespace: namespaces[2]) }
let_it_be(:subscription2) { create(:gitlab_subscription, :without_index_namespace_callback, namespace: namespaces[0]) } let_it_be(:subscription2) { create(:gitlab_subscription, namespace: namespaces[0]) }
let_it_be(:subscription3) { create(:gitlab_subscription, :silver, :without_index_namespace_callback, namespace: namespaces[1]) } let_it_be(:subscription3) { create(:gitlab_subscription, :silver, namespace: namespaces[1]) }
before do before do
stub_ee_application_setting(elasticsearch_indexing: false) stub_ee_application_setting(elasticsearch_indexing: false)
......
...@@ -15,7 +15,7 @@ RSpec.describe ElasticNamespaceRolloutWorker do ...@@ -15,7 +15,7 @@ RSpec.describe ElasticNamespaceRolloutWorker do
before_all do before_all do
Plan::PAID_HOSTED_PLANS.each do |plan| Plan::PAID_HOSTED_PLANS.each do |plan|
create_list(:gitlab_subscription, 4, :without_index_namespace_callback, hosted_plan: public_send("#{plan}_plan")) create_list(:gitlab_subscription, 4, hosted_plan: public_send("#{plan}_plan"))
end end
end end
......
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