summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/cycle_analytics
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 22:11:55 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 22:11:55 +0000
commit5a8431feceba47fd8e1804d9aa1b1730606b71d5 (patch)
treee5df8e0ceee60f4af8093f5c4c2f934b8abced05 /spec/lib/gitlab/cycle_analytics
parent4d477238500c347c6553d335d920bedfc5a46869 (diff)
downloadgitlab-ce-5a8431feceba47fd8e1804d9aa1b1730606b71d5.tar.gz
Add latest changes from gitlab-org/gitlab@12-5-stable-ee
Diffstat (limited to 'spec/lib/gitlab/cycle_analytics')
-rw-r--r--spec/lib/gitlab/cycle_analytics/events_spec.rb6
-rw-r--r--spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb16
-rw-r--r--spec/lib/gitlab/cycle_analytics/usage_data_spec.rb2
3 files changed, 20 insertions, 4 deletions
diff --git a/spec/lib/gitlab/cycle_analytics/events_spec.rb b/spec/lib/gitlab/cycle_analytics/events_spec.rb
index a163de07967..9eee7e89062 100644
--- a/spec/lib/gitlab/cycle_analytics/events_spec.rb
+++ b/spec/lib/gitlab/cycle_analytics/events_spec.rb
@@ -129,7 +129,7 @@ describe 'cycle analytics events' do
end
end
- describe '#test_events' do
+ describe '#test_events', :sidekiq_might_not_need_inline do
let(:stage) { :test }
let(:merge_request) { MergeRequest.first }
@@ -234,7 +234,7 @@ describe 'cycle analytics events' do
end
end
- describe '#staging_events' do
+ describe '#staging_events', :sidekiq_might_not_need_inline do
let(:stage) { :staging }
let(:merge_request) { MergeRequest.first }
@@ -306,7 +306,7 @@ describe 'cycle analytics events' do
end
end
- describe '#production_events' do
+ describe '#production_events', :sidekiq_might_not_need_inline do
let(:stage) { :production }
let!(:context) { create(:issue, project: project, created_at: 2.days.ago) }
diff --git a/spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb b/spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb
index d5c2f7cc579..664009f140f 100644
--- a/spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb
+++ b/spec/lib/gitlab/cycle_analytics/group_stage_summary_spec.rb
@@ -44,6 +44,14 @@ describe Gitlab::CycleAnalytics::GroupStageSummary do
expect(subject.first[:value]).to eq(2)
end
end
+
+ context 'when `from` and `to` parameters are provided' do
+ subject { described_class.new(group, options: { from: 10.days.ago, to: Time.now, current_user: user }).data }
+
+ it 'finds issues from 5 days ago' do
+ expect(subject.first[:value]).to eq(2)
+ end
+ end
end
context 'with other projects' do
@@ -97,6 +105,14 @@ describe Gitlab::CycleAnalytics::GroupStageSummary do
expect(subject.second[:value]).to eq(2)
end
end
+
+ context 'when `from` and `to` parameters are provided' do
+ subject { described_class.new(group, options: { from: 10.days.ago, to: Time.now, current_user: user }).data }
+
+ it 'finds deployments from 5 days ago' do
+ expect(subject.second[:value]).to eq(2)
+ end
+ end
end
context 'with other projects' do
diff --git a/spec/lib/gitlab/cycle_analytics/usage_data_spec.rb b/spec/lib/gitlab/cycle_analytics/usage_data_spec.rb
index e568ea633db..d4ab9bc225b 100644
--- a/spec/lib/gitlab/cycle_analytics/usage_data_spec.rb
+++ b/spec/lib/gitlab/cycle_analytics/usage_data_spec.rb
@@ -71,7 +71,7 @@ describe Gitlab::CycleAnalytics::UsageData do
}
end
- it 'returns the aggregated usage data of every selected project' do
+ it 'returns the aggregated usage data of every selected project', :sidekiq_might_not_need_inline do
result = subject.to_json
expect(result).to have_key(:avg_cycle_analytics)