common/test/server: Clarify postgresContainerName

This commit is contained in:
Robert Swain 2017-06-08 14:53:45 +02:00
parent f68ef67cb6
commit cc6595f848
3 changed files with 4 additions and 2 deletions

View file

@ -37,7 +37,7 @@ var (
postgresDatabase = test.Defaulting(os.Getenv("POSTGRES_DATABASE"), "postgres") postgresDatabase = test.Defaulting(os.Getenv("POSTGRES_DATABASE"), "postgres")
// The name of the test database to create. // The name of the test database to create.
testDatabaseName = test.Defaulting(os.Getenv("DATABASE_NAME"), "mediaapi_test") testDatabaseName = test.Defaulting(os.Getenv("DATABASE_NAME"), "mediaapi_test")
// Postgres docker container name (for running psql) // Postgres docker container name (for running psql). If not set, psql must be in PATH.
postgresContainerName = os.Getenv("POSTGRES_CONTAINER") postgresContainerName = os.Getenv("POSTGRES_CONTAINER")
// Test image to be uploaded/downloaded // Test image to be uploaded/downloaded
testJPEG = test.Defaulting(os.Getenv("TEST_JPEG_PATH"), "src/github.com/matrix-org/dendrite/cmd/mediaapi-integration-tests/totem.jpg") testJPEG = test.Defaulting(os.Getenv("TEST_JPEG_PATH"), "src/github.com/matrix-org/dendrite/cmd/mediaapi-integration-tests/totem.jpg")

View file

@ -43,7 +43,7 @@ var (
timeoutString = test.Defaulting(os.Getenv("TIMEOUT"), "10s") timeoutString = test.Defaulting(os.Getenv("TIMEOUT"), "10s")
// The name of maintenance database to connect to in order to create the test database. // The name of maintenance database to connect to in order to create the test database.
postgresDatabase = test.Defaulting(os.Getenv("POSTGRES_DATABASE"), "postgres") postgresDatabase = test.Defaulting(os.Getenv("POSTGRES_DATABASE"), "postgres")
// Postgres docker container name (for running psql) // Postgres docker container name (for running psql). If not set, psql must be in PATH.
postgresContainerName = os.Getenv("POSTGRES_CONTAINER") postgresContainerName = os.Getenv("POSTGRES_CONTAINER")
// The name of the test database to create. // The name of the test database to create.
testDatabaseName = test.Defaulting(os.Getenv("DATABASE_NAME"), "syncserver_test") testDatabaseName = test.Defaulting(os.Getenv("DATABASE_NAME"), "syncserver_test")

View file

@ -67,6 +67,8 @@ func CreateBackgroundCommand(command string, args []string) (*exec.Cmd, chan err
// StartServer creates the database and config file needed for the server to run and // StartServer creates the database and config file needed for the server to run and
// then starts the server. The Cmd being executed is returned. A channel is also returned, // then starts the server. The Cmd being executed is returned. A channel is also returned,
// which will have any termination errors sent down it, followed immediately by the channel being closed. // which will have any termination errors sent down it, followed immediately by the channel being closed.
// If postgresContainerName is not an empty string, psql will be run from inside that container. If it is
// an empty string, psql will be assumed to be in PATH.
func StartServer(serverType string, serverArgs []string, suffix, configFilename, configFileContents, postgresDatabase, postgresContainerName string, databases []string) (*exec.Cmd, chan error) { func StartServer(serverType string, serverArgs []string, suffix, configFilename, configFileContents, postgresDatabase, postgresContainerName string, databases []string) (*exec.Cmd, chan error) {
if len(databases) > 0 { if len(databases) > 0 {
var dbCmd string var dbCmd string