Commit 980783d2 authored by Stan Hu's avatar Stan Hu

Check for existence of gitaly-ruby Gemfile

This will make it clearer why a gitaly-ruby `bundle check`
failed. Currently there is an implicit assumption that jobs in the test
stage will run within 24 hours of the `setup-test-env` step
running. However, if a test runs after that time frame, the CI artifacts
will have been destroyed, and the `tmp/tests` directory won't contain
the right data.

This happened in https://gitlab.com/gitlab-org/gitlab/-/jobs/371020233.
The gitaly-ruby `bundle check` quietly failed because
`tmp/tests/gitaly-ruby/Gemfile` didn't exist. At first, we thought
`bundle check` failed because of a stale cache or a missing Gem.
parent 234e2bdd
......@@ -56,6 +56,14 @@ module GitalyTest
end
def check_gitaly_config!
puts "Checking gitaly-ruby Gemfile..."
unless File.exist?(gemfile)
message = "#{gemfile} does not exist."
message += "\n\nThis might have happened if the CI artifacts for this build were destroyed." if ENV['CI']
abort message
end
puts 'Checking gitaly-ruby bundle...'
abort 'bundle check failed' unless system(env, 'bundle', 'check', chdir: File.dirname(gemfile))
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment