-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMakefile
More file actions
96 lines (82 loc) · 2.64 KB
/
Copy pathMakefile
File metadata and controls
96 lines (82 loc) · 2.64 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
MCP_SERVER_REQUEST_TIMEOUT:= 99999999999
MCP_REQUEST_MAX_TOTAL_TIMEOUT:= 99999999999
DOCKER_TEST_IMAGE:= openroad-mcp-test
ORFS_VERSION:= 26Q1-534-g510137693
UV_VERSION:= 0.10.9
IMAGE_NAME:= ghcr.io/the-openroad-project/openroad-mcp
.PHONY: sync
sync:
@uv sync --all-extras --inexact
.PHONY: format
format:
@uv run ruff format .
@uv run ruff check . --fix
.PHONY: check
check:
@uv run ruff check
@uv run mypy .
@uv run pre-commit run --all-files
# Test targets
.PHONY: test
test:
@echo "Running core tests..."
@uv run pytest --ignore=tests/interactive --ignore=tests/performance --ignore=tests/integration
# Build Docker test image
.PHONY: docker-test-build
docker-test-build:
@docker build -f Dockerfile --target test \
--build-arg ORFS_VERSION=$(ORFS_VERSION) \
--build-arg UV_VERSION=$(UV_VERSION) \
-t $(DOCKER_TEST_IMAGE) .
# Build production Docker image
.PHONY: build
build:
@docker build --target runtime \
--build-arg ORFS_VERSION=$(ORFS_VERSION) \
--build-arg UV_VERSION=$(UV_VERSION) \
-t $(IMAGE_NAME):$(ORFS_VERSION) .
.PHONY: test-interactive
test-interactive: docker-test-build
@echo "Running interactive tests..."
@docker run --rm --init $(DOCKER_TEST_IMAGE) uv run pytest tests/interactive
.PHONY: test-integration
test-integration: docker-test-build
@echo "Running integration tests for timing workflows..."
@docker run --rm --init $(DOCKER_TEST_IMAGE) uv run pytest tests/integration
.PHONY: test-tools
test-tools:
@echo "Running MCP tools tests..."
@uv run pytest tests/tools/
.PHONY: test-performance
test-performance: docker-test-build
@echo "Running performance tests (benchmarks, memory, stability)..."
@docker run --rm --init $(DOCKER_TEST_IMAGE) uv run pytest tests/performance/
.PHONY: test-coverage
test-coverage: docker-test-build
@echo "Running tests with coverage analysis..."
@docker run --rm --init -v $(PWD):/output $(DOCKER_TEST_IMAGE) sh -c "\
uv run pytest --ignore=tests/performance \
--cov=src/openroad_mcp \
--cov-report=xml \
--cov-report=html \
--cov-report=term-missing \
--junit-xml=junit.xml && \
cp coverage.xml /output/ && \
cp junit.xml /output/ && \
cp -r htmlcov /output/ 2>/dev/null || true"
# MCP
.PHONY: inspect
inspect:
@MCP_SERVER_REQUEST_TIMEOUT=$(MCP_SERVER_REQUEST_TIMEOUT) \
MCP_REQUEST_MAX_TOTAL_TIMEOUT=$(MCP_REQUEST_MAX_TOTAL_TIMEOUT) \
npx @modelcontextprotocol/inspector@0.19.0 uv run openroad-mcp
.PHONY: test-all
test-all:
@echo "Running all tests (core + interactive + tools + integration)..."
@$(MAKE) test
@$(MAKE) test-interactive
@$(MAKE) test-tools
@$(MAKE) test-integration
# Print any Makefile variable: make print-IMAGE_NAME
print-%:
@echo $($*)