|
1 | | -.PHONY: help go-test rust-test go-run rust-run go-lint rust-lint go-fmt rust-fmt test-all lint-all fmt-all pre-push |
| 1 | +.PHONY: help go-test rust-test go-run rust-run go-lint rust-lint go-fmt rust-fmt frontend-test frontend-run frontend-docker-build frontend-docker-run frontend-docker-down frontend-setup test-all lint-all fmt-all pre-push |
2 | 2 |
|
3 | 3 | # Default target |
4 | 4 | help: |
|
11 | 11 | @echo " make rust-lint - Run Rust linter and formatter check" |
12 | 12 | @echo " make go-fmt - Format Go code" |
13 | 13 | @echo " make rust-fmt - Format Rust code" |
14 | | - @echo " make test-all - Run all tests (Go + Rust)" |
| 14 | + @echo " make frontend-test - Run Python/Frontend tests" |
| 15 | + @echo " make frontend-run - Run Frontend server (without Docker)" |
| 16 | + @echo " make frontend-setup - Setup Python virtual environment and install dependencies" |
| 17 | + @echo " make frontend-docker-build - Build Frontend Docker image" |
| 18 | + @echo " make frontend-docker-run - Run Frontend using Docker Compose" |
| 19 | + @echo " make frontend-docker-down - Stop Frontend Docker containers" |
| 20 | + @echo " make test-all - Run all tests (Go + Rust + Frontend)" |
15 | 21 | @echo " make lint-all - Run all linters (Go + Rust)" |
16 | 22 | @echo " make fmt-all - Format all code (Go + Rust)" |
17 | 23 | @echo " make pre-push - Run fmt, lint, and test (use before pushing)" |
@@ -70,8 +76,47 @@ rust-fmt-check: |
70 | 76 | @echo "Checking Rust formatting..." |
71 | 77 | cd src/Backend/opti-sql-rs && cargo fmt --check |
72 | 78 |
|
| 79 | +# Frontend targets |
| 80 | +frontend-setup: |
| 81 | + @echo "Setting up Python virtual environment..." |
| 82 | + rm -rf src/FrontEnd/venv |
| 83 | + cd src/FrontEnd && python3.12 -m venv --without-pip venv |
| 84 | + @echo "Installing pip..." |
| 85 | + cd src/FrontEnd && . venv/bin/activate && curl -sS https://bootstrap.pypa.io/get-pip.py | python |
| 86 | + @echo "Installing dependencies..." |
| 87 | + cd src/FrontEnd && . venv/bin/activate && pip install --upgrade pip && pip install -r requirements.txt |
| 88 | + @echo "Frontend setup completed! Activate with: cd src/FrontEnd && source venv/bin/activate" |
| 89 | + |
| 90 | +frontend-test: frontend-setup |
| 91 | + @echo "Running Frontend/Python tests..." |
| 92 | + cd src/FrontEnd && . venv/bin/activate && pytest -m "not integration" |
| 93 | + |
| 94 | +frontend-run: |
| 95 | + @echo "Running Frontend server..." |
| 96 | + cd src/FrontEnd && . venv/bin/activate && python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8005 |
| 97 | + |
| 98 | +frontend-docker-build: |
| 99 | + @echo "Building Frontend Docker image..." |
| 100 | + @if [ ! -f src/FrontEnd/.env ]; then \ |
| 101 | + echo "Creating .env file from root .env..."; \ |
| 102 | + cp .env src/FrontEnd/.env; \ |
| 103 | + fi |
| 104 | + cd src/FrontEnd && docker compose build |
| 105 | + |
| 106 | +frontend-docker-run: |
| 107 | + @echo "Running Frontend with Docker Compose..." |
| 108 | + @if [ ! -f src/FrontEnd/.env ]; then \ |
| 109 | + echo "Creating .env file from root .env..."; \ |
| 110 | + cp .env src/FrontEnd/.env; \ |
| 111 | + fi |
| 112 | + cd src/FrontEnd && docker compose up -d |
| 113 | + |
| 114 | +frontend-docker-down: |
| 115 | + @echo "Stopping Frontend Docker containers..." |
| 116 | + cd src/FrontEnd && docker compose down |
| 117 | + |
73 | 118 | # Combined targets |
74 | | -test-all: go-test rust-test |
| 119 | +test-all: go-test rust-test frontend-test |
75 | 120 | @echo "All tests completed!" |
76 | 121 |
|
77 | 122 | lint-all: go-lint rust-lint |
|
0 commit comments