mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-20 12:33:09 -06:00
Remove outdated comments
This commit is contained in:
parent
5773e8722f
commit
7900bfeb52
11
test/db.go
11
test/db.go
|
|
@ -103,17 +103,6 @@ func currentUser() string {
|
||||||
// unless close() is called.
|
// unless close() is called.
|
||||||
func PrepareDBConnectionString(t *testing.T, dbType DBType) (connStr string, close func()) {
|
func PrepareDBConnectionString(t *testing.T, dbType DBType) (connStr string, close func()) {
|
||||||
if dbType == DBTypeSQLite {
|
if dbType == DBTypeSQLite {
|
||||||
// TODO (devon): remove?
|
|
||||||
// rand.Seed(time.Now().UnixNano())
|
|
||||||
// randBytes := make([]byte, 32)
|
|
||||||
// rand.Read(randBytes)
|
|
||||||
// dbName := fmt.Sprintf("dendrite_test_%s.db", hex.EncodeToString(randBytes[:16]))
|
|
||||||
// return fmt.Sprintf("file:%s", dbName), func() {
|
|
||||||
// err := os.Remove(dbName)
|
|
||||||
// if err != nil {
|
|
||||||
// t.Fatalf("failed to cleanup sqlite db '%s': %s", dbName, err)
|
|
||||||
// }
|
|
||||||
|
|
||||||
// this will be made in the t.TempDir, which is unique per test
|
// this will be made in the t.TempDir, which is unique per test
|
||||||
dbname := filepath.Join(t.TempDir(), "dendrite_test.db")
|
dbname := filepath.Join(t.TempDir(), "dendrite_test.db")
|
||||||
return fmt.Sprintf("file:%s", dbname), func() {
|
return fmt.Sprintf("file:%s", dbname), func() {
|
||||||
|
|
|
||||||
|
|
@ -71,25 +71,6 @@ func CreateBaseDendrite(t *testing.T, dbType test.DBType) (*base.BaseDendrite, f
|
||||||
})
|
})
|
||||||
cfg.Global.ServerName = "test"
|
cfg.Global.ServerName = "test"
|
||||||
|
|
||||||
// TODO (devon): remove?
|
|
||||||
// // Configure each components db connection to be unique so tests can run in parallel
|
|
||||||
// connStr, _ := test.PrepareDBConnectionString(t, dbType)
|
|
||||||
// cfg.FederationAPI.Database.ConnectionString = config.DataSource(connStr)
|
|
||||||
// connStr, _ = test.PrepareDBConnectionString(t, dbType)
|
|
||||||
// cfg.KeyServer.Database.ConnectionString = config.DataSource(connStr)
|
|
||||||
// connStr, _ = test.PrepareDBConnectionString(t, dbType)
|
|
||||||
// cfg.MSCs.Database.ConnectionString = config.DataSource(connStr)
|
|
||||||
// connStr, _ = test.PrepareDBConnectionString(t, dbType)
|
|
||||||
// cfg.MediaAPI.Database.ConnectionString = config.DataSource(connStr)
|
|
||||||
// connStr, _ = test.PrepareDBConnectionString(t, dbType)
|
|
||||||
// cfg.RoomServer.Database.ConnectionString = config.DataSource(connStr)
|
|
||||||
// connStr, _ = test.PrepareDBConnectionString(t, dbType)
|
|
||||||
// cfg.SyncAPI.Database.ConnectionString = config.DataSource(connStr)
|
|
||||||
// connStr, _ = test.PrepareDBConnectionString(t, dbType)
|
|
||||||
// cfg.UserAPI.AccountDatabase.ConnectionString = config.DataSource(connStr)
|
|
||||||
// connStr, _ = test.PrepareDBConnectionString(t, dbType)
|
|
||||||
// cfg.RelayAPI.Database.ConnectionString = config.DataSource(connStr)
|
|
||||||
|
|
||||||
// use a distinct prefix else concurrent postgres/sqlite runs will clash since NATS will use
|
// use a distinct prefix else concurrent postgres/sqlite runs will clash since NATS will use
|
||||||
// the file system event with InMemory=true :(
|
// the file system event with InMemory=true :(
|
||||||
cfg.Global.JetStream.TopicPrefix = fmt.Sprintf("Test_%d_", dbType)
|
cfg.Global.JetStream.TopicPrefix = fmt.Sprintf("Test_%d_", dbType)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue