Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
116 lines (77 loc) · 5.57 KB
/
Copy pathMakefile
File metadata and controls
116 lines (77 loc) · 5.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
SHELL := /bin/bash
.SHELLFLAGS := -c
NVM_NODE_BIN := $(HOME)/.nvm/versions/node/$(shell ls $(HOME)/.nvm/versions/node 2>/dev/null | sort -V | tail -1)/bin
export PATH := $(NVM_NODE_BIN):$(PATH)
.PHONY: help install backend-install frontend-install test test-frontend lint lint-backend typecheck-backend build ci
.PHONY: test-db-up test-db-down test-db-logs test-postgres test-postgres-profiler test-postgres-api test-postgres-sampler
.PHONY: test-mysql test-mysql-profiler test-mysql-api test-mysql-sampler
.PHONY: test-mongodb test-mongodb-profiler test-mongodb-api test-mongodb-sampler
.PHONY: test-iceberg-up test-iceberg-down test-iceberg-logs test-iceberg
help: ## Show available targets
@grep -E '^[a-zA-Z_-]+:.*##' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*##"}; {printf " %-20s %s\n", $$1, $$2}'
# -- Install targets (setup / CI) --
backend-install: ## Install backend dependencies
cd backend && uv sync --extra connectors
frontend-install: ## Install frontend dependencies
cd frontend && npm ci
install: backend-install frontend-install ## Install all dependencies
# -- Check targets (day-to-day) --
test: ## Run backend tests
cd backend && uv run pytest -v
test-frontend: ## Run frontend unit tests
cd frontend && npm run test:unit
lint-backend: ## Lint the backend (ruff)
cd backend && uv run ruff check app tests && uv run ruff format --check app tests
typecheck-backend: ## Type-check backend contracts and typed generation modules
cd backend && uv run mypy app tests
lint: lint-backend ## Lint backend and frontend
cd frontend && npm run lint
build: ## Build the frontend
cd frontend && npm run build
test\:e2e: ## Run browser E2E tests (Playwright)
cd frontend && npx playwright test
# -- Connector integration test databases (Docker) --
TEST_POSTGRES_URL ?= postgresql://chitral:chitral@localhost:5433/chitral_test
TEST_MYSQL_URL ?= mysql://chitral:chitral@localhost:3307/chitral_test
TEST_MONGODB_URL ?= mongodb://chitral:chitral@localhost:27018/?authSource=admin
test-db-up: ## Start Postgres + MySQL + MongoDB test containers
docker compose -f docker-compose.test.yml up -d --wait
test-db-down: ## Stop and remove test containers
docker compose -f docker-compose.test.yml down
test-db-logs: ## Tail test container logs
docker compose -f docker-compose.test.yml logs -f
test-postgres: test-db-up ## Run Postgres connector integration tests
cd backend && TEST_POSTGRES_URL="$(TEST_POSTGRES_URL)" uv run pytest tests/connectors/test_postgres_client.py -v -m integration
test-postgres-profiler: test-db-up ## Run Postgres profiler integration tests
cd backend && TEST_POSTGRES_URL="$(TEST_POSTGRES_URL)" uv run pytest tests/connectors/test_postgres_profiler.py -v -m integration
test-postgres-api: test-db-up ## Run Postgres API route integration tests
cd backend && TEST_POSTGRES_URL="$(TEST_POSTGRES_URL)" uv run pytest tests/connectors/test_postgres_api.py -v -m integration
test-postgres-sampler: test-db-up ## Run Postgres sampler integration tests
cd backend && TEST_POSTGRES_URL="$(TEST_POSTGRES_URL)" uv run pytest tests/connectors/test_postgres_sampler.py -v -m integration
test-mysql: test-db-up ## Run MySQL connector integration tests
cd backend && TEST_MYSQL_URL="$(TEST_MYSQL_URL)" uv run pytest tests/connectors/test_mysql_client.py -v -m integration
test-mysql-profiler: test-db-up ## Run MySQL profiler integration tests
cd backend && TEST_MYSQL_URL="$(TEST_MYSQL_URL)" uv run pytest tests/connectors/test_mysql_profiler.py -v -m integration
test-mysql-api: test-db-up ## Run MySQL API route integration tests
cd backend && TEST_MYSQL_URL="$(TEST_MYSQL_URL)" uv run pytest tests/connectors/test_mysql_api.py -v -m integration
test-mysql-sampler: test-db-up ## Run MySQL sampler integration tests
cd backend && TEST_MYSQL_URL="$(TEST_MYSQL_URL)" uv run pytest tests/connectors/test_mysql_sampler.py -v -m integration
test-mongodb: test-db-up ## Run MongoDB connector integration tests
cd backend && TEST_MONGODB_URL="$(TEST_MONGODB_URL)" uv run pytest tests/connectors/test_mongodb_client.py -v -m integration
test-mongodb-profiler: test-db-up ## Run MongoDB profiler integration tests
cd backend && TEST_MONGODB_URL="$(TEST_MONGODB_URL)" uv run pytest tests/connectors/test_mongodb_profiler.py -v -m integration
test-mongodb-api: test-db-up ## Run MongoDB API route integration tests
cd backend && TEST_MONGODB_URL="$(TEST_MONGODB_URL)" uv run pytest tests/connectors/test_mongodb_api.py -v -m integration
test-mongodb-sampler: test-db-up ## Run MongoDB sampler integration tests
cd backend && TEST_MONGODB_URL="$(TEST_MONGODB_URL)" uv run pytest tests/connectors/test_mongodb_sampler.py -v -m integration
# -- Iceberg REST + S3 integration fixture --
test-iceberg-up: ## Start the isolated Iceberg REST + S3-compatible fixture
docker compose -p chitral-iceberg-test -f docker-compose.iceberg-test.yml up -d --wait --pull never
test-iceberg-down: ## Stop and remove the isolated Iceberg fixture
docker compose -p chitral-iceberg-test -f docker-compose.iceberg-test.yml down -v
test-iceberg-logs: ## Tail the isolated Iceberg fixture logs
docker compose -p chitral-iceberg-test -f docker-compose.iceberg-test.yml logs -f
test-iceberg: test-iceberg-up ## Run Iceberg REST/S3 integration tests
cd backend && AWS_ACCESS_KEY_ID=chitral_test AWS_SECRET_ACCESS_KEY=chitral_test_secret AWS_REGION=us-east-1 TEST_ICEBERG_REST_URI=http://127.0.0.1:18181 TEST_ICEBERG_S3_ENDPOINT=http://127.0.0.1:19000 uv run pytest tests/generation/output/test_iceberg_integration.py -v -m integration
# -- CI target (clean install + all checks) --
ci: install test test-frontend lint typecheck-backend build ## Run full CI pipeline