-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
127 lines (112 loc) · 5.08 KB
/
Copy pathMakefile
File metadata and controls
127 lines (112 loc) · 5.08 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
.PHONY: test test-all test-unit test-unit-slow test-integration test-integration-shard test-run test-oom verify-copy-memory verify-passthrough 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, ha, and slow tests)
test-unit:
uv run pytest -m "not e2e and not ha and not slow" -v -n auto
# Prod-scale passthrough tests (~500+ segments); serial to avoid xdist + CI timeouts.
test-unit-slow:
uv run pytest -m "slow" -v -n0
# Pre-merge gate: subprocess Prometheus proof of per-part copy memory release.
verify-copy-memory:
uv run pytest tests/integration/test_copy_per_part_metrics.py -m e2e -v -n0
# Exhaustive UploadPartCopy passthrough proof (real subprocess + MinIO).
verify-passthrough:
uv run pytest tests/integration/test_upload_part_copy_passthrough_e2e.py -m e2e -v -n0
# Integration shards for parallel CI (make test-integration-shard SHARD=memory_usage)
INTEGRATION_memory_usage_TESTS = tests/integration/test_memory_usage.py
INTEGRATION_memory_leak_TESTS = tests/integration/test_memory_leak.py
INTEGRATION_memory_copy_TESTS = tests/integration/test_copy_memory_governor.py tests/integration/test_copy_per_part_metrics.py tests/integration/test_upload_part_copy_passthrough_e2e.py
INTEGRATION_memory_copy_PYTEST_OPTS = -n0
INTEGRATION_core_TESTS = \
tests/integration/test_integration.py \
tests/integration/test_handlers.py \
tests/integration/test_concurrent_operations.py \
tests/integration/test_per_key_encryption.py \
tests/integration/test_presigned_put_e2e.py \
tests/integration/test_redis_coordination.py
INTEGRATION_multipart_TESTS = \
tests/integration/test_upload_part_copy.py \
tests/integration/test_part_ordering.py \
tests/integration/test_sequential_part_numbering.py \
tests/integration/test_sequential_part_numbering_e2e.py \
tests/integration/test_large_file_streaming.py \
tests/integration/test_entity_too_small_errors.py \
tests/integration/test_entity_too_small_fix.py \
tests/integration/test_partial_complete_fix.py \
tests/integration/test_multipart_range_validation.py
INTEGRATION_copy_range_TESTS = \
tests/integration/test_copy_passthrough.py \
tests/integration/test_download_range_requests.py \
tests/integration/test_get_prefetch.py \
tests/integration/test_elasticsearch_range_scenario.py \
tests/integration/test_state_recovery.py \
tests/integration/test_state_recovery_e2e.py
INTEGRATION_misc_TESTS = \
tests/integration/test_delete_objects_errors.py \
tests/integration/test_metadata_and_errors.py
# 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 one integration shard (CI matrix). SHARD=memory_usage|memory_leak|memory_copy|...
test-integration-shard:
ifndef SHARD
$(error SHARD is required, e.g. make test-integration-shard SHARD=memory)
endif
@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 \
$(if $(INTEGRATION_$(SHARD)_PYTEST_OPTS),$(INTEGRATION_$(SHARD)_PYTEST_OPTS),-n auto --dist loadgroup) \
$(INTEGRATION_$(SHARD)_TESTS); \
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
OOM_COMPOSE = -f tests/docker-compose.yml -f tests/docker-compose.oom.yml --profile oom
test-oom:
@docker compose $(OOM_COMPOSE) down 2>/dev/null || true
@docker compose $(OOM_COMPOSE) 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 $(OOM_COMPOSE) down; \
exit $$EXIT_CODE
# E2E cluster commands
e2e:
./e2e/cluster.sh $(filter-out $@,$(MAKECMDGOALS))
cluster:
./e2e/cluster.sh $(filter-out $@,$(MAKECMDGOALS))
%:
@: