Skip to content

Commit 4fd4b35

Browse files
authored
Merge pull request #20 from Rich-T-kid/pre-release
Pre release
2 parents 1883c90 + 4e2eeb7 commit 4fd4b35

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+10612
-108
lines changed

.env

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Server Configuration
2+
PORT=8000
3+
HOST=0.0.0.0
4+
5+
# Logging Configuration
6+
# Options: prod, info, debug
7+
LOGGING_MODE=info
8+
9+
# Testing Configuration
10+
TEST_SERVER_URL=http://localhost:8000

.env.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Server Configuration
2+
PORT=8000
3+
HOST=0.0.0.0
4+
5+
# Logging Configuration
6+
# Options: prod, info, debug
7+
LOGGING_MODE=info
8+
9+
# Testing Configuration
10+
TEST_SERVER_URL=http://localhost:8000
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Frontend Tests
2+
3+
on:
4+
push:
5+
branches: [ main, pre-release ]
6+
paths:
7+
- 'src/FrontEnd/**'
8+
- '.github/workflows/frontend-test.yml'
9+
pull_request:
10+
branches: [ main, pre-release ]
11+
paths:
12+
- 'src/FrontEnd/**'
13+
- '.github/workflows/frontend-test.yml'
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Python 3.12
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.12'
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -r src/FrontEnd/requirements.txt
31+
32+
- name: Run tests
33+
run: |
34+
cd src/FrontEnd
35+
pytest -v -m "not integration"

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,11 @@ src/Backend/test_data/json
102102

103103
# Allow s3_source directory
104104
!src/Backend/test_data/s3_source/
105-
!src/Backend/test_data/s3_source/**
105+
!src/Backend/test_data/s3_source/**
106+
107+
# Allow a specific CSV dataset that we want tracked despite the general csv ignores
108+
!src/Backend/test_data/csv/
109+
!src/Backend/test_data/csv/Mental_Health_and_Social_Media_Balance_Dataset.csv
110+
# allow parquet file
111+
!src/Backend/test_data/parquet/
112+
!src/Backend/test_data/parquet/capitals_clean.parquet

CONTRIBUTING.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,26 @@ We use a Makefile to simplify common development tasks. All commands should be r
1919
```bash
2020
make go-test-coverage
2121
```
22+
- Run test with html coverage
23+
```bash
24+
go test -count=1 ./... -coverprofile=coverage.out
25+
go tool cover -html=coverage.out
26+
```
27+
2228

2329
### Rust Tests
2430
- Run all tests
2531
```bash
2632
make rust-test
2733
```
2834

29-
### Run All Tests (Go + Rust)
35+
### Frontend Tests
36+
- Run all tests
37+
```bash
38+
make frontend-test
39+
```
40+
41+
### Run All Tests (Go + Rust + Frontend)
3042
- Run tests for both backends
3143
```bash
3244
make test-all
@@ -110,6 +122,11 @@ make go-run
110122
make rust-run
111123
```
112124
125+
### Build and Run Frontend
126+
```bash
127+
make frontend-run
128+
```
129+
113130
### Run All Tests
114131
```bash
115132
make test-all
@@ -119,6 +136,7 @@ Or run individually:
119136
```bash
120137
make go-test
121138
make rust-test
139+
make frontend-test
122140
```
123141
124142
### Run Linters

Makefile

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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
22

33
# Default target
44
help:
@@ -11,7 +11,13 @@ help:
1111
@echo " make rust-lint - Run Rust linter and formatter check"
1212
@echo " make go-fmt - Format Go code"
1313
@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)"
1521
@echo " make lint-all - Run all linters (Go + Rust)"
1622
@echo " make fmt-all - Format all code (Go + Rust)"
1723
@echo " make pre-push - Run fmt, lint, and test (use before pushing)"
@@ -29,7 +35,6 @@ go-test-coverage:
2935
@echo "Running Go tests with coverage..."
3036
cd src/Backend/opti-sql-go && go test -v -coverprofile=coverage.out ./...
3137
cd src/Backend/opti-sql-go && go tool cover -func=coverage.out
32-
3338
go-run:
3439
@echo "Running Go application..."
3540
cd src/Backend/opti-sql-go && go run main.go
@@ -71,8 +76,47 @@ rust-fmt-check:
7176
@echo "Checking Rust formatting..."
7277
cd src/Backend/opti-sql-rs && cargo fmt --check
7378

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+
74118
# Combined targets
75-
test-all: go-test rust-test
119+
test-all: go-test rust-test frontend-test
76120
@echo "All tests completed!"
77121

78122
lint-all: go-lint rust-lint

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ A high-performance, in-memory query execution engine.
44

55
![Go Tests](https://github.com/Rich-T-kid/OptiSQL/actions/workflows/go-test.yml/badge.svg)
66
![Rust Tests](https://github.com/Rich-T-kid/OptiSQL/actions/workflows/rust-test.yml/badge.svg)
7+
![Frontend Tests](https://github.com/Rich-T-kid/OptiSQL/actions/workflows/frontend-test.yml/badge.svg)
8+
79

810
## Overview
911

@@ -20,6 +22,8 @@ OptiSQL is a custom in-memory query execution engine. The backend (physical exec
2022
- Go 1.24+
2123
- Rust 1.70+
2224
- C++23
25+
- Python 3.11+
26+
- Docker 29+
2327
- Make
2428
- git
2529

@@ -36,6 +40,13 @@ make go-run
3640
# Build and run Rust backend
3741
make rust-run
3842

43+
# Frontend setup and run
44+
make frontend-setup # Create venv and install dependencies
45+
make frontend-run # Run locally without Docker
46+
# OR with Docker
47+
make frontend-docker-build
48+
make frontend-docker-run
49+
3950
# Run all tests
4051
make test-all
4152

@@ -58,7 +69,10 @@ OptiSQL/
5869
│ │ └── opti-sql-rs/ # Rust implementation (Go clone for learning)
5970
│ │ ├── src/project/ # Core project logic
6071
│ │ └── src/ # Query processing modules
61-
│ └── FrontEnd/ # C++ frontend (in development)
72+
│ └── FrontEnd/ # Python/FastAPI HTTP server (C++ query processing in progress)
73+
│ ├── app/ # API endpoints and logic
74+
│ ├── tests/ # Frontend tests
75+
│ └── Dockerfile # Docker configuration
6276
├── .github/workflows/ # CI/CD pipelines
6377
├── Makefile # Development commands
6478
└── CONTRIBUTING.md # Contribution guidelines

0 commit comments

Comments
 (0)