Merge branch '32762-gitaly-should-be-recompiled-when-gitaly_server_version-changes' into 'master'
Recompile test env Gitaly when `GITALY_SERVER_VERSION` fails Closes #32762 See merge request !11664
This commit is contained in:
commit
43c3614ebf
1 changed files with 12 additions and 1 deletions
|
@ -123,7 +123,7 @@ module TestEnv
|
|||
socket_path = Gitlab::GitalyClient.address('default').sub(/\Aunix:/, '')
|
||||
gitaly_dir = File.dirname(socket_path)
|
||||
|
||||
unless File.directory?(gitaly_dir) || system('rake', "gitlab:gitaly:install[#{gitaly_dir}]")
|
||||
unless !gitaly_needs_update?(gitaly_dir) || system('rake', "gitlab:gitaly:install[#{gitaly_dir}]")
|
||||
raise "Can't clone gitaly"
|
||||
end
|
||||
|
||||
|
@ -252,4 +252,15 @@ module TestEnv
|
|||
cleanup && init unless reset.call
|
||||
end
|
||||
end
|
||||
|
||||
def gitaly_needs_update?(gitaly_dir)
|
||||
gitaly_version = File.read(File.join(gitaly_dir, 'VERSION')).strip
|
||||
|
||||
# Notice that this will always yield true when using branch versions
|
||||
# (`=branch_name`), but that actually makes sure the server is always based
|
||||
# on the latest branch revision.
|
||||
gitaly_version != Gitlab::GitalyClient.expected_server_version
|
||||
rescue Errno::ENOENT
|
||||
true
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue