diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 18:11:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 18:11:58 +0300 |
commit | c17eb7c97062d25cdf1b44573e4c0241f52aa2fe (patch) | |
tree | 5164ebf4ccf1701cce78d7b4121c414ab370db6e /spec/lib | |
parent | 60e09a0cef4e104aa41e20ab7a40499f3343e90f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib')
26 files changed, 29 insertions, 39 deletions
diff --git a/spec/lib/gitlab/ci/config/entry/include/rules/rule_spec.rb b/spec/lib/gitlab/ci/config/entry/include/rules/rule_spec.rb index 0505b17ea91..e83d4974bb7 100644 --- a/spec/lib/gitlab/ci/config/entry/include/rules/rule_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/include/rules/rule_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'fast_spec_helper' +require_dependency 'active_model' RSpec.describe Gitlab::Ci::Config::Entry::Include::Rules::Rule do let(:factory) do diff --git a/spec/lib/gitlab/ci/config/entry/include/rules_spec.rb b/spec/lib/gitlab/ci/config/entry/include/rules_spec.rb index c255d6e9dd6..d5988dbbb58 100644 --- a/spec/lib/gitlab/ci/config/entry/include/rules_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/include/rules_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'fast_spec_helper' +require_dependency 'active_model' RSpec.describe Gitlab::Ci::Config::Entry::Include::Rules do let(:factory) do diff --git a/spec/lib/gitlab/ci/config/entry/include_spec.rb b/spec/lib/gitlab/ci/config/entry/include_spec.rb index 275cdcddeb0..fd7f85c9298 100644 --- a/spec/lib/gitlab/ci/config/entry/include_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/include_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'fast_spec_helper' +require_dependency 'active_model' RSpec.describe ::Gitlab::Ci::Config::Entry::Include do subject(:include_entry) { described_class.new(config) } diff --git a/spec/lib/gitlab/ci/config/entry/policy_spec.rb b/spec/lib/gitlab/ci/config/entry/policy_spec.rb index 46800055dd9..29fd031efd8 100644 --- a/spec/lib/gitlab/ci/config/entry/policy_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/policy_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true -require 'fast_spec_helper' -require 'support/helpers/stub_feature_flags' -require_dependency 'active_model' +require 'spec_helper' RSpec.describe Gitlab::Ci::Config::Entry::Policy do let(:entry) { described_class.new(config) } @@ -47,6 +45,7 @@ RSpec.describe Gitlab::Ci::Config::Entry::Policy do end context 'when using unsafe regexp' do + # When removed we could use `require 'fast_spec_helper'` again. include StubFeatureFlags let(:config) { ['/^(?!master).+/'] } @@ -107,6 +106,7 @@ RSpec.describe Gitlab::Ci::Config::Entry::Policy do end context 'when using unsafe regexp' do + # When removed we could use `require 'fast_spec_helper'` again. include StubFeatureFlags let(:config) { { refs: ['/^(?!master).+/'] } } diff --git a/spec/lib/gitlab/ci/config/normalizer/matrix_strategy_spec.rb b/spec/lib/gitlab/ci/config/normalizer/matrix_strategy_spec.rb index a29471706cc..1cc8b462224 100644 --- a/spec/lib/gitlab/ci/config/normalizer/matrix_strategy_spec.rb +++ b/spec/lib/gitlab/ci/config/normalizer/matrix_strategy_spec.rb @@ -1,12 +1,8 @@ # frozen_string_literal: true require 'fast_spec_helper' -require 'support/helpers/stubbed_feature' -require 'support/helpers/stub_feature_flags' RSpec.describe Gitlab::Ci::Config::Normalizer::MatrixStrategy do - include StubFeatureFlags - describe '.applies_to?' do subject { described_class.applies_to?(config) } diff --git a/spec/lib/gitlab/cluster/lifecycle_events_spec.rb b/spec/lib/gitlab/cluster/lifecycle_events_spec.rb index 4ed68d54680..5eea78acd98 100644 --- a/spec/lib/gitlab/cluster/lifecycle_events_spec.rb +++ b/spec/lib/gitlab/cluster/lifecycle_events_spec.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true -require 'fast_spec_helper' -require 'rspec-parameterized' +require 'spec_helper' RSpec.describe Gitlab::Cluster::LifecycleEvents do # we create a new instance to ensure that we do not touch existing hooks diff --git a/spec/lib/gitlab/database/background_migration/batch_metrics_spec.rb b/spec/lib/gitlab/database/background_migration/batch_metrics_spec.rb index e96862fbc2d..66983733411 100644 --- a/spec/lib/gitlab/database/background_migration/batch_metrics_spec.rb +++ b/spec/lib/gitlab/database/background_migration/batch_metrics_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'fast_spec_helper' +require 'spec_helper' RSpec.describe Gitlab::Database::BackgroundMigration::BatchMetrics do let(:batch_metrics) { described_class.new } diff --git a/spec/lib/gitlab/database/no_cross_db_foreign_keys_spec.rb b/spec/lib/gitlab/database/no_cross_db_foreign_keys_spec.rb index 05103bc776f..0d6758f8cdd 100644 --- a/spec/lib/gitlab/database/no_cross_db_foreign_keys_spec.rb +++ b/spec/lib/gitlab/database/no_cross_db_foreign_keys_spec.rb @@ -44,8 +44,6 @@ RSpec.describe 'cross-database foreign keys' do dast_profiles_pipelines.ci_pipeline_id dast_site_profiles_pipelines.ci_pipeline_id external_pull_requests.project_id - merge_requests.head_pipeline_id - merge_trains.pipeline_id vulnerability_feedback.pipeline_id vulnerability_occurrence_pipelines.pipeline_id vulnerability_statistics.latest_pipeline_id diff --git a/spec/lib/gitlab/error_tracking/context_payload_generator_spec.rb b/spec/lib/gitlab/error_tracking/context_payload_generator_spec.rb index 0e72dd7ec5e..38745fe0cde 100644 --- a/spec/lib/gitlab/error_tracking/context_payload_generator_spec.rb +++ b/spec/lib/gitlab/error_tracking/context_payload_generator_spec.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true -require 'fast_spec_helper' -require 'rspec-parameterized' +require 'spec_helper' RSpec.describe Gitlab::ErrorTracking::ContextPayloadGenerator do subject(:generator) { described_class.new } diff --git a/spec/lib/gitlab/error_tracking/log_formatter_spec.rb b/spec/lib/gitlab/error_tracking/log_formatter_spec.rb index 188ccd000a1..15d201401f4 100644 --- a/spec/lib/gitlab/error_tracking/log_formatter_spec.rb +++ b/spec/lib/gitlab/error_tracking/log_formatter_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'fast_spec_helper' +require 'spec_helper' RSpec.describe Gitlab::ErrorTracking::LogFormatter do let(:exception) { StandardError.new('boom') } diff --git a/spec/lib/gitlab/feature_categories_spec.rb b/spec/lib/gitlab/feature_categories_spec.rb index daced154a69..477da900d0a 100644 --- a/spec/lib/gitlab/feature_categories_spec.rb +++ b/spec/lib/gitlab/feature_categories_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'fast_spec_helper' +require 'spec_helper' RSpec.describe Gitlab::FeatureCategories do let(:fake_categories) { %w(foo bar) } diff --git a/spec/lib/gitlab/graphql/authorize/object_authorization_spec.rb b/spec/lib/gitlab/graphql/authorize/object_authorization_spec.rb index 73e25f23848..274cc83a6be 100644 --- a/spec/lib/gitlab/graphql/authorize/object_authorization_spec.rb +++ b/spec/lib/gitlab/graphql/authorize/object_authorization_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'fast_spec_helper' +require 'spec_helper' RSpec.describe ::Gitlab::Graphql::Authorize::ObjectAuthorization do describe '#ok?' do diff --git a/spec/lib/gitlab/graphql/batch_key_spec.rb b/spec/lib/gitlab/graphql/batch_key_spec.rb index 7b73b27f24b..43e248885c2 100644 --- a/spec/lib/gitlab/graphql/batch_key_spec.rb +++ b/spec/lib/gitlab/graphql/batch_key_spec.rb @@ -1,12 +1,10 @@ # frozen_string_literal: true require 'fast_spec_helper' -require 'test_prof/recipes/rspec/let_it_be' RSpec.describe ::Gitlab::Graphql::BatchKey do - let_it_be(:rect) { Struct.new(:len, :width) } - let_it_be(:circle) { Struct.new(:radius) } - + let(:rect) { Struct.new(:len, :width) } + let(:circle) { Struct.new(:radius) } let(:lookahead) { nil } let(:object) { rect.new(2, 3) } diff --git a/spec/lib/gitlab/graphql/queries_spec.rb b/spec/lib/gitlab/graphql/queries_spec.rb index 8b7f4ca7933..ad1aaac712e 100644 --- a/spec/lib/gitlab/graphql/queries_spec.rb +++ b/spec/lib/gitlab/graphql/queries_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true require 'spec_helper' -require 'fast_spec_helper' -require "test_prof/recipes/rspec/let_it_be" RSpec.describe Gitlab::Graphql::Queries do shared_examples 'a valid GraphQL query for the blog schema' do diff --git a/spec/lib/gitlab/graphql/tracers/application_context_tracer_spec.rb b/spec/lib/gitlab/graphql/tracers/application_context_tracer_spec.rb index 6eff816b95a..264fe993197 100644 --- a/spec/lib/gitlab/graphql/tracers/application_context_tracer_spec.rb +++ b/spec/lib/gitlab/graphql/tracers/application_context_tracer_spec.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true -require "fast_spec_helper" -require "support/graphql/fake_tracer" -require "support/graphql/fake_query_type" + +require 'spec_helper' RSpec.describe Gitlab::Graphql::Tracers::ApplicationContextTracer do let(:tracer_spy) { spy('tracer_spy') } diff --git a/spec/lib/gitlab/import_export/config_spec.rb b/spec/lib/gitlab/import_export/config_spec.rb index 7ad5d3d846c..fcb48678b88 100644 --- a/spec/lib/gitlab/import_export/config_spec.rb +++ b/spec/lib/gitlab/import_export/config_spec.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true -require 'fast_spec_helper' -require 'rspec-parameterized' +require 'spec_helper' RSpec.describe Gitlab::ImportExport::Config do let(:yaml_file) { described_class.new } diff --git a/spec/lib/gitlab/incident_management/pager_duty/incident_issue_description_spec.rb b/spec/lib/gitlab/incident_management/pager_duty/incident_issue_description_spec.rb index 535cce6aa04..c5288b9afbc 100644 --- a/spec/lib/gitlab/incident_management/pager_duty/incident_issue_description_spec.rb +++ b/spec/lib/gitlab/incident_management/pager_duty/incident_issue_description_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'fast_spec_helper' +require 'spec_helper' RSpec.describe Gitlab::IncidentManagement::PagerDuty::IncidentIssueDescription do describe '#to_s' do diff --git a/spec/lib/gitlab/kubernetes/kubectl_cmd_spec.rb b/spec/lib/gitlab/kubernetes/kubectl_cmd_spec.rb index 2e373613269..3028e0a13aa 100644 --- a/spec/lib/gitlab/kubernetes/kubectl_cmd_spec.rb +++ b/spec/lib/gitlab/kubernetes/kubectl_cmd_spec.rb @@ -2,6 +2,8 @@ require 'fast_spec_helper' +require_relative '../../../../lib/gitlab/kubernetes/pod_cmd' + RSpec.describe Gitlab::Kubernetes::KubectlCmd do describe '.delete' do it 'constructs string properly' do diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb index 8d67350f0f3..54a0b282e99 100644 --- a/spec/lib/gitlab/regex_spec.rb +++ b/spec/lib/gitlab/regex_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'fast_spec_helper' +require 'spec_helper' RSpec.describe Gitlab::Regex do shared_examples_for 'project/group name chars regex' do diff --git a/spec/lib/gitlab/request_profiler/profile_spec.rb b/spec/lib/gitlab/request_profiler/profile_spec.rb index 2e9c75dde87..30e23a99b22 100644 --- a/spec/lib/gitlab/request_profiler/profile_spec.rb +++ b/spec/lib/gitlab/request_profiler/profile_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'fast_spec_helper' +require 'spec_helper' RSpec.describe Gitlab::RequestProfiler::Profile do let(:profile) { described_class.new(filename) } diff --git a/spec/lib/gitlab/untrusted_regexp/ruby_syntax_spec.rb b/spec/lib/gitlab/untrusted_regexp/ruby_syntax_spec.rb index 42fc84cf076..b021abc9f25 100644 --- a/spec/lib/gitlab/untrusted_regexp/ruby_syntax_spec.rb +++ b/spec/lib/gitlab/untrusted_regexp/ruby_syntax_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true -require 'fast_spec_helper' -require 'support/shared_examples/lib/gitlab/malicious_regexp_shared_examples' -require 'support/helpers/stub_feature_flags' +require 'spec_helper' RSpec.describe Gitlab::UntrustedRegexp::RubySyntax do describe '.matches_syntax?' do @@ -77,6 +75,7 @@ RSpec.describe Gitlab::UntrustedRegexp::RubySyntax do include StubFeatureFlags before do + # When removed we could use `require 'fast_spec_helper'` again. stub_feature_flags(allow_unsafe_ruby_regexp: true) allow(Gitlab::UntrustedRegexp).to receive(:new).and_raise(RegexpError) diff --git a/spec/lib/gitlab/webpack/file_loader_spec.rb b/spec/lib/gitlab/webpack/file_loader_spec.rb index 34d00b9f106..6475ef58611 100644 --- a/spec/lib/gitlab/webpack/file_loader_spec.rb +++ b/spec/lib/gitlab/webpack/file_loader_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true -require 'fast_spec_helper' -require 'support/helpers/file_read_helpers' -require 'support/webmock' +require 'spec_helper' RSpec.describe Gitlab::Webpack::FileLoader do include FileReadHelpers diff --git a/spec/lib/peek/views/detailed_view_spec.rb b/spec/lib/peek/views/detailed_view_spec.rb index 8d6d9a829ef..149685b243a 100644 --- a/spec/lib/peek/views/detailed_view_spec.rb +++ b/spec/lib/peek/views/detailed_view_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'fast_spec_helper' +require 'spec_helper' RSpec.describe Peek::Views::DetailedView, :request_store do context 'when a class defines thresholds' do diff --git a/spec/lib/serializers/json_spec.rb b/spec/lib/serializers/json_spec.rb index 0c1801b34f9..96a57cde056 100644 --- a/spec/lib/serializers/json_spec.rb +++ b/spec/lib/serializers/json_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'fast_spec_helper' +require 'oj' RSpec.describe Serializers::Json do describe '.dump' do diff --git a/spec/lib/serializers/symbolized_json_spec.rb b/spec/lib/serializers/symbolized_json_spec.rb index b30fb074ddd..b9217854d9a 100644 --- a/spec/lib/serializers/symbolized_json_spec.rb +++ b/spec/lib/serializers/symbolized_json_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'fast_spec_helper' +require 'oj' RSpec.describe Serializers::SymbolizedJson do describe '.dump' do diff --git a/spec/lib/system_check/incoming_email/imap_authentication_check_spec.rb b/spec/lib/system_check/incoming_email/imap_authentication_check_spec.rb index d7a77a84472..9c4aebaedd8 100644 --- a/spec/lib/system_check/incoming_email/imap_authentication_check_spec.rb +++ b/spec/lib/system_check/incoming_email/imap_authentication_check_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'fast_spec_helper' +require 'spec_helper' MAIL_ROOM_CONFIG_ENABLED_SAMPLE = ":mailboxes:\n"\ |