Skip to content

Commit

Permalink
Reduce output during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maciej-gol committed May 6, 2020
1 parent e4416c1 commit 6a0236d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
28 changes: 21 additions & 7 deletions __app_run_tests
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
#!/bin/bash -x
apt update
apt install -y libpq-dev iputils-ping
#!/bin/bash -ex
function run_silently() {
set +ex
$@ >output.txt 2>&1
EXIT_CODE=$?
set -e

pip install -r /app/requirements.txt django ${TENANT_SCHEMAS}
pip install -e .
if [ $EXIT_CODE != 0 ]; then
echo "Non-zero exit code: $EXIT_CODE"
cat output.txt
exit $EXIT_CODE
fi
set -x
}

run_silently apt update
run_silently apt install -y libpq-dev tree

run_silently pip install -r /app/requirements.txt django ${TENANT_SCHEMAS}
run_silently pip install -e .

cd test_app
export DJANGO_SETTINGS_MODULE=test_app.settings

./manage.py makemigrations
rm -rf ./test_app/shared/migrations
run_silently ./manage.py makemigrations
celery worker -A tenant_schemas_celery.test_app:app -l INFO &
pytest ../tenant_schemas_celery

4 changes: 4 additions & 0 deletions test-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ services:
- POSTGRES_PASSWORD=qwe123
- POSTGRES_USER=tenant_celery
- POSTGRES_DB=tenant_celery
logging:
driver: "none"

rabbitmq:
image: rabbitmq
logging:
driver: "none"

app:
image: "python:${PYTHON_VERSION:-3.6}-slim"
Expand Down
Empty file.

0 comments on commit 6a0236d

Please sign in to comment.