travis: Skip development database setup in production tests.

This saves about 20s on the runtime of the production build.
This commit is contained in:
Tim Abbott
2016-06-22 08:45:17 -07:00
parent 0f2729f5fb
commit 5a109cf816
2 changed files with 9 additions and 7 deletions

View File

@@ -191,12 +191,14 @@ def main():
run(["sudo", "pg_createcluster", "-e", "utf8", "--start", POSTGRES_VERSION, "main"]) run(["sudo", "pg_createcluster", "-e", "utf8", "--start", POSTGRES_VERSION, "main"])
run(["sudo", "service", "redis-server", "restart"]) run(["sudo", "service", "redis-server", "restart"])
run(["sudo", "service", "memcached", "restart"]) run(["sudo", "service", "memcached", "restart"])
run(["scripts/setup/configure-rabbitmq"]) if '--production-travis' not in sys.argv:
run(["tools/setup/postgres-init-dev-db"]) # These won't be used anyway
run(["tools/do-destroy-rebuild-database"]) run(["scripts/setup/configure-rabbitmq"])
run(["tools/setup/postgres-init-test-db"]) run(["tools/setup/postgres-init-dev-db"])
run(["tools/do-destroy-rebuild-test-database"]) run(["tools/do-destroy-rebuild-database"])
run(["python", "./manage.py", "compilemessages"]) run(["tools/setup/postgres-init-test-db"])
run(["tools/do-destroy-rebuild-test-database"])
run(["python", "./manage.py", "compilemessages"])
# Install the pinned version of npm. # Install the pinned version of npm.
install_npm() install_npm()
# Run npm install last because it can be flaky, and that way one # Run npm install last because it can be flaky, and that way one

View File

@@ -7,7 +7,7 @@ set -x
# to conflicts over which version of postgres should be running. # to conflicts over which version of postgres should be running.
sudo apt-get remove postgresql-9.1 postgresql-9.2 postgresql-9.4 -y sudo apt-get remove postgresql-9.1 postgresql-9.2 postgresql-9.4 -y
python provision.py --travis python provision.py --travis --production-travis
cp -a tools/travis/success-http-headers.txt ~/ cp -a tools/travis/success-http-headers.txt ~/
source /srv/zulip-venv/bin/activate source /srv/zulip-venv/bin/activate
./tools/build-release-tarball travis ./tools/build-release-tarball travis