Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
58a071a2
Commit
58a071a2
authored
Jan 26, 2021
by
jejacks0n
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
This is a quick fix for Feature use
parent
79202384
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
spec/experiments/application_experiment_spec.rb
spec/experiments/application_experiment_spec.rb
+6
-0
spec/support/gitlab_experiment.rb
spec/support/gitlab_experiment.rb
+9
-0
No files found.
spec/experiments/application_experiment_spec.rb
View file @
58a071a2
...
...
@@ -5,6 +5,12 @@ require 'spec_helper'
RSpec
.
describe
ApplicationExperiment
do
subject
{
described_class
.
new
(
:stub
)
}
it
"naively assumes a 1x1 relationship to feature flags for tests"
do
expect
(
Feature
).
to
receive
(
:persist_used!
).
with
(
'stub'
)
described_class
.
new
(
:stub
)
end
describe
"publishing results"
do
it
"tracks the assignment"
do
expect
(
subject
).
to
receive
(
:track
).
with
(
:assignment
)
...
...
spec/support/gitlab_experiment.rb
View file @
58a071a2
# frozen_string_literal: true
# This is a temporary fix until we have a larger discussion around the
# challenges raised in https://gitlab.com/gitlab-org/gitlab/-/issues/300104
class
ApplicationExperiment
<
Gitlab
::
Experiment
# rubocop:disable Gitlab/NamespacedClass
def
initialize
(
*
args
)
super
Feature
.
persist_used!
(
name
)
end
end
# Disable all caching for experiments in tests.
Gitlab
::
Experiment
::
Configuration
.
cache
=
nil
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment