blob: 282f81e5416b466e27603f6b773a6bda78338473 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
//go:build !gitaly_test_sha256
package main
import (
"path/filepath"
"testing"
"gitlab.com/gitlab-org/gitaly/v15/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/v15/internal/gitlab"
"gitlab.com/gitlab-org/gitaly/v15/internal/testhelper"
)
func TestMain(m *testing.M) {
testhelper.Run(m)
}
func runTestServer(t *testing.T, options gitlab.TestServerOptions) (config.Gitlab, func()) {
tempDir := testhelper.TempDir(t)
gitlab.WriteShellSecretFile(t, tempDir, secretToken)
secretFilePath := filepath.Join(tempDir, ".gitlab_shell_secret")
serverURL, serverCleanup := gitlab.NewTestServer(t, options)
c := config.Gitlab{URL: serverURL, SecretFile: secretFilePath, HTTPSettings: config.HTTPSettings{CAFile: certPath}}
return c, func() {
serverCleanup()
}
}
|