Skip to content

[RUN AS-IF-FOSS] Convert most of Rubocop specs to fast_spec_helper

Thong Kuah requested to merge convert_rubocop_spec_to_fast_spec_helper into master

What does this MR do?

Convert most of Rubocop specs to fast_spec_helper

As static analysis code and specs should not have to load Rails

Related issue: #222306 (closed)

Speed

Before:

$ be spring rspec spec/rubocop/cop/active_record_association_reload_spec.rb spec/rubocop/cop/avoid_keyword_arguments_in_sidekiq_workers_spec.rb spec/rubocop/cop/avoid_route_redirect_leading_slash_spec.rb spec/rubocop/cop/ban_catch_throw_spec.rb spec/rubocop/cop/code_reuse/finder_spec.rb spec/rubocop/cop/code_reuse/presenter_spec.rb spec/rubocop/cop/code_reuse/serializer_spec.rb spec/rubocop/cop/code_reuse/service_class_spec.rb spec/rubocop/cop/code_reuse/worker_spec.rb spec/rubocop/cop/default_scope_spec.rb spec/rubocop/cop/destroy_all_spec.rb spec/rubocop/cop/gitlab/bulk_insert_spec.rb spec/rubocop/cop/gitlab/change_timezone_spec.rb spec/rubocop/cop/gitlab/const_get_inherit_false_spec.rb spec/rubocop/cop/gitlab/finder_with_find_by_spec.rb spec/rubocop/cop/gitlab/httparty_spec.rb spec/rubocop/cop/gitlab/json_spec.rb spec/rubocop/cop/gitlab/module_with_instance_variables_spec.rb spec/rubocop/cop/gitlab/predicate_memoization_spec.rb spec/rubocop/cop/gitlab/rails_logger_spec.rb spec/rubocop/cop/gitlab/union_spec.rb spec/rubocop/cop/group_public_or_visible_to_user_spec.rb spec/rubocop/cop/ignored_columns_spec.rb spec/rubocop/cop/include_sidekiq_worker_spec.rb spec/rubocop/cop/inject_enterprise_edition_module_spec.rb spec/rubocop/cop/line_break_around_conditional_block_spec.rb spec/rubocop/cop/prefer_class_methods_over_module_spec.rb spec/rubocop/cop/project_path_helper_spec.rb spec/rubocop/cop/put_group_routes_under_scope_spec.rb spec/rubocop/cop/put_project_routes_under_scope_spec.rb spec/rubocop/cop/qa/ambiguous_page_object_name_spec.rb spec/rubocop/cop/qa/element_with_pattern_spec.rb spec/rubocop/cop/rspec/any_instance_of_spec.rb spec/rubocop/cop/rspec/be_success_matcher_spec.rb spec/rubocop/cop/rspec/env_assignment_spec.rb spec/rubocop/cop/rspec/factories_in_migration_specs_spec.rb spec/rubocop/cop/ruby_interpolation_in_translation_spec.rb spec/rubocop/cop/safe_params_spec.rb spec/rubocop/cop/sidekiq_options_queue_spec.rb
Running via Spring preloader in process 72851
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}

==> Setting up Gitaly...
Checking gitaly-ruby Gemfile...
Checking gitaly-ruby bundle...
The Gemfile's dependencies are satisfied
Trying to connect to gitaly: ........ OK
Trying to connect to praefect: ... OK
    Gitaly set up in 1.542544 seconds...

==> Setting up GitLab Workhorse...
    GitLab Workhorse set up in 0.000223 seconds...

==> Setting up GitLab Elasticsearch Indexer...
    GitLab Elasticsearch Indexer set up in 0.000159 seconds...
..............................................................................................................................................................................................................................................................

Finished in 9.72 seconds (files took 1.98 seconds to load)
254 examples, 0 failures

After:

$ bin/rspec spec/rubocop/cop/active_record_association_reload_spec.rb spec/rubocop/cop/avoid_keyword_arguments_in_sidekiq_workers_spec.rb spec/rubocop/cop/avoid_route_redirect_leading_slash_spec.rb spec/rubocop/cop/ban_catch_throw_spec.rb spec/rubocop/cop/code_reuse/finder_spec.rb spec/rubocop/cop/code_reuse/presenter_spec.rb spec/rubocop/cop/code_reuse/serializer_spec.rb spec/rubocop/cop/code_reuse/service_class_spec.rb spec/rubocop/cop/code_reuse/worker_spec.rb spec/rubocop/cop/default_scope_spec.rb spec/rubocop/cop/destroy_all_spec.rb spec/rubocop/cop/gitlab/bulk_insert_spec.rb spec/rubocop/cop/gitlab/change_timezone_spec.rb spec/rubocop/cop/gitlab/const_get_inherit_false_spec.rb spec/rubocop/cop/gitlab/finder_with_find_by_spec.rb spec/rubocop/cop/gitlab/httparty_spec.rb spec/rubocop/cop/gitlab/json_spec.rb spec/rubocop/cop/gitlab/module_with_instance_variables_spec.rb spec/rubocop/cop/gitlab/predicate_memoization_spec.rb spec/rubocop/cop/gitlab/rails_logger_spec.rb spec/rubocop/cop/gitlab/union_spec.rb spec/rubocop/cop/group_public_or_visible_to_user_spec.rb spec/rubocop/cop/ignored_columns_spec.rb spec/rubocop/cop/include_sidekiq_worker_spec.rb spec/rubocop/cop/inject_enterprise_edition_module_spec.rb spec/rubocop/cop/line_break_around_conditional_block_spec.rb spec/rubocop/cop/prefer_class_methods_over_module_spec.rb spec/rubocop/cop/project_path_helper_spec.rb spec/rubocop/cop/put_group_routes_under_scope_spec.rb spec/rubocop/cop/put_project_routes_under_scope_spec.rb spec/rubocop/cop/qa/ambiguous_page_object_name_spec.rb spec/rubocop/cop/qa/element_with_pattern_spec.rb spec/rubocop/cop/rspec/any_instance_of_spec.rb spec/rubocop/cop/rspec/be_success_matcher_spec.rb spec/rubocop/cop/rspec/env_assignment_spec.rb spec/rubocop/cop/rspec/factories_in_migration_specs_spec.rb spec/rubocop/cop/ruby_interpolation_in_translation_spec.rb spec/rubocop/cop/safe_params_spec.rb spec/rubocop/cop/sidekiq_options_queue_spec.rb
..............................................................................................................................................................................................................................................................

Finished in 0.24348 seconds (files took 2.45 seconds to load)
254 examples, 0 failures
Edited by 🤖 GitLab Bot 🤖

Merge request reports