Commit b982a4bc authored by Kerri Miller's avatar Kerri Miller

Merge branch 'jswain_bump_glex' into 'master'

Bump gitlab-experiment to 0.5.2 [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!58428
parents f0a518b0 41458bbd
......@@ -488,7 +488,7 @@ gem 'flipper', '~> 0.17.1'
gem 'flipper-active_record', '~> 0.17.1'
gem 'flipper-active_support_cache_store', '~> 0.17.1'
gem 'unleash', '~> 0.1.5'
gem 'gitlab-experiment', '~> 0.5.1'
gem 'gitlab-experiment', '~> 0.5.2'
# Structured logging
gem 'lograge', '~> 0.5'
......
......@@ -443,7 +443,7 @@ GEM
numerizer (~> 0.2)
gitlab-dangerfiles (1.1.0)
danger-gitlab
gitlab-experiment (0.5.1)
gitlab-experiment (0.5.2)
activesupport (>= 3.0)
scientist (~> 1.6, >= 1.6.0)
gitlab-fog-azure-rm (1.0.1)
......@@ -1424,7 +1424,7 @@ DEPENDENCIES
github-markup (~> 1.7.0)
gitlab-chronic (~> 0.10.5)
gitlab-dangerfiles (~> 1.1.0)
gitlab-experiment (~> 0.5.1)
gitlab-experiment (~> 0.5.2)
gitlab-fog-azure-rm (~> 1.0.1)
gitlab-fog-google (~> 1.13)
gitlab-labkit (~> 0.16.2)
......
......@@ -256,7 +256,7 @@ RSpec.describe Registrations::GroupsController do
it 'tracks experiment as expected', :experiment do
expect(experiment(:registrations_group_invite))
.to track(:created, { property: group.id.to_s })
.on_any_instance
.on_next_instance
.with_context(actor: user)
subject
......@@ -322,7 +322,7 @@ RSpec.describe Registrations::GroupsController do
expect(experiment(:registrations_group_invite))
.to track(:created, { property: group.id.to_s })
.on_any_instance
.on_next_instance
.with_context(actor: user)
subject
......@@ -358,7 +358,7 @@ RSpec.describe Registrations::GroupsController do
end
expect(experiment(:registrations_group_invite))
.to track(:created, { property: group.id.to_s })
.on_any_instance
.on_next_instance
.with_context(actor: user)
subject
......
......@@ -82,7 +82,7 @@ RSpec.describe Registrations::ProjectsController do
it 'tracks the registrations_group_invite experiment as expected', :experiment do
expect(experiment(:registrations_group_invite))
.to track(:signup_successful, { property: namespace.id.to_s })
.on_any_instance
.on_next_instance
.with_context(actor: user)
subject
......
......@@ -82,7 +82,7 @@ RSpec.describe 'view group invites' do
it 'tracks experiment as expected', :experiment do
expect(experiment(:registrations_group_invite))
.to track(:invites_sent, { property: group.id.to_s, value: valid_emails.size })
.on_any_instance
.on_next_instance
.with_context(actor: user)
post_request
......
......@@ -74,8 +74,9 @@ RSpec.describe Projects::IssuesController do
end
it 'assigns the candidate experience and tracks the event' do
expect(experiment(:null_hypothesis)).to track('index').on_any_instance.for(:candidate)
expect(experiment(:null_hypothesis)).to track('index').for(:candidate)
.with_context(project: project)
.on_next_instance
get :index, params: { namespace_id: project.namespace, project_id: project }
end
......@@ -218,10 +219,10 @@ RSpec.describe Projects::IssuesController do
end
it 'assigns the candidate experience and tracks the event' do
expect(experiment(:invite_member_link)).to track(:view, property: project.root_ancestor.id.to_s)
.on_any_instance
expect(experiment(:invite_members_in_comment)).to track(:view, property: project.root_ancestor.id.to_s)
.for(:invite_member_link)
.with_context(namespace: project.root_ancestor)
.on_next_instance
get :show, params: { namespace_id: project.namespace, project_id: project, id: issue.iid }
end
......@@ -229,7 +230,7 @@ RSpec.describe Projects::IssuesController do
context 'when user can not invite' do
it 'does not track the event' do
expect(experiment(:invite_member_link)).not_to track(:view)
expect(experiment(:invite_members_in_comment)).not_to track(:view)
get :show, params: { namespace_id: project.namespace, project_id: project, id: issue.iid }
end
......
......@@ -48,10 +48,10 @@ RSpec.describe Projects::MergeRequestsController do
end
it 'assigns the candidate experience and tracks the event' do
expect(experiment(:invite_member_link)).to track(:view, property: project.root_ancestor.id.to_s)
.on_any_instance
expect(experiment(:invite_members_in_comment)).to track(:view, property: project.root_ancestor.id.to_s)
.for(:invite_member_link)
.with_context(namespace: project.root_ancestor)
.on_next_instance
go
end
......@@ -59,7 +59,7 @@ RSpec.describe Projects::MergeRequestsController do
context 'when user can not invite' do
it 'does not track the event' do
expect(experiment(:invite_member_link)).not_to track(:view)
expect(experiment(:invite_members_in_comment)).not_to track(:view)
go
end
......
......@@ -221,22 +221,16 @@ RSpec.describe ProjectsController do
allow(controller).to receive(:record_experiment_user)
end
context 'when user can push to default branch' do
context 'when user can push to default branch', :experiment do
let(:user) { empty_project.owner }
it 'creates an "view_project_show" experiment tracking event', :snowplow do
allow_next_instance_of(ApplicationExperiment) do |e|
allow(e).to receive(:should_track?).and_return(true)
end
it 'creates an "view_project_show" experiment tracking event' do
expect(experiment(:empty_repo_upload)).to track(
:view_project_show,
property: 'empty'
).on_next_instance
get :show, params: { namespace_id: empty_project.namespace, id: empty_project }
expect_snowplow_event(
category: 'empty_repo_upload',
action: 'view_project_show',
property: 'empty',
context: [{ schema: 'iglu:com.gitlab/gitlab_experiment/jsonschema/1-0-0', data: anything }]
)
end
end
......@@ -449,7 +443,7 @@ RSpec.describe ProjectsController do
:created,
property: 'blank',
value: 1
).on_any_instance.with_context(actor: user)
).with_context(actor: user).on_next_instance
post :create, params: { project: project_params }
end
......
......@@ -7,10 +7,6 @@ RSpec.describe NewProjectReadmeExperiment, :experiment do
let(:actor) { User.new(id: 42, created_at: Time.current) }
before do
stub_experiments(new_project_readme: :control)
end
describe "exclusions" do
let(:threshold) { described_class::MAX_ACCOUNT_AGE }
......
......@@ -799,14 +799,14 @@ RSpec.describe Notify do
is_expected.to have_link('Join now', href: invite_url(project_member.invite_token, invite_type: Members::InviteEmailExperiment::INVITE_TYPE))
end
it 'contains invite link for the avatar', :experiment do
it 'contains invite link for the avatar' do
stub_experiments('members/invite_email': :avatar)
is_expected.not_to have_content('You are invited!')
is_expected.not_to have_body_text 'What is a GitLab'
end
it 'contains invite link for the avatar', :experiment do
it 'contains invite link for the avatar' do
stub_experiments('members/invite_email': :permission_info)
is_expected.not_to have_content('You are invited!')
......
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