Commit ae5a55f4 authored by Patrick Steinhardt's avatar Patrick Steinhardt

Use Gitaly binaries from Gitaly's build directory

When building Gitaly, it is building binaries inside of its `_build/bin`
directory, but due to legacy reasons it will also copy these binaries
into its root directory. Given that this second step is going to go away
soon, we should start to use the `_build/bin` directory.

Provide a new helper function to locate the binaries directory and
convert paths which refer to the executable to use it.
parent a2185bdc
...@@ -159,18 +159,13 @@ setup-test-env: ...@@ -159,18 +159,13 @@ setup-test-env:
expire_in: 7d expire_in: 7d
paths: paths:
- config/secrets.yml - config/secrets.yml
- tmp/tests/gitaly/_build/bin/
- tmp/tests/gitaly/config.toml - tmp/tests/gitaly/config.toml
- tmp/tests/gitaly/gitaly
- tmp/tests/gitaly/gitaly2.config.toml - tmp/tests/gitaly/gitaly2.config.toml
- tmp/tests/gitaly/gitaly-git2go
- tmp/tests/gitaly/gitaly-hooks
- tmp/tests/gitaly/gitaly-lfs-smudge
- tmp/tests/gitaly/gitaly-ssh
- tmp/tests/gitaly/internal/ - tmp/tests/gitaly/internal/
- tmp/tests/gitaly/internal_gitaly2/ - tmp/tests/gitaly/internal_gitaly2/
- tmp/tests/gitaly/internal_sockets/ - tmp/tests/gitaly/internal_sockets/
- tmp/tests/gitaly/Makefile - tmp/tests/gitaly/Makefile
- tmp/tests/gitaly/praefect
- tmp/tests/gitaly/praefect.config.toml - tmp/tests/gitaly/praefect.config.toml
- tmp/tests/gitaly/ruby/ - tmp/tests/gitaly/ruby/
- tmp/tests/gitlab-elasticsearch-indexer/bin/gitlab-elasticsearch-indexer - tmp/tests/gitlab-elasticsearch-indexer/bin/gitlab-elasticsearch-indexer
......
...@@ -1416,7 +1416,7 @@ test: ...@@ -1416,7 +1416,7 @@ test:
gitaly_address: unix:tmp/tests/gitaly/praefect.socket gitaly_address: unix:tmp/tests/gitaly/praefect.socket
gitaly: gitaly:
client_path: tmp/tests/gitaly client_path: tmp/tests/gitaly/_build/bin
token: secret token: secret
workhorse: workhorse:
secret_file: tmp/gitlab_workhorse_test_secret secret_file: tmp/gitlab_workhorse_test_secret
......
...@@ -31,8 +31,8 @@ class GitalyTestBuild ...@@ -31,8 +31,8 @@ class GitalyTestBuild
# Make the 'gitaly' executable look newer than 'GITALY_SERVER_VERSION'. # Make the 'gitaly' executable look newer than 'GITALY_SERVER_VERSION'.
# Without this a gitaly executable created in the setup-test-env job # Without this a gitaly executable created in the setup-test-env job
# will look stale compared to GITALY_SERVER_VERSION. # will look stale compared to GITALY_SERVER_VERSION.
FileUtils.touch(File.join(tmp_tests_gitaly_dir, 'gitaly'), mtime: Time.now + (1 << 24)) FileUtils.touch(File.join(tmp_tests_gitaly_bin_dir, 'gitaly'), mtime: Time.now + (1 << 24))
FileUtils.touch(File.join(tmp_tests_gitaly_dir, 'praefect'), mtime: Time.now + (1 << 24)) FileUtils.touch(File.join(tmp_tests_gitaly_bin_dir, 'praefect'), mtime: Time.now + (1 << 24))
end end
end end
......
...@@ -22,6 +22,10 @@ module GitalySetup ...@@ -22,6 +22,10 @@ module GitalySetup
File.expand_path('../../../tmp/tests/gitaly', __dir__) File.expand_path('../../../tmp/tests/gitaly', __dir__)
end end
def tmp_tests_gitaly_bin_dir
File.join(tmp_tests_gitaly_dir, '_build', 'bin')
end
def tmp_tests_gitlab_shell_dir def tmp_tests_gitlab_shell_dir
File.expand_path('../../../tmp/tests/gitlab-shell', __dir__) File.expand_path('../../../tmp/tests/gitlab-shell', __dir__)
end end
...@@ -110,7 +114,7 @@ module GitalySetup ...@@ -110,7 +114,7 @@ module GitalySetup
end end
def start(service) def start(service)
args = ["#{tmp_tests_gitaly_dir}/#{service_binary(service)}"] args = ["#{tmp_tests_gitaly_bin_dir}/#{service_binary(service)}"]
args.push("-config") if service == :praefect args.push("-config") if service == :praefect
args.push(config_path(service)) args.push(config_path(service))
pid = spawn(env, *args, [:out, :err] => "log/#{service}-test.log") pid = spawn(env, *args, [:out, :err] => "log/#{service}-test.log")
......
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