Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify tests, run in same backend service #152

Merged
merged 1 commit into from
Apr 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
COMPOSE_PATH_SEPARATOR=:
COMPOSE_FILE=docker-compose.test.yml:docker-compose.shared.admin.yml:docker-compose.shared.base-images.yml:docker-compose.shared.depends.yml:docker-compose.shared.env.yml:docker-compose.dev.build.yml:docker-compose.dev.command.yml:docker-compose.dev.env.yml:docker-compose.dev.labels.yml:docker-compose.dev.networks.yml:docker-compose.dev.ports.yml:docker-compose.dev.volumes.yml
COMPOSE_FILE=docker-compose.shared.admin.yml:docker-compose.shared.base-images.yml:docker-compose.shared.depends.yml:docker-compose.shared.env.yml:docker-compose.dev.build.yml:docker-compose.dev.command.yml:docker-compose.dev.env.yml:docker-compose.dev.labels.yml:docker-compose.dev.networks.yml:docker-compose.dev.ports.yml:docker-compose.dev.volumes.yml

DOMAIN=localhost
# DOMAIN=local.dockertoolbox.tiangolo.com
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/backend/app/tests-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ set -e

python /app/app/tests_pre_start.py

pytest $* /app/app/tests/
pytest "$@" /app/app/tests/
34 changes: 0 additions & 34 deletions {{cookiecutter.project_slug}}/backend/tests.dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions {{cookiecutter.project_slug}}/docker-compose.dev.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ services:
dockerfile: celeryworker.dockerfile
args:
env: dev
backend-tests:
build:
context: ./backend
dockerfile: tests.dockerfile
args:
env: dev
frontend:
build:
context: ./frontend
Expand Down
4 changes: 0 additions & 4 deletions {{cookiecutter.project_slug}}/docker-compose.dev.env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@ services:
- RUN=celery worker -A app.worker -l info -Q main-queue -c 1
- JUPYTER=jupyter lab --ip=0.0.0.0 --allow-root --NotebookApp.custom_display_url=http://127.0.0.1:8888
- SERVER_HOST=http://${DOMAIN}
backend-tests:
environment:
- JUPYTER=jupyter lab --ip=0.0.0.0 --allow-root --NotebookApp.custom_display_url=http://127.0.0.1:8888
- SERVER_HOST=http://${DOMAIN}
3 changes: 0 additions & 3 deletions {{cookiecutter.project_slug}}/docker-compose.dev.volumes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,3 @@ services:
celeryworker:
volumes:
- ./backend/app:/app
backend-tests:
volumes:
- ./backend/app:/app
4 changes: 4 additions & 0 deletions {{cookiecutter.project_slug}}/docker-compose.shared.env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ services:
environment:
- SERVER_NAME=${DOMAIN}
- SERVER_HOST=https://${DOMAIN}
# Allow explicit env var override for tests
- SMTP_HOST=${SMTP_HOST}
celeryworker:
env_file:
- .env
environment:
- SERVER_NAME=${DOMAIN}
- SERVER_HOST=https://${DOMAIN}
# Allow explicit env var override for tests
- SMTP_HOST=${SMTP_HOST}
16 changes: 0 additions & 16 deletions {{cookiecutter.project_slug}}/docker-compose.test.yml

This file was deleted.

1 change: 0 additions & 1 deletion {{cookiecutter.project_slug}}/scripts/test-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ if [ $(uname -s) = "Linux" ]; then
fi

docker-compose \
-f docker-compose.test.yml \
-f docker-compose.shared.admin.yml \
-f docker-compose.shared.base-images.yml \
-f docker-compose.shared.depends.yml \
Expand Down
5 changes: 2 additions & 3 deletions {{cookiecutter.project_slug}}/scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
# Exit in case of error
set -e

DOMAIN=backend \
DOMAIN=backend SMTP_HOST="" \
docker-compose \
-f docker-compose.shared.base-images.yml \
-f docker-compose.shared.env.yml \
-f docker-compose.shared.depends.yml \
-f docker-compose.deploy.build.yml \
-f docker-compose.test.yml \
config > docker-stack.yml

docker-compose -f docker-stack.yml build
docker-compose -f docker-stack.yml down -v --remove-orphans # Remove possibly previous broken stacks left hanging after an error
docker-compose -f docker-stack.yml up -d
docker-compose -f docker-stack.yml exec -T backend-tests /tests-start.sh "$@"
docker-compose -f docker-stack.yml exec -T backend bash /app/tests-start.sh "$@"
docker-compose -f docker-stack.yml down -v --remove-orphans