Files
mizan/Makefile
Ryth Azhur eee352d908 Move desktop and e2e into examples/ directory
- desktop/ → examples/django-react-desktop-app/
- e2e/ → examples/django-react-site/
- example/ → examples/django-react-site/backend/
- Update Dockerfile.test, Makefile, playwright config, and
  django.config.mjs path references

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 15:41:31 -04:00

47 lines
2.2 KiB
Makefile

.PHONY: install test test-django test-react test-integration docker-up docker-down clean
# ─── Setup ───────────────────────────────────────────────────────────────────
install:
cd django && pip install -e ".[dev,channels]"
cd react && npm install
# ─── Unit Tests ──────────────────────────────────────────────────────────────
test: test-django test-react
test-django:
cd django && pytest
test-react:
cd react && npm test
# ─── Integration Tests ──────────────────────────────────────────────────────
test-integration: docker-up
@echo "Waiting for backend..."
@timeout 30 sh -c 'until curl -sf http://localhost:8000/api/mizan/session/ > /dev/null 2>&1; do sleep 1; done'
cd react && npm run test:integration
@$(MAKE) docker-down
# ─── Docker ──────────────────────────────────────────────────────────────────
docker-up:
docker compose -f docker-compose.test.yml up -d --build
@echo "Backend starting at http://localhost:8000"
docker-down:
docker compose -f docker-compose.test.yml down
# ─── All ─────────────────────────────────────────────────────────────────────
test-all: test test-integration
# ─── Cleanup ─────────────────────────────────────────────────────────────────
clean:
docker compose -f docker-compose.test.yml down -v --remove-orphans 2>/dev/null || true
rm -rf django/src/mizan.egg-info django/dist django/build
rm -rf react/dist react/node_modules
rm -f examples/django-react-site/backend/db.sqlite3