Fix bundler usage
This fixes the:
All examples were filtered out; ignoring {:focus=>true}
The following gems are missing
* jaeger-client (0.10.0)
* gitlab-labkit (0.13.0)
Install missing gems with `bundle install`
bundle check failed
An error occurred in a `before(:suite)` hook.
Failure/Error: raise message
RuntimeError:
gitaly spawn failed (try `rm -rf tmp/tests/gitaly` ?)
# ./spec/support/helpers/test_env.rb:196:in `block in start_gitaly'
# ./spec/support/helpers/test_env.rb:192:in `start_gitaly'
# ./spec/support/helpers/test_env.rb:174:in `setup_gitaly'
# ./spec/support/helpers/test_env.rb:114:in `init'
# ./ee/spec/support/helpers/ee/test_env.rb:6:in `init'
# ./spec/spec_helper.rb:180:in `block (2 levels) in <top (required)>'
It appears that the meaning of BUNDLE_PATH
and Bundler.bundle_path
changed in Bundler 2.1.x
: https://github.com/docker-library/ruby/pull/306
- Bundler 2.1.4 does not like it, due to fact that BUNDLE_PATH is treated differently, and Bundler.bundle_path returning something different.
- This started failing, as Gitaly currently have older dependencies than GitLab Rails, so, they would not be loaded properly, as they would not be found. The bundle install for Gitaly would still run, but it would install these required deps in a completely different folder. The intent for Gitaly in tests is to share bundler directory.
- So, lets assume that BUNDLE_PATH=/data/cache/bundle-2.7. The gitaly.rake task would read Bundler.bundle_path and set a BUNDLE_PATH=/data/cache/bundle-2.7/ruby/2.7.0. The gitlab.rake would call make install and install deps in this folder, but Gitaly would still be tried to run with
BUNDLE_PATH=/data/cache/bundle-2.7
. - The above is specific to GCK, that sets BUNDLE_PATH, if you only use GEM_PATH everything should be fine.
Edited by Kamil Trzciński (Back 2025-01-01)