diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2020-10-13 13:23:35 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2020-10-15 14:53:48 +0300 |
commit | 1ed9d219191d19125defe1f6c0e5455e6dacdb8d (patch) | |
tree | 1aef50241545d9c555905fab8bffdfa2b4063a3a /internal/testhelper/testserver.go | |
parent | 05cd75fb57f06f29978e6cc0da3f7bc35d85859f (diff) |
hooks: Check command ported to Go
GitLab-Shell has `bin/check` as a small utility to check the API access
required for the hooks. These hooks are now managed by Gitaly, and
gitaly-hooks has a subcommand `check` too. This subcommend used to
invoke `bin/check` from the vendored `gitlab-shell`.
This change ports the logic to Go, and removes `bin/check`.
It depends on the same config values that the hooks depend on, which
wasn't always true, but usually was just because of Omnibus
configuration reconfiguration.
Diffstat (limited to 'internal/testhelper/testserver.go')
-rw-r--r-- | internal/testhelper/testserver.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/testhelper/testserver.go b/internal/testhelper/testserver.go index ce2e85f82..741b69870 100644 --- a/internal/testhelper/testserver.go +++ b/internal/testhelper/testserver.go @@ -874,16 +874,16 @@ func WriteTemporaryGitlabShellConfigFile(t FatalLogger, dir string, config Gitla // WriteTemporaryGitalyConfigFile writes a gitaly toml file into a temporary directory. It returns the path to // the file as well as a cleanup function -func WriteTemporaryGitalyConfigFile(t testing.TB, tempDir, gitlabURL, user, password string) (string, func()) { +func WriteTemporaryGitalyConfigFile(t testing.TB, tempDir, gitlabURL, user, password, secretFile string) (string, func()) { path := filepath.Join(tempDir, "config.toml") contents := fmt.Sprintf(` -[gitlab-shell] - dir = "%s/gitlab-shell" - gitlab_url = %q - [gitlab-shell.http-settings] +[gitlab] + url = "%s" + secret_file = "%s" + [gitlab.http-settings] user = %q password = %q -`, tempDir, gitlabURL, user, password) +`, gitlabURL, secretFile, user, password) require.NoError(t, ioutil.WriteFile(path, []byte(contents), 0644)) return path, func() { |