Commit 7341a416 authored by Dallas Reedy's avatar Dallas Reedy

Only assert backwards-compat experiments

Allow new experiments to not have to touch the spec, and we now have the
added benefit of using the spec's list of expected keys as a to-do list;
once all keys from that list have been removed (because their associated
experiments have been cleaned up), we can remove the need to check for
backwards compatibility altogether.
parent a4b0fa69
......@@ -2,11 +2,11 @@
require 'spec_helper'
# This is temporary while https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45733 gets rolled out.
# TODO: clean this up once the MR has been merged.
# As each associated, backwards-compatible experiment gets cleaned up and removed from the EXPERIMENTS list, its key will also get removed from this list. Once the list here is empty, we can remove the backwards compatibility code altogether.
# Originally created as part of https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45733 for https://gitlab.com/gitlab-org/gitlab/-/issues/270858.
RSpec.describe Gitlab::Experimentation::EXPERIMENTS do
it 'temporarily ensures we know what experiments exist for backwards compatibility' do
known_experiments = [
expected_experiment_keys = [
:signup_flow,
:onboarding_issues,
:ci_notification_dot,
......@@ -23,7 +23,9 @@ RSpec.describe Gitlab::Experimentation::EXPERIMENTS do
:default_to_issues_board
]
expect(described_class.keys).to match(known_experiments)
backwards_compatible_experiment_keys = described_class.filter { |_, v| v[:use_backwards_compatible_subject_index] }.keys
expect(backwards_compatible_experiment_keys).to match(expected_experiment_keys)
end
end
......
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