Skip to content

Attempt to reinstall required Gitaly gems in tests

Stan Hu requested to merge sh-improve-gitaly-bundle-check into master

What does this MR do and why?

Before a test runs Gitaly, it attempts to run bundle check to ensure all the required gems are installed. If they are not, the test aborts.

Instead of failing, let's try to recover via a bundle install and only fail if the subsequent bundle check fails. This makes the tests more resilient to users uninstalling gems or switching Ruby versions.

How to set up and validate locally

  1. Downgrade to Ruby 2.7.7:
diff --git a/.tool-versions b/.tool-versions
index ecddbdfeadce..0442b347209d 100644
--- a/.tool-versions
+++ b/.tool-versions
@@ -2,6 +2,6 @@ minio 2022-07-15T03-44-22Z
 nodejs 16.15.0
 postgres 12.13 13.9
 redis 6.2.7
-ruby 3.0.5
+ruby 2.7.7
 rust 1.65.0
 yarn 1.22.19
  1. Run bundle install and then run any spec (e.g. bundle exec rspec ./spec/requests/api/graphql/mutations/issues/bulk_update_spec.rb).

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Stan Hu

Merge request reports