Skip to content

Include ExpectOffense module in :rubocop specs

Thong Kuah requested to merge include_expect_offense_rubocop_type_specs into master

What does this MR do?

Include ExpectOffense module in :rubocop specs. This saves us having to manually require the helper when using with fast_spec_helper.rb

Adds new type: rubocop and includes ExpectOffense if spec has that tag.

Related issue: #222306 (closed)

Speed

We also speed up 0.14 seconds (after) vs 4.3 seconds (before) because we switch to

$ ss spec/rubocop/cop/filename_length_spec.rb spec/rubocop/cop/performance/ar_count_each_spec.rb spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb spec/rubocop/cop/performance/readlines_each_spec.rb spec/rubocop/cop/rspec/modify_sidekiq_middleware_spec.rb spec/rubocop/cop/scalability/bulk_perform_with_context_spec.rb spec/rubocop/cop/scalability/cron_worker_context_spec.rb spec/rubocop/cop/scalability/file_uploads_spec.rb spec/rubocop/cop/scalability/idempotent_worker_spec.rb
Running via Spring preloader in process 55810
................................................

Finished in 0.14275 seconds (files took 0.72506 seconds to load)
48 examples, 0 failures
$ ss spec/rubocop/cop/filename_length_spec.rb spec/rubocop/cop/performance/ar_count_each_spec.rb spec/rubocop/cop/performance/ar_exists_and_present_blank_spec.rb spec/rubocop/cop/performance/readlines_each_spec.rb spec/rubocop/cop/rspec/modify_sidekiq_middleware_spec.rb spec/rubocop/cop/scalability/bulk_perform_with_context_spec.rb spec/rubocop/cop/scalability/cron_worker_context_spec.rb spec/rubocop/cop/scalability/file_uploads_spec.rb spec/rubocop/cop/scalability/idempotent_worker_spec.rb
Running via Spring preloader in process 55549
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.417346 seconds...

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

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

Finished in 4.34 seconds (files took 2.07 seconds to load)
48 examples, 0 failures
Edited by Thong Kuah

Merge request reports