Commit a407c184 authored by Takuya Noguchi's avatar Takuya Noguchi

Rename "cycle analytics" with "value stream analytics" under /spec

This does not change the business logics of any specs.
Signed-off-by: default avatarTakuya Noguchi <takninnovationresearch@gmail.com>
parent 8fa7c7d0
---
title: Rename "cycle analytics" with "value stream analytics" under /spec
merge_request: 46613
author: Takuya Noguchi
type: other
......@@ -3,5 +3,5 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueClosed do
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
end
......@@ -3,5 +3,5 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueFirstAddedToBoard do
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
end
......@@ -3,5 +3,5 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueFirstAssociatedWithMilestone do
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
end
......@@ -3,5 +3,5 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueFirstMentionedInCommit do
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
end
......@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueLabelAdded do
it_behaves_like 'cycle analytics event' do
it_behaves_like 'value stream analytics event' do
let(:params) { { label: GroupLabel.new } }
end
end
......@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueLabelRemoved do
it_behaves_like 'cycle analytics event' do
it_behaves_like 'value stream analytics event' do
let(:params) { { label: GroupLabel.new } }
end
end
......@@ -3,5 +3,5 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueLastEdited do
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
end
......@@ -3,5 +3,5 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestClosed do
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
end
......@@ -3,5 +3,5 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestFirstCommitAt do
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
end
......@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestLabelAdded do
it_behaves_like 'cycle analytics event' do
it_behaves_like 'value stream analytics event' do
let(:params) { { label: GroupLabel.new } }
end
end
......@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestLabelRemoved do
it_behaves_like 'cycle analytics event' do
it_behaves_like 'value stream analytics event' do
let(:params) { { label: GroupLabel.new } }
end
end
......@@ -3,5 +3,5 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestLastEdited do
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
end
......@@ -14,12 +14,12 @@ RSpec.describe Analytics::CycleAnalytics::GroupStage do
it { is_expected.to belong_to(:value_stream) }
end
it_behaves_like 'cycle analytics stage' do
it_behaves_like 'value stream analytics stage' do
let(:parent) { create(:group) }
let(:parent_name) { :group }
end
include_examples 'cycle analytics label based stage' do
include_examples 'value stream analytics label based stage' do
let_it_be(:parent) { create(:group) }
let_it_be(:parent_in_subgroup) { create(:group, parent: parent) }
let_it_be(:group_label) { create(:group_label, group: parent) }
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe Analytics::CycleAnalytics::ProjectStage do
include_examples 'cycle analytics label based stage' do
include_examples 'value stream analytics label based stage' do
let_it_be(:group) { create(:group) }
let_it_be(:parent) { create(:project, group: group) }
let_it_be(:parent_in_subgroup) { create(:project, group: create(:group, parent: group)) }
......
......@@ -11,7 +11,7 @@ RSpec.describe Projects::CycleAnalytics::EventsController do
project.add_maintainer(user)
end
describe 'cycle analytics not set up flag' do
describe 'value stream analytics not set up flag' do
context 'with no data' do
it 'is empty' do
get_issue
......
......@@ -32,7 +32,7 @@ RSpec.describe Projects::CycleAnalyticsController do
end
end
describe 'cycle analytics not set up flag' do
describe 'value stream analytics not set up flag' do
context 'with no data' do
it 'is true' do
get(:show,
......
......@@ -6,7 +6,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::CodeStageStart do
let(:subject) { described_class.new({}) }
let(:project) { create(:project) }
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
it 'needs connection with an issue via merge_requests_closing_issues table' do
issue = create(:issue, project: project)
......
......@@ -3,5 +3,5 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueCreated do
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
end
......@@ -3,5 +3,5 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueFirstMentionedInCommit do
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
end
......@@ -3,5 +3,5 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::IssueStageEnd do
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
end
......@@ -3,5 +3,5 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestCreated do
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
end
......@@ -3,5 +3,5 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestFirstDeployedToProduction do
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
end
......@@ -3,5 +3,5 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestLastBuildFinished do
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
end
......@@ -3,5 +3,5 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestLastBuildStarted do
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
end
......@@ -3,5 +3,5 @@
require 'spec_helper'
RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::MergeRequestMerged do
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
end
......@@ -6,7 +6,7 @@ RSpec.describe Gitlab::Analytics::CycleAnalytics::StageEvents::PlanStageStart do
let(:subject) { described_class.new({}) }
let(:project) { create(:project) }
it_behaves_like 'cycle analytics event'
it_behaves_like 'value stream analytics event'
it 'filters issues where first_associated_with_milestone_at or first_added_to_board_at is filled' do
issue1 = create(:issue, project: project)
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe 'cycle analytics events', :aggregate_failures do
RSpec.describe 'value stream analytics events', :aggregate_failures do
let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { create(:user, :admin) }
let(:from_date) { 10.days.ago }
......
......@@ -16,7 +16,7 @@ RSpec.describe Analytics::CycleAnalytics::ProjectStage do
end
end
it_behaves_like 'cycle analytics stage' do
it_behaves_like 'value stream analytics stage' do
let(:parent) { build(:project) }
let(:parent_name) { :project }
end
......
......@@ -6,7 +6,7 @@
# multiple nested contexts. This shouldn't count as a violation.
module CycleAnalyticsHelpers
module TestGeneration
# Generate the most common set of specs that all cycle analytics phases need to have.
# Generate the most common set of specs that all value stream analytics phases need to have.
#
# Arguments:
#
......@@ -14,10 +14,10 @@ module CycleAnalyticsHelpers
# data_fn: A function that returns a hash, constituting initial data for the test case
# start_time_conditions: An array of `conditions`. Each condition is an tuple of `condition_name` and `condition_fn`. `condition_fn` is called with
# `context` (no lexical scope, so need to do `context.create` for factories, for example) and `data` (from the `data_fn`).
# Each `condition_fn` is expected to implement a case which consitutes the start of the given cycle analytics phase.
# Each `condition_fn` is expected to implement a case which consitutes the start of the given value stream analytics phase.
# end_time_conditions: An array of `conditions`. Each condition is an tuple of `condition_name` and `condition_fn`. `condition_fn` is called with
# `context` (no lexical scope, so need to do `context.create` for factories, for example) and `data` (from the `data_fn`).
# Each `condition_fn` is expected to implement a case which consitutes the end of the given cycle analytics phase.
# Each `condition_fn` is expected to implement a case which consitutes the end of the given value stream analytics phase.
# before_end_fn: This function is run before calling the end time conditions. Used for setup that needs to be run between the start and end conditions.
# post_fn: Code that needs to be run after running the end time conditions.
......
# frozen_string_literal: true
RSpec.shared_examples_for 'cycle analytics event' do
RSpec.shared_examples_for 'value stream analytics event' do
let(:params) { {} }
let(:instance) { described_class.new(params) }
......
# frozen_string_literal: true
RSpec.shared_examples 'cycle analytics stage' do
RSpec.shared_examples 'value stream analytics stage' do
let(:valid_params) do
{
name: 'My Stage',
......@@ -111,7 +111,7 @@ RSpec.shared_examples 'cycle analytics stage' do
end
end
RSpec.shared_examples 'cycle analytics label based stage' do
RSpec.shared_examples 'value stream analytics label based stage' do
context 'when creating label based event' do
context 'when the label id is not passed' do
it 'returns validation error when `start_event_label_id` is missing' do
......
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