Skip to content

Resolve "`bin/rspec`/`bin/karma` can nuke the GDK entirely"

username-removed-128633 requested to merge 37872-fix-nasty-gdk-nuke into master

What does this MR do?

This implements 3 level of safety to ensure we don't accidentally nuke the whole GDK installation dir.

  1. Ensure RAILS_ENV is set to test in spec/spec_helper.rb
  2. Abort TestEnv.init if RAILS_ENV is not test
  3. Ensure the Gitaly/GiLab Shell install dirs are well named (so that if the path is somehow wrong, e.g. gdk, we abort and don't accidentally remove a wrong install dir).

Are there points in the code the reviewer needs to double check?

I've refactored the Gitaly & GitLab Shell setup methods, they still work after rm -rf tmp/tests, though.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #37872 (closed)

Merge request reports