-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (55 loc) · 2.19 KB
/
Makefile
File metadata and controls
65 lines (55 loc) · 2.19 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
.PHONY: test test-all test-unit test-integration test-run test-oom e2e cluster lint
# Lint: ruff check + format check
lint:
uv run ruff check .
uv run ruff format --check .
# Default: run unit tests only (no containers needed)
test: test-unit
# Run unit tests (excludes e2e and ha tests)
test-unit:
uv run pytest -m "not e2e and not ha" -v -n auto
# Run integration tests (needs minio/redis containers)
test-integration:
@docker compose -f tests/docker-compose.yml down 2>/dev/null || true
@docker compose -f tests/docker-compose.yml up -d
@sleep 3
@AWS_ACCESS_KEY_ID=minioadmin AWS_SECRET_ACCESS_KEY=minioadmin uv run pytest -m "e2e" -v -n auto --dist loadgroup; \
EXIT_CODE=$$?; \
docker compose -f tests/docker-compose.yml down; \
exit $$EXIT_CODE
# Run all tests with containers (unit + integration)
test-all:
@docker compose -f tests/docker-compose.yml down 2>/dev/null || true
@docker compose -f tests/docker-compose.yml up -d
@sleep 3
@AWS_ACCESS_KEY_ID=minioadmin AWS_SECRET_ACCESS_KEY=minioadmin uv run pytest -v -n auto --dist loadgroup; \
EXIT_CODE=$$?; \
docker compose -f tests/docker-compose.yml down; \
exit $$EXIT_CODE
# Run specific test file/pattern with containers
# Usage: make test-run TESTS=tests/integration/test_foo.py
test-run:
@docker compose -f tests/docker-compose.yml down 2>/dev/null || true
@docker compose -f tests/docker-compose.yml up -d
@sleep 3
@AWS_ACCESS_KEY_ID=minioadmin AWS_SECRET_ACCESS_KEY=minioadmin uv run pytest -v -n auto --dist loadgroup $(TESTS); \
EXIT_CODE=$$?; \
docker compose -f tests/docker-compose.yml down; \
exit $$EXIT_CODE
# OOM proof test: runs s3proxy in a 256MB container and hammers it
test-oom:
@docker compose -f tests/docker-compose.yml --profile oom down 2>/dev/null || true
@docker compose -f tests/docker-compose.yml --profile oom up -d --build
@sleep 5
@AWS_ACCESS_KEY_ID=minioadmin AWS_SECRET_ACCESS_KEY=minioadmin \
uv run pytest -v tests/integration/test_memory_leak.py; \
EXIT_CODE=$$?; \
docker compose -f tests/docker-compose.yml --profile oom down; \
exit $$EXIT_CODE
# E2E cluster commands
e2e:
./e2e/cluster.sh $(filter-out $@,$(MAKECMDGOALS))
cluster:
./e2e/cluster.sh $(filter-out $@,$(MAKECMDGOALS))
%:
@: