blob: 122d6b7682628fbb8f0e276e372cd8157fa560a3 (
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
32
33
34
35
36
|
package main
import (
"path/filepath"
"testing"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/v16/internal/gitlab"
"gitlab.com/gitlab-org/gitaly/v16/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)
var certPath string
if options.ServerCertificate != nil {
certPath = options.ServerCertificate.CertPath
}
c := config.Gitlab{URL: serverURL, SecretFile: secretFilePath, HTTPSettings: config.HTTPSettings{
CAFile: certPath,
}}
return c, func() {
serverCleanup()
}
}
|