MCPcopy Index your code
hub / github.com/dnote/dnote / setupNewServer

Function setupNewServer

pkg/e2e/sync/testutils.go:113–121  ·  view source on GitHub ↗

setupNewServer creates a new server and returns the server and database. This is useful when a test needs to switch to a new empty server.

(t *testing.T)

Source from the content-addressed store, hash-verified

111// setupNewServer creates a new server and returns the server and database.
112// This is useful when a test needs to switch to a new empty server.
113func setupNewServer(t *testing.T) (*httptest.Server, *gorm.DB) {
114 server, serverDB, err := setupTestServer(t, serverTime)
115 if err != nil {
116 t.Fatal(errors.Wrap(err, "setting up new test server"))
117 }
118 t.Cleanup(func() { server.Close() })
119
120 return server, serverDB
121}
122
123// updateConfigAPIEndpoint updates the config file with the given API endpoint
124func updateConfigAPIEndpoint(t *testing.T, tmpDir string, apiEndpoint string) {

Callers 2

setupTestEnvFunction · 0.85
switchToEmptyServerFunction · 0.85

Calls 2

setupTestServerFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected