MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / BootstrapStartupConfigForTest

Function BootstrapStartupConfigForTest

rest/utilities_testing_bootstrap.go:24–57  ·  view source on GitHub ↗

BootstrapStartupConfigForTest returns a default config for use to start a Sync Gateway server. It will run APIs on randomly chosen ports.

(t *testing.T)

Source from the content-addressed store, hash-verified

22
23// BootstrapStartupConfigForTest returns a default config for use to start a Sync Gateway server. It will run APIs on randomly chosen ports.
24func BootstrapStartupConfigForTest(t *testing.T) StartupConfig {
25 config := DefaultStartupConfig("")
26
27 config.Logging.Console = &base.ConsoleLoggerConfig{
28 LogLevel: base.ConsoleLogLevel(),
29 LogKeys: base.ConsoleLogKey().EnabledLogKeys(),
30 }
31
32 config.API.AdminInterfaceAuthentication = base.Ptr(false)
33
34 randomPort := "127.0.0.1:0"
35
36 config.API.PublicInterface = randomPort
37 config.API.AdminInterface = randomPort
38 config.API.MetricsInterface = randomPort
39 config.Unsupported.DiagnosticInterface = randomPort
40
41 config.Bootstrap.Server = base.UnitTestUrl()
42 config.Bootstrap.Username = base.TestClusterUsername()
43 config.Bootstrap.Password = base.TestClusterPassword()
44 config.Bootstrap.ServerTLSSkipVerify = base.Ptr(base.TestTLSSkipVerify())
45 config.Bootstrap.UseTLSServer = base.Ptr(base.ServerIsTLS(base.UnitTestUrl()))
46
47 uniqueUUID, err := uuid.NewRandom()
48 require.NoError(t, err)
49
50 if base.IsEnterpriseEdition() {
51 config.Bootstrap.ConfigGroupID = uniqueUUID.String()
52 } else if !base.UnitTestUrlIsWalrus() {
53 t.Skip("BootstrapStartupConfigForTest requires EE support, since the config files can be read by future tests in the bucket pool")
54 }
55
56 return config
57}
58
59type boostrapResponse struct {
60 response *http.Response

Calls 13

ConsoleLogLevelFunction · 0.92
ConsoleLogKeyFunction · 0.92
PtrFunction · 0.92
UnitTestUrlFunction · 0.92
TestClusterUsernameFunction · 0.92
TestClusterPasswordFunction · 0.92
TestTLSSkipVerifyFunction · 0.92
ServerIsTLSFunction · 0.92
IsEnterpriseEditionFunction · 0.92
UnitTestUrlIsWalrusFunction · 0.92
DefaultStartupConfigFunction · 0.85
EnabledLogKeysMethod · 0.80