Commit a00cef02 authored by Jacques Erasmus's avatar Jacques Erasmus

Merge branch...

Merge branch '288018-rename-cycle-analytics-with-value-stream-analytics-in-strings-under-ee-spec' into 'master'

Rename "Cycle Analytics" with "Value Stream Analytics" under /ee/spec

See merge request gitlab-org/gitlab!48550
parents 78cba0fd 4928ee43
---
title: Rename "Cycle Analytics" with "Value Stream Analytics" under /ee/spec
merge_request: 48550
author: Takuya Noguchi
type: other
...@@ -10,7 +10,7 @@ RSpec.describe Groups::Analytics::CycleAnalytics::StagesController do ...@@ -10,7 +10,7 @@ RSpec.describe Groups::Analytics::CycleAnalytics::StagesController do
let(:params) { { group_id: group } } let(:params) { { group_id: group } }
let(:parent) { group } let(:parent) { group }
it_behaves_like 'cycle analytics stages controller' it_behaves_like 'Value Stream Analytics Stages controller'
end end
context 'when params have group_id and value_stream_id' do context 'when params have group_id and value_stream_id' do
...@@ -18,6 +18,6 @@ RSpec.describe Groups::Analytics::CycleAnalytics::StagesController do ...@@ -18,6 +18,6 @@ RSpec.describe Groups::Analytics::CycleAnalytics::StagesController do
let(:params) { { group_id: group, value_stream_id: value_stream.id } } let(:params) { { group_id: group, value_stream_id: value_stream.id } }
let(:parent) { group } let(:parent) { group }
it_behaves_like 'cycle analytics stages controller' it_behaves_like 'Value Stream Analytics Stages controller'
end end
end end
...@@ -22,7 +22,7 @@ RSpec.describe Groups::Analytics::CycleAnalytics::SummaryController do ...@@ -22,7 +22,7 @@ RSpec.describe Groups::Analytics::CycleAnalytics::SummaryController do
expect(response).to match_response_schema('analytics/cycle_analytics/summary', dir: 'ee') expect(response).to match_response_schema('analytics/cycle_analytics/summary', dir: 'ee')
end end
include_examples 'cycle analytics data endpoint examples' include_examples 'Value Stream Analytics data endpoint examples'
include_examples 'group permission check on the controller level' include_examples 'group permission check on the controller level'
end end
......
...@@ -98,7 +98,7 @@ async function shouldMergeUrlParams(wrapper, result) { ...@@ -98,7 +98,7 @@ async function shouldMergeUrlParams(wrapper, result) {
expect(commonUtils.historyPushState).toHaveBeenCalled(); expect(commonUtils.historyPushState).toHaveBeenCalled();
} }
describe('Cycle Analytics component', () => { describe('Value Stream Analytics component', () => {
let wrapper; let wrapper;
let mock; let mock;
let store; let store;
......
...@@ -94,7 +94,7 @@ describe('Value Stream Analytics actions', () => { ...@@ -94,7 +94,7 @@ describe('Value Stream Analytics actions', () => {
describe('setSelectedValueStream', () => { describe('setSelectedValueStream', () => {
const vs = { id: 'vs-1', name: 'Value stream 1' }; const vs = { id: 'vs-1', name: 'Value stream 1' };
it('refetches the cycle analytics data', () => { it('refetches the Value Stream Analytics data', () => {
return testAction( return testAction(
actions.setSelectedValueStream, actions.setSelectedValueStream,
vs, vs,
......
...@@ -18,7 +18,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -18,7 +18,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
# uses two methods for the data preparaton: `create_data_for_start_event` and # uses two methods for the data preparaton: `create_data_for_start_event` and
# `create_data_for_end_event`. For each stage we create 3 records with a fixed # `create_data_for_end_event`. For each stage we create 3 records with a fixed
# durations (10, 5, 15 days) in order to easily generalize the test cases. # durations (10, 5, 15 days) in order to easily generalize the test cases.
shared_examples 'custom cycle analytics stage' do shared_examples 'custom Value Stream Analytics Stage' do
let(:params) { { from: Time.new(2019), to: Time.new(2020), current_user: user } } let(:params) { { from: Time.new(2019), to: Time.new(2020), current_user: user } }
let(:data_collector) { described_class.new(stage: stage, params: params) } let(:data_collector) { described_class.new(stage: stage, params: params) }
...@@ -85,7 +85,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -85,7 +85,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
issue.metrics.update!(first_mentioned_in_commit_at: Time.now) issue.metrics.update!(first_mentioned_in_commit_at: Time.now)
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
context 'between issue creation time and closing time' do context 'between issue creation time and closing time' do
...@@ -100,7 +100,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -100,7 +100,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
resource.close! resource.close!
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
context 'between issue first mentioned in commit and first associated with milestone time' do context 'between issue first mentioned in commit and first associated with milestone time' do
...@@ -117,7 +117,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -117,7 +117,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
resource.metrics.update!(first_associated_with_milestone_at: Time.now) resource.metrics.update!(first_associated_with_milestone_at: Time.now)
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
context 'between issue creation time and first added to board time' do context 'between issue creation time and first added to board time' do
...@@ -132,7 +132,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -132,7 +132,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
resource.metrics.update!(first_added_to_board_at: Time.now) resource.metrics.update!(first_added_to_board_at: Time.now)
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
context 'between issue creation time and last edit time' do context 'between issue creation time and last edit time' do
...@@ -147,7 +147,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -147,7 +147,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
resource.update!(last_edited_at: Time.now) resource.update!(last_edited_at: Time.now)
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
context 'between issue label added time and label removed time' do context 'between issue label added time and label removed time' do
...@@ -179,7 +179,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -179,7 +179,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
).execute(resource) ).execute(resource)
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
context 'between issue label added time and another issue label added time' do context 'between issue label added time and another issue label added time' do
...@@ -211,7 +211,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -211,7 +211,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
).execute(issue) ).execute(issue)
end end
it_behaves_like 'custom cycle analytics stage' do it_behaves_like 'custom Value Stream Analytics Stage' do
context 'when filtering for two labels' do context 'when filtering for two labels' do
let(:params) do let(:params) do
{ {
...@@ -251,7 +251,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -251,7 +251,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
).execute(issue) ).execute(issue)
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
end end
...@@ -268,7 +268,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -268,7 +268,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
mr.metrics.update!(merged_at: Time.now) mr.metrics.update!(merged_at: Time.now)
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
context 'between merge request merrged time and first deployed to production at time' do context 'between merge request merrged time and first deployed to production at time' do
...@@ -285,7 +285,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -285,7 +285,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
mr.metrics.update!(first_deployed_to_production_at: Time.now) mr.metrics.update!(first_deployed_to_production_at: Time.now)
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
context 'between first commit at and merge request merged time' do context 'between first commit at and merge request merged time' do
...@@ -302,7 +302,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -302,7 +302,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
mr.metrics.update!(merged_at: Time.now) mr.metrics.update!(merged_at: Time.now)
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
context 'between merge request build started time and build finished time' do context 'between merge request build started time and build finished time' do
...@@ -319,7 +319,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -319,7 +319,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
mr.metrics.update!(latest_build_finished_at: Time.now) mr.metrics.update!(latest_build_finished_at: Time.now)
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
context 'between merge request creation time and close time' do context 'between merge request creation time and close time' do
...@@ -334,7 +334,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -334,7 +334,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
resource.metrics.update!(latest_closed_at: Time.now) resource.metrics.update!(latest_closed_at: Time.now)
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
context 'between merge request creation time and last edit time' do context 'between merge request creation time and last edit time' do
...@@ -349,7 +349,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -349,7 +349,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
resource.update!(last_edited_at: Time.now) resource.update!(last_edited_at: Time.now)
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
context 'between merge request label added time and label removed time' do context 'between merge request label added time and label removed time' do
...@@ -381,7 +381,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -381,7 +381,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
).execute(mr) ).execute(mr)
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
context 'between code stage start time and merge request created time' do context 'between code stage start time and merge request created time' do
...@@ -413,7 +413,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -413,7 +413,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
mr.update!(created_at: Time.zone.now) mr.update!(created_at: Time.zone.now)
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
context 'when `first_commit_at` is present' do context 'when `first_commit_at` is present' do
...@@ -427,7 +427,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -427,7 +427,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
mr.update!(created_at: Time.zone.now) mr.update!(created_at: Time.zone.now)
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
context 'label filter' do context 'label filter' do
...@@ -459,7 +459,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do ...@@ -459,7 +459,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::DataCollector do
mr.update!(created_at: Time.zone.now) mr.update!(created_at: Time.zone.now)
end end
it_behaves_like 'custom cycle analytics stage' it_behaves_like 'custom Value Stream Analytics Stage'
end end
end end
end end
......
...@@ -26,7 +26,7 @@ RSpec.describe Analytics::CycleAnalytics::Stages::CreateService do ...@@ -26,7 +26,7 @@ RSpec.describe Analytics::CycleAnalytics::Stages::CreateService do
subject { described_class.new(parent: group, params: params, current_user: user).execute } subject { described_class.new(parent: group, params: params, current_user: user).execute }
it_behaves_like 'permission check for cycle analytics stage services', :cycle_analytics_for_groups it_behaves_like 'permission check for Value Stream Analytics Stage services', :cycle_analytics_for_groups
describe 'custom stage creation' do describe 'custom stage creation' do
context 'when service response is successful' do context 'when service response is successful' do
......
...@@ -19,7 +19,7 @@ RSpec.describe Analytics::CycleAnalytics::Stages::DeleteService do ...@@ -19,7 +19,7 @@ RSpec.describe Analytics::CycleAnalytics::Stages::DeleteService do
stub_licensed_features(cycle_analytics_for_groups: true) stub_licensed_features(cycle_analytics_for_groups: true)
end end
it_behaves_like 'permission check for cycle analytics stage services', :cycle_analytics_for_groups it_behaves_like 'permission check for Value Stream Analytics Stage services', :cycle_analytics_for_groups
context 'when persisted stage is given' do context 'when persisted stage is given' do
it { expect(subject).to be_success } it { expect(subject).to be_success }
......
...@@ -18,7 +18,7 @@ RSpec.describe Analytics::CycleAnalytics::Stages::ListService do ...@@ -18,7 +18,7 @@ RSpec.describe Analytics::CycleAnalytics::Stages::ListService do
stub_licensed_features(cycle_analytics_for_groups: true) stub_licensed_features(cycle_analytics_for_groups: true)
end end
it_behaves_like 'permission check for cycle analytics stage services', :cycle_analytics_for_groups it_behaves_like 'permission check for Value Stream Analytics Stage services', :cycle_analytics_for_groups
it 'returns only the default stages' do it 'returns only the default stages' do
expect(stages.size).to eq(Gitlab::Analytics::CycleAnalytics::DefaultStages.all.size) expect(stages.size).to eq(Gitlab::Analytics::CycleAnalytics::DefaultStages.all.size)
......
...@@ -20,7 +20,7 @@ RSpec.describe Analytics::CycleAnalytics::Stages::UpdateService do ...@@ -20,7 +20,7 @@ RSpec.describe Analytics::CycleAnalytics::Stages::UpdateService do
stub_licensed_features(cycle_analytics_for_groups: true) stub_licensed_features(cycle_analytics_for_groups: true)
end end
it_behaves_like 'permission check for cycle analytics stage services', :cycle_analytics_for_groups it_behaves_like 'permission check for Value Stream Analytics Stage services', :cycle_analytics_for_groups
context 'when updating a default stage' do context 'when updating a default stage' do
let(:stage) { Analytics::CycleAnalytics::GroupStage.new(default_stages.first.merge(group: group)) } let(:stage) { Analytics::CycleAnalytics::GroupStage.new(default_stages.first.merge(group: group)) }
......
# frozen_string_literal: true # frozen_string_literal: true
RSpec.shared_examples 'cycle analytics stages controller' do RSpec.shared_examples 'Value Stream Analytics Stages controller' do
before do before do
stub_licensed_features(cycle_analytics_for_groups: true) stub_licensed_features(cycle_analytics_for_groups: true)
...@@ -200,13 +200,13 @@ RSpec.shared_examples 'cycle analytics stages controller' do ...@@ -200,13 +200,13 @@ RSpec.shared_examples 'cycle analytics stages controller' do
expect(response).to match_response_schema('analytics/cycle_analytics/median', dir: 'ee') expect(response).to match_response_schema('analytics/cycle_analytics/median', dir: 'ee')
end end
include_examples 'cycle analytics data endpoint examples' include_examples 'Value Stream Analytics data endpoint examples'
end end
describe 'GET #records' do describe 'GET #records' do
subject { get :records, params: params } subject { get :records, params: params }
include_examples 'cycle analytics data endpoint examples' include_examples 'Value Stream Analytics data endpoint examples'
include_examples 'group permission check on the controller level' include_examples 'group permission check on the controller level'
end end
...@@ -222,7 +222,7 @@ RSpec.shared_examples 'cycle analytics stages controller' do ...@@ -222,7 +222,7 @@ RSpec.shared_examples 'cycle analytics stages controller' do
expect(response).to match_response_schema('analytics/cycle_analytics/duration_chart', dir: 'ee') expect(response).to match_response_schema('analytics/cycle_analytics/duration_chart', dir: 'ee')
end end
include_examples 'cycle analytics data endpoint examples' include_examples 'Value Stream Analytics data endpoint examples'
include_examples 'group permission check on the controller level' include_examples 'group permission check on the controller level'
end end
end end
...@@ -280,7 +280,7 @@ RSpec.shared_context 'when invalid stage parameters are given' do ...@@ -280,7 +280,7 @@ RSpec.shared_context 'when invalid stage parameters are given' do
end end
end end
RSpec.shared_examples 'cycle analytics data endpoint examples' do RSpec.shared_examples 'Value Stream Analytics data endpoint examples' do
before do before do
params[:created_after] = '2019-01-01' params[:created_after] = '2019-01-01'
params[:created_before] = '2019-04-01' params[:created_before] = '2019-04-01'
......
# frozen_string_literal: true # frozen_string_literal: true
RSpec.shared_examples 'permission check for cycle analytics stage services' do |required_license| RSpec.shared_examples 'permission check for Value Stream Analytics Stage services' do |required_license|
context 'when user has no access' do context 'when user has no access' do
before do before do
group.add_user(user, :guest) group.add_user(user, :guest)
......
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