diff --git a/Makefile b/Makefile index 41b48faa6..e728ea6bb 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,23 @@ test: unit test/registry_tests.py TEST=true PYTHONPATH="." py.test --timeout=3600 --verbose --show-count -x \ test/registry_tests.py +PG_PASSWORD := quay +PG_USER := quay +PG_HOST := postgresql://$(PG_USER):$(PG_PASSWORD)@localhost/quay + +test_postgres : TEST_ENV := SKIP_DB_SCHEMA=true TEST=true \ + TEST_DATABASE_URI=$(PG_HOST) PYTHONPATH=. + +test_postgres: + docker rm -f postgres-testrunner-postgres || true + docker run --name postgres-testrunner-postgres \ + -e POSTGRES_PASSWORD=$(PG_PASSWORD) -e POSTGRES_USER=${PG_USER} \ + -p 5432:5432 -d postgres:9.2 + until pg_isready -d $(PG_HOST); do sleep 1; echo "Waiting for postgres"; done + $(TEST_ENV) alembic upgrade head + $(TEST_ENV) py.test --timeout=7200 --verbose --show-count ./ --color=no \ + --ignore=endpoints/appr/test/ -x + docker rm -f postgres-testrunner-postgres || true WEBPACK := node_modules/.bin/webpack $(WEBPACK): package.json