Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/gitlab_experiment.rb')
-rw-r--r--spec/support/gitlab_experiment.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/support/gitlab_experiment.rb b/spec/support/gitlab_experiment.rb
index 1f283e4f06c..45ae9958c52 100644
--- a/spec/support/gitlab_experiment.rb
+++ b/spec/support/gitlab_experiment.rb
@@ -1,4 +1,16 @@
# frozen_string_literal: true
+# Require the provided spec helper and matchers.
+require 'gitlab/experiment/rspec'
+
+# 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(...)
+ super(...)
+ Feature.persist_used!(feature_flag_name)
+ end
+end
+
# Disable all caching for experiments in tests.
Gitlab::Experiment::Configuration.cache = nil