Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9313527
Makefile.local
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Subscribers
None
Makefile.local
View Options
TEST_DIRS := ./swh/web/tests
TESTFLAGS = --hypothesis-profile=swh-web-fast
TESTFULL_FLAGS = --hypothesis-profile=swh-web
YARN ?= yarn
SETTINGS_TEST ?= swh.web.settings.tests
SETTINGS_DEV ?= swh.web.settings.development
SETTINGS_PROD = swh.web.settings.production
yarn-install: package.json
$(YARN) install
.PHONY: build-webpack-dev
build-webpack-dev: yarn-install
$(YARN) build-dev
.PHONY: build-webpack-test
build-webpack-test: yarn-install
$(YARN) build-test
.PHONY: build-webpack-dev-no-verbose
build-webpack-dev-no-verbose: yarn-install
$(YARN) build-dev >/dev/null
.PHONY: build-webpack-prod
build-webpack-prod: yarn-install
$(YARN) build
.PHONY: run-migrations
run-migrations:
python3 swh/web/manage.py migrate --settings=$(SETTINGS_DEV) -v0 2>/dev/null
.PHONY: run-migrations-prod
run-migrations-prod:
django-admin migrate --settings=$(SETTINGS_PROD) -v0 2>/dev/null
.PHONY: run-migrations-test
run-migrations-test:
rm -f swh/web/settings/testdb.sqlite3
django-admin migrate --settings=$(SETTINGS_TEST) -v0 2>/dev/null
add-users-test:
cat swh/web/tests/create_test_admin.py | django-admin shell --settings=$(SETTINGS_TEST)
cat swh/web/tests/create_test_users.py | django-admin shell --settings=$(SETTINGS_TEST)
add-users-dev:
cat swh/web/tests/create_test_admin.py | django-admin shell --settings=$(SETTINGS_DEV)
cat swh/web/tests/create_test_users.py | django-admin shell --settings=$(SETTINGS_DEV)
add-users-prod:
cat swh/web/tests/create_test_admin.py | django-admin shell --settings=$(SETTINGS_PROD)
cat swh/web/tests/create_test_users.py | django-admin shell --settings=$(SETTINGS_PROD)
.PHONY: clear-memcached
clear-memcached:
echo "flush_all" | nc -q 2 localhost 11211 2>/dev/null
run-django-webpack-devserver: run-migrations add-users-dev yarn-install
bash -c "trap 'trap - SIGINT SIGTERM ERR; kill %1' SIGINT SIGTERM ERR; $(YARN) start-dev & sleep 10 && cd swh/web && python3 manage.py runserver --nostatic --settings=$(SETTINGS_DEV)"
run-django-webpack-dev: build-webpack-dev run-migrations add-users-dev
python3 swh/web/manage.py runserver --nostatic --settings=$(SETTINGS_DEV)
run-django-webpack-prod: build-webpack-prod run-migrations-prod add-users-prod clear-memcached
python3 swh/web/manage.py runserver --nostatic --settings=$(SETTINGS_PROD)
run-django-server-dev: run-migrations add-users-dev
python3 swh/web/manage.py runserver --nostatic --settings=$(SETTINGS_DEV)
run-django-server-prod: run-migrations-prod add-users-prod clear-memcached
python3 swh/web/manage.py runserver --nostatic --settings=$(SETTINGS_PROD)
run-gunicorn-server: run-migrations-prod add-users-prod clear-memcached
DJANGO_SETTINGS_MODULE=$(SETTINGS_PROD) \
gunicorn --bind 127.0.0.1:5004 \
--threads 2 \
--workers 2 'django.core.wsgi:get_wsgi_application()'
run-django-webpack-memory-storages: build-webpack-dev run-migrations add-users-test
python3 swh/web/manage.py runserver --nostatic --settings=$(SETTINGS_TEST)
test-full:
$(TEST) $(TESTFULL_FLAGS) $(TEST_DIRS)
.PHONY: test-frontend-cmd
test-frontend-cmd: build-webpack-test run-migrations-test add-users-test
python3 swh/web/manage.py runserver --nostatic --settings=$(SETTINGS_TEST) & sleep 10 && $(YARN) run cypress run --config numTestsKeptInMemory=0 ; pkill -P $$! ; $(YARN) run mochawesome
test-frontend: export CYPRESS_SKIP_SLOW_TESTS=1
test-frontend: test-frontend-cmd
test-frontend-full: export CYPRESS_SKIP_SLOW_TESTS=0
test-frontend-full: test-frontend-cmd
.PHONY: test-frontend-ui-cmd
test-frontend-ui-cmd: build-webpack-test run-migrations-test add-users-test
bash -c "trap 'trap - SIGINT SIGTERM ERR EXIT; jobs -p | head -1 | xargs pkill -P' SIGINT SIGTERM ERR EXIT; python3 swh/web/manage.py runserver --nostatic --settings=$(SETTINGS_TEST) & sleep 10 && $(YARN) run cypress open"
test-frontend-ui: export CYPRESS_SKIP_SLOW_TESTS=1
test-frontend-ui: test-frontend-ui-cmd
test-frontend-full-ui: export CYPRESS_SKIP_SLOW_TESTS=0
test-frontend-full-ui: test-frontend-ui-cmd
# Override default rule to make sure DJANGO env var is properly set. It
# *should* work without any override thanks to the mypy django-stubs plugin,
# but it currently doesn't; see
# https://github.com/typeddjango/django-stubs/issues/166
check-mypy:
DJANGO_SETTINGS_MODULE=$(SETTINGS_DEV) $(MYPY) $(MYPYFLAGS) swh
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 3, 11:44 AM (5 d, 8 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3264995
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment