Review comments

This commit is contained in:
Mark Haines 2017-03-01 14:16:29 +00:00
parent 6d32068d88
commit 8448117b01
3 changed files with 7 additions and 5 deletions

View file

@ -19,11 +19,11 @@ var (
kafkaURI = defaulting(os.Getenv("KAFKA_URIS"), "localhost:9092") kafkaURI = defaulting(os.Getenv("KAFKA_URIS"), "localhost:9092")
// How long to wait for the roomserver to write the expected output messages. // How long to wait for the roomserver to write the expected output messages.
timeoutString = defaulting(os.Getenv("TIMEOUT"), "10s") timeoutString = defaulting(os.Getenv("TIMEOUT"), "10s")
// The name of maintentence 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 = defaulting(os.Getenv("POSTGRES_DATABASE"), "postgres") postgresDatabase = defaulting(os.Getenv("POSTGRES_DATABASE"), "postgres")
// The name of the test database to create. // The name of the test database to create.
testDatabaseName = defaulting(os.Getenv("DATABASE_NAME"), "roomserver_test") testDatabaseName = defaulting(os.Getenv("DATABASE_NAME"), "roomserver_test")
// The postgress connection config for connecting to the test database. // The postgres connection config for connecting to the test database.
testDatabase = defaulting(os.Getenv("DATABASE"), fmt.Sprintf("dbname=%s binary_parameters=yes", testDatabaseName)) testDatabase = defaulting(os.Getenv("DATABASE"), fmt.Sprintf("dbname=%s binary_parameters=yes", testDatabaseName))
) )
@ -89,7 +89,7 @@ func writeToTopic(topic string, data []string) error {
// runAndReadFromTopic runs a command and waits for a number of messages to be // runAndReadFromTopic runs a command and waits for a number of messages to be
// written to a kafka topic. It returns if the command exits, the number of // written to a kafka topic. It returns if the command exits, the number of
// messages is reached or after a timeout. It kills the command before it returns. // messages is reached or after a timeout. It kills the command before it returns.
// It return a list of the messages read from the command on success or an error // It returns a list of the messages read from the command on success or an error
// on failure. // on failure.
func runAndReadFromTopic(runCmd *exec.Cmd, topic string, count int) ([]string, error) { func runAndReadFromTopic(runCmd *exec.Cmd, topic string, count int) ([]string, error) {
type result struct { type result struct {
@ -126,7 +126,7 @@ func runAndReadFromTopic(runCmd *exec.Cmd, topic string, count int) ([]string, e
r := <-done r := <-done
// Kill both processes. We don't check if the processes are running and // Kill both processes. We don't check if the processes are running and
// we ignore failures since we are just trying to clean up before returing. // we ignore failures since we are just trying to clean up before returning.
runCmd.Process.Kill() runCmd.Process.Kill()
readCmd.Process.Kill() readCmd.Process.Kill()

View file

@ -1,5 +1,7 @@
# /bin/bash # /bin/bash
set -eu
# The mirror to download kafka from is picked from the list of mirrors at # The mirror to download kafka from is picked from the list of mirrors at
# https://www.apache.org/dyn/closer.cgi?path=/kafka/0.10.2.0/kafka_2.11-0.10.2.0.tgz # https://www.apache.org/dyn/closer.cgi?path=/kafka/0.10.2.0/kafka_2.11-0.10.2.0.tgz
# TODO: Check the signature since we are downloading over HTTP. # TODO: Check the signature since we are downloading over HTTP.

View file

@ -10,4 +10,4 @@ gb build github.com/matrix-org/dendrite/roomserver/roomserver-integration-tests
./hooks/pre-commit ./hooks/pre-commit
# Run the integration tests # Run the integration tests
${DEBUG:=""} bin/roomserver-integration-tests bin/roomserver-integration-tests