From 8448117b0152b7e0fefe7ed21eb1219224aadfd4 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Wed, 1 Mar 2017 14:16:29 +0000 Subject: [PATCH] Review comments --- .../roomserver/roomserver-integration-tests/main.go | 8 ++++---- travis-install-kafka.sh | 2 ++ travis-test.sh | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/roomserver/roomserver-integration-tests/main.go b/src/github.com/matrix-org/dendrite/roomserver/roomserver-integration-tests/main.go index b66ffaaa5..06f22a2a2 100644 --- a/src/github.com/matrix-org/dendrite/roomserver/roomserver-integration-tests/main.go +++ b/src/github.com/matrix-org/dendrite/roomserver/roomserver-integration-tests/main.go @@ -19,11 +19,11 @@ var ( kafkaURI = defaulting(os.Getenv("KAFKA_URIS"), "localhost:9092") // How long to wait for the roomserver to write the expected output messages. 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") // The name of the test database to create. 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)) ) @@ -89,7 +89,7 @@ func writeToTopic(topic string, data []string) error { // 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 // 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. func runAndReadFromTopic(runCmd *exec.Cmd, topic string, count int) ([]string, error) { type result struct { @@ -126,7 +126,7 @@ func runAndReadFromTopic(runCmd *exec.Cmd, topic string, count int) ([]string, e r := <-done // 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() readCmd.Process.Kill() diff --git a/travis-install-kafka.sh b/travis-install-kafka.sh index 81d8f8382..20855fcc1 100755 --- a/travis-install-kafka.sh +++ b/travis-install-kafka.sh @@ -1,5 +1,7 @@ # /bin/bash +set -eu + # 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 # TODO: Check the signature since we are downloading over HTTP. diff --git a/travis-test.sh b/travis-test.sh index bd866c404..b3ed18cfa 100755 --- a/travis-test.sh +++ b/travis-test.sh @@ -10,4 +10,4 @@ gb build github.com/matrix-org/dendrite/roomserver/roomserver-integration-tests ./hooks/pre-commit # Run the integration tests -${DEBUG:=""} bin/roomserver-integration-tests +bin/roomserver-integration-tests