mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-03-28 04:24:28 -05:00
syncserver-integration-tests: WIP db improvements
This commit is contained in:
parent
aa17cf83ac
commit
72154fd474
|
@ -50,6 +50,10 @@ var (
|
|||
testDatabaseName = defaulting(os.Getenv("DATABASE_NAME"), "syncserver_test")
|
||||
// The postgres connection config for connecting to the test database.
|
||||
testDatabase = defaulting(os.Getenv("DATABASE"), fmt.Sprintf("dbname=%s sslmode=disable binary_parameters=yes", testDatabaseName))
|
||||
// The name of the test account database to create.
|
||||
testAccountDatabaseName = defaulting(os.Getenv("ACCOUNT_DATABASE_NAME"), "account_test")
|
||||
// The postgres connection config for connecting to the test account database.
|
||||
testAccountDatabase = defaulting(os.Getenv("ACCOUNT_DATABASE"), fmt.Sprintf("dbname=%s sslmode=disable binary_parameters=yes", testDatabaseName))
|
||||
)
|
||||
|
||||
const inputTopic = "syncserverInput"
|
||||
|
@ -83,6 +87,7 @@ func getLastRequestError() error {
|
|||
var syncServerConfigFileContents = (`consumer_uris: ["` + kafkaURI + `"]
|
||||
roomserver_topic: "` + inputTopic + `"
|
||||
database: "` + testDatabase + `"
|
||||
account_database: "` + testAccountDatabase + `"
|
||||
server_name: "localhost"
|
||||
`)
|
||||
|
||||
|
@ -231,6 +236,9 @@ func startSyncServer() (*exec.Cmd, chan error) {
|
|||
if err := createDatabase(testDatabaseName); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err := createDatabase(testAccountDatabaseName); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if err := createTestUser(testDatabase, "alice", "@alice:localhost"); err != nil {
|
||||
panic(err)
|
||||
|
|
Loading…
Reference in a new issue