-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
150 lines (123 loc) · 5.75 KB
/
Makefile
File metadata and controls
150 lines (123 loc) · 5.75 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# ══════════════════════════════════════════════════════════
# fixOS – Makefile
# Użycie: make <cel>
# ══════════════════════════════════════════════════════════
.PHONY: help install install-dev test test-unit test-e2e test-real \
lint format clean build docker-build docker-test \
docker-test-fedora docker-test-ubuntu docker-test-debian \
docker-test-arch docker-test-alpine docker-test-all \
config-init run-scan run-fix
# ── Domyślna komenda ──────────────────────────────────────
help:
@echo ""
@echo " fixOS – dostępne komendy Makefile"
@echo ""
@echo " Instalacja:"
@echo " make install instaluj paczkę (runtime)"
@echo " make install-dev instaluj z zależnościami dev"
@echo ""
@echo " Testy:"
@echo " make test wszystkie testy (unit + e2e mock)"
@echo " make test-unit tylko unit testy"
@echo " make test-e2e e2e testy z mock LLM"
@echo " make test-real e2e testy z prawdziwym API (wymaga .env)"
@echo " make test-cov testy + raport pokrycia"
@echo ""
@echo " Jakość kodu:"
@echo " make lint sprawdź kod (ruff)"
@echo " make format sformatuj kod (black)"
@echo ""
@echo " Docker:"
@echo " make docker-build zbuduj wszystkie obrazy testowe"
@echo " make docker-test-fedora testuj na Fedora"
@echo " make docker-test-ubuntu testuj na Ubuntu"
@echo " make docker-test-debian testuj na Debian"
@echo " make docker-test-arch testuj na Arch Linux"
@echo " make docker-test-alpine testuj na Alpine"
@echo " make docker-test-all testuj na wszystkich systemach"
@echo " make docker-audio testuj broken-audio w Docker"
@echo " make docker-thumb testuj broken-thumbnails w Docker"
@echo " make docker-full testuj broken-full w Docker"
@echo " make docker-e2e uruchom e2e testy w Docker"
@echo ""
@echo " Uruchomienie:"
@echo " make config-init utwórz plik .env"
@echo " make run-scan skanuj system (wszystkie moduły)"
@echo " make run-fix uruchom sesję naprawczą (HITL)"
@echo ""
@echo " Paczka:"
@echo " make build zbuduj dystrybucję PyPI"
@echo " make clean usuń pliki tymczasowe"
@echo ""
# ── Instalacja ────────────────────────────────────────────
install:
pip install -e .
install-dev:
pip install -e ".[dev]"
@echo "✅ Zainstalowano z zależnościami dev"
# ── Testy ─────────────────────────────────────────────────
test: test-unit test-e2e
test-unit:
@echo "🧪 Unit testy..."
pytest tests/unit/ -v --tb=short
test-e2e:
@echo "🧪 E2E testy (mock LLM)..."
pytest tests/e2e/ -v --tb=short -k "not real_llm"
test-real:
@echo "🧪 E2E testy (prawdziwe API – wymaga .env)..."
pytest tests/e2e/ -v --tb=short -k "real_llm"
test-cov:
pytest tests/ -v --cov=fixos --cov-report=term-missing --cov-report=html:htmlcov
@echo "📊 Raport pokrycia: htmlcov/index.html"
# ── Jakość kodu ───────────────────────────────────────────
lint:
ruff check fixos/ tests/ || true
format:
black fixos/ tests/
# ── Docker ───────────────────────────────────────────────
docker-build:
docker compose -f docker/docker-compose.yml build
docker-audio:
docker compose -f docker/docker-compose.yml run --rm broken-audio
docker-thumb:
docker compose -f docker/docker-compose.yml run --rm broken-thumbnails
docker-full:
docker compose -f docker/docker-compose.yml run --rm broken-full
docker-e2e:
docker compose -f docker/docker-compose.yml run --rm e2e-tests
# ── Multi-System Docker Tests ────────────────────────────
docker-test-fedora:
@echo "🐧 Testing on Fedora..."
docker compose -f docker/docker-compose.multi-system.yml run --rm test-fedora
docker-test-ubuntu:
@echo "🐧 Testing on Ubuntu..."
docker compose -f docker/docker-compose.multi-system.yml run --rm test-ubuntu
docker-test-debian:
@echo "🐧 Testing on Debian..."
docker compose -f docker/docker-compose.multi-system.yml run --rm test-debian
docker-test-arch:
@echo "🐧 Testing on Arch Linux..."
docker compose -f docker/docker-compose.multi-system.yml run --rm test-arch
docker-test-alpine:
@echo "🐧 Testing on Alpine..."
docker compose -f docker/docker-compose.multi-system.yml run --rm test-alpine
docker-test-all:
@echo "🐧 Testing on all systems..."
./docker/test-multi-system.sh
# ── Uruchomienie ──────────────────────────────────────────
config-init:
fixos config init
run-scan:
fixos scan
run-fix:
fixos fix
# ── Paczka ───────────────────────────────────────────────
build: clean
pip install build --quiet
python -m build
@echo "✅ Paczka gotowa w dist/"
clean:
rm -rf build/ dist/ *.egg-info/ .pytest_cache/ .coverage htmlcov/ __pycache__
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
@echo "✅ Wyczyszczono"