diff --git a/Makefile b/Makefile index 19020257206b2d8484c96434b059bc2ad41cbaf8..ba608333ff68b97571ce7ab8eb343c68006ee55e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ APP_LIST ?= core grady util DB_NAME = postgres -.PHONY: run install migrations-check isort isort-check test +.ONESHELL: + +.PHONY: run install migrations-check isort isort-check test teste2e run: python manage.py runserver 0.0.0.0:8000 @@ -21,14 +23,19 @@ migrate: test: pytest --ds=grady.settings core/tests -teste2e: - cd frontend && yarn build && cp dist/index.html ../core/templates && cd .. && python util/format_index.py && python manage.py collectstatic --no-input && HEADLESS_TESTS=$(headless) pytest --ds=grady.settings $(path); git checkout core/templates/index.html - -teste2e-nc: - cp frontend/dist/index.html ./core/templates && python util/format_index.py && python manage.py collectstatic --no-input && HEADLESS_TESTS=$(headless) pytest --ds=grady.settings $(path); git checkout core/templates/index.html +frontend/dist: $(shell find frontend/src -type f) + yarn --cwd frontend build +teste2e: frontend/dist + set -e + cp frontend/dist/index.html core/templates + trap "git checkout core/templates/index.html" EXIT + python util/format_index.py + python manage.py collectstatic --no-input + HEADLESS_TESTS=$(headless) pytest --ds=grady.settings $(path) coverage: + set -e DJANGO_SETTINGS_MODULE=grady.settings pytest --cov coverage html