diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2019-08-02 20:39:03 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2019-08-02 20:39:03 +0300 |
commit | dd05aed1d36160bd035d56ee84524a7ea518ea4f (patch) | |
tree | 2c13e68549a78b90950e100f1d2f74174d138a52 /spec | |
parent | 1bc2ac330e503005b6eec45c409f774178e3059f (diff) | |
parent | c6acb77d8a19063f26f8dfcda85beead50fe6e96 (diff) |
Merge branch '64092-removes-update-statistics-namespace-feature-flag' into 'master'
Removes update_statistics_namespace feature flag
See merge request gitlab-org/gitlab-ce!31392
Diffstat (limited to 'spec')
4 files changed, 1 insertions, 73 deletions
diff --git a/spec/models/project_statistics_spec.rb b/spec/models/project_statistics_spec.rb index db3e4902c64..a164ed9bbea 100644 --- a/spec/models/project_statistics_spec.rb +++ b/spec/models/project_statistics_spec.rb @@ -140,18 +140,7 @@ describe ProjectStatistics do let(:namespace) { create(:group) } let(:project) { create(:project, namespace: namespace) } - context 'when the feature flag is off' do - it 'does not schedule the aggregation worker' do - stub_feature_flags(update_statistics_namespace: false, namespace: namespace) - - expect(Namespaces::ScheduleAggregationWorker) - .not_to receive(:perform_async) - - statistics.refresh!(only: [:lfs_objects_size]) - end - end - - context 'when the feature flag is on' do + context 'when arguments are passed' do it 'schedules the aggregation worker' do expect(Namespaces::ScheduleAggregationWorker) .to receive(:perform_async) diff --git a/spec/support/shared_examples/models/update_project_statistics_shared_examples.rb b/spec/support/shared_examples/models/update_project_statistics_shared_examples.rb index aad63982e7a..e03435cafe8 100644 --- a/spec/support/shared_examples/models/update_project_statistics_shared_examples.rb +++ b/spec/support/shared_examples/models/update_project_statistics_shared_examples.rb @@ -32,19 +32,6 @@ shared_examples_for 'UpdateProjectStatistics' do subject.save! end - - context 'when feature flag is disabled for the namespace' do - it 'does not schedules a namespace statistics worker' do - namespace = subject.project.root_ancestor - - stub_feature_flags(update_statistics_namespace: false, namespace: namespace) - - expect(Namespaces::ScheduleAggregationWorker) - .not_to receive(:perform_async) - - subject.save! - end - end end context 'when updating' do @@ -87,20 +74,6 @@ shared_examples_for 'UpdateProjectStatistics' do subject.save! end.not_to exceed_query_limit(control_count) end - - context 'when the feature flag is disabled for the namespace' do - it 'does not schedule a namespace statistics worker' do - namespace = subject.project.root_ancestor - - stub_feature_flags(update_statistics_namespace: false, namespace: namespace) - - expect(Namespaces::ScheduleAggregationWorker) - .not_to receive(:perform_async) - - subject.write_attribute(statistic_attribute, read_attribute + delta) - subject.save! - end - end end context 'when destroying' do @@ -144,18 +117,5 @@ shared_examples_for 'UpdateProjectStatistics' do project.destroy! end end - - context 'when feature flag is disabled for the namespace' do - it 'does not schedule a namespace statistics worker' do - namespace = subject.project.root_ancestor - - stub_feature_flags(update_statistics_namespace: false, namespace: namespace) - - expect(Namespaces::ScheduleAggregationWorker) - .not_to receive(:perform_async) - - subject.destroy! - end - end end end diff --git a/spec/workers/namespaces/root_statistics_worker_spec.rb b/spec/workers/namespaces/root_statistics_worker_spec.rb index 8dd74b96d49..6bbdfe03ceb 100644 --- a/spec/workers/namespaces/root_statistics_worker_spec.rb +++ b/spec/workers/namespaces/root_statistics_worker_spec.rb @@ -74,15 +74,4 @@ describe Namespaces::RootStatisticsWorker, '#perform' do worker.perform(group.id) end end - - context 'when update_statistics_namespace is off' do - it 'does not create a new one' do - stub_feature_flags(update_statistics_namespace: false, namespace: group) - - expect_any_instance_of(Namespaces::StatisticsRefresherService) - .not_to receive(:execute) - - worker.perform(group.id) - end - end end diff --git a/spec/workers/namespaces/schedule_aggregation_worker_spec.rb b/spec/workers/namespaces/schedule_aggregation_worker_spec.rb index d4a49a3f53a..be722f451e0 100644 --- a/spec/workers/namespaces/schedule_aggregation_worker_spec.rb +++ b/spec/workers/namespaces/schedule_aggregation_worker_spec.rb @@ -31,16 +31,6 @@ describe Namespaces::ScheduleAggregationWorker, '#perform', :clean_gitlab_redis_ expect(group.aggregation_schedule).to be_present end end - - context 'when update_statistics_namespace is off' do - it 'does not create a new one' do - stub_feature_flags(update_statistics_namespace: false, namespace: group) - - expect do - worker.perform(group.id) - end.not_to change(Namespace::AggregationSchedule, :count) - end - end end context 'when group is not the root ancestor' do |