-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (53 loc) · 1.91 KB
/
Makefile
File metadata and controls
62 lines (53 loc) · 1.91 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
.PHONY: help test test-unit test-integration test-all services-start services-stop services-status clean
help:
@echo "Genro Storage - Test Commands"
@echo "=============================="
@echo ""
@echo "Test commands:"
@echo " make test - Run all tests with services auto-start"
@echo " make test-unit - Run only unit tests (no Docker needed)"
@echo " make test-integration - Run only integration tests (requires Docker)"
@echo " make test-all - Run all tests with coverage report"
@echo ""
@echo "Service management:"
@echo " make services-start - Start all test services (Docker)"
@echo " make services-stop - Stop all test services"
@echo " make services-status - Show services status"
@echo ""
@echo "Cleanup:"
@echo " make clean - Stop services and clean up"
# Start Docker services for integration tests
services-start:
@echo "Starting test services..."
@bash scripts/start_test_services.sh
# Stop Docker services
services-stop:
@echo "Stopping test services..."
@bash scripts/stop_test_services.sh
# Show services status
services-status:
@docker-compose ps
# Run all tests (auto-starts services if needed)
test: services-start
@echo "Running all tests..."
@pytest tests/ -v
# Run only unit tests (no Docker required)
test-unit:
@echo "Running unit tests only..."
@pytest tests/ -v -m "not integration"
# Run only integration tests (requires Docker)
test-integration: services-start
@echo "Running integration tests..."
@pytest tests/ -v -m integration
# Run all tests with coverage
test-all: services-start
@echo "Running all tests with coverage..."
@pytest tests/ -v --cov=genro_storage --cov-report=html --cov-report=term
# Clean up everything
clean: services-stop
@echo "Cleaning up..."
@rm -rf .pytest_cache
@rm -rf htmlcov
@rm -rf .coverage
@find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
@echo "Cleanup complete!"