This repository was archived by the owner on Feb 5, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 157
Expand file tree
/
Copy pathMakefile.test
More file actions
73 lines (56 loc) · 2.15 KB
/
Makefile.test
File metadata and controls
73 lines (56 loc) · 2.15 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
# AnotherFasterRunner Test Commands Makefile
# Variables
POETRY_RUN = poetry run
PYTHON = $(POETRY_RUN) python
PYTEST = $(POETRY_RUN) pytest
RUFF = $(POETRY_RUN) ruff
# Colors for output
GREEN = \033[0;32m
YELLOW = \033[0;33m
RED = \033[0;31m
NC = \033[0m # No Color
# Testing Commands
test: ## Run all tests with coverage
@echo "$(GREEN)Running all tests...$(NC)"
$(PYTEST)
test-fast: ## Run tests without coverage (faster)
@echo "$(GREEN)Running fast tests...$(NC)"
$(PYTEST) --no-cov
test-unit: ## Run unit tests only
@echo "$(GREEN)Running unit tests...$(NC)"
$(PYTEST) -m unit
test-integration: ## Run integration tests only
@echo "$(GREEN)Running integration tests...$(NC)"
$(PYTEST) -m integration
test-coverage: ## Run tests with detailed coverage report
@echo "$(GREEN)Running tests with coverage...$(NC)"
$(PYTEST) --cov-report=html --cov-report=term
test-watch: ## Run tests in watch mode
@echo "$(GREEN)Running tests in watch mode...$(NC)"
$(PYTEST) -f
test-specific: ## Run specific test file (usage: make test-specific FILE=test_models.py)
@echo "$(GREEN)Running specific test: $(FILE)$(NC)"
$(PYTEST) tests/$(FILE)
# Code Quality Commands
lint: ## Run linting with ruff
@echo "$(GREEN)Running ruff linting...$(NC)"
$(RUFF) check .
lint-fix: ## Fix linting issues automatically
@echo "$(GREEN)Fixing linting issues...$(NC)"
$(RUFF) check --fix .
format: ## Format code with ruff
@echo "$(GREEN)Formatting code...$(NC)"
$(RUFF) format .
quality: lint test-coverage ## Run all quality checks (lint + tests with coverage)
# Setup Commands
install-test-deps: ## Install testing dependencies
@echo "$(GREEN)Installing test dependencies...$(NC)"
poetry add --group dev pytest-cov pytest-mock coverage
setup-test: ## Setup testing environment
@echo "$(GREEN)Setting up testing environment...$(NC)"
poetry install --with dev
# CI Commands
ci-test: ## Run tests for CI environment
@echo "$(GREEN)Running CI tests...$(NC)"
$(PYTEST) --cov-report=xml --cov-report=term --junitxml=test-results.xml
.PHONY: test test-fast test-unit test-integration test-coverage test-watch test-specific lint lint-fix format quality install-test-deps setup-test ci-test