Skip to content

Fix fast_spec_helper to run under spring

Chad Woolley requested to merge fix-fast-spec-helper-under-spring into master

What does this MR do and why?

Fixes fast_spec_helper to run under spring, by fixing issue with spec/rails_autoload.rb.

This is needed because under RubyMine, the spring preloader is globally enabled or disabled.

So, whenever you run a focused fast spec with spring enabled, it will fail with a Zeitwerk error.

Then you have to disable Spring to run the test, but you forget to re-enable it, then all your non-fast specs are running slow without spring until you remember to turn it back on.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  • On master without this MR, run bin/spring rspec ee/spec/lib/gitlab/regex_spec.rb and see it fail with the Zeitwerk error.
  • On this MR, run bin/spring rspec ee/spec/lib/gitlab/regex_spec.rb and see it pass.
  • On this MR, verify it still works without spring: bin/rspec ee/spec/lib/gitlab/regex_spec.rb
Edited by Chad Woolley

Merge request reports