Debian Codegraph @

test/integration/Makefile

raw
1 # Rspamd Integration Test Makefile
2
3 .PHONY: help keys build up down test test-proxy test-parallel clean logs check-asan
4
5 help:
6 @echo "Rspamd Integration Test"
7 @echo ""
8 @echo "Available targets:"
9 @echo " keys - Generate fuzzy encryption keys"
10 @echo " build - Build Docker containers"
11 @echo " up - Start Docker Compose services"
12 @echo " down - Stop Docker Compose services"
13 @echo " test - Run integration test"
14 @echo " test-proxy - Run integration test including proxy"
15 @echo " test-parallel - Run integration test with custom parallelism (PARALLEL=N)"
16 @echo " check-asan - Check AddressSanitizer logs for memory issues"
17 @echo " clean - Clean up data and logs"
18 @echo " logs - Show Docker logs"
19 @echo ""
20 @echo "Quick start:"
21 @echo " make keys build up test"
22
23 keys:
24 @echo "Generating fuzzy encryption keys..."
25 @./scripts/generate-keys.sh
26
27 build:
28 @echo "Building Docker containers..."
29 @docker compose build
30
31 up:
32 @echo "Cleaning previous data..."
33 @rm -rf data/fuzzy_train data/bayes_spam data/bayes_ham data/test_corpus
34 @rm -rf data/*.json data/*.log data/*.txt
35 @mkdir -p data
36 @echo "Starting Docker Compose services..."
37 @docker compose up -d --force-recreate
38 @echo "Waiting for services to be ready..."
39 @sleep 10
40 @docker compose ps
41
42 down:
43 @echo "Stopping Docker Compose services..."
44 @docker compose down
45
46 test:
47 @echo "Running integration test..."
48 @docker compose exec -T rspamd /bin/bash < ./scripts/integration-test.sh
49
50 test-proxy:
51 @echo "Running integration test (including proxy)..."
52 @TEST_PROXY=true docker compose exec -T rspamd /bin/bash < ./scripts/integration-test.sh
53
54 test-parallel:
55 @echo "Running integration test (parallel=$(PARALLEL))..."
56 @PARALLEL=$(PARALLEL) docker compose exec -T rspamd /bin/bash < ./scripts/integration-test.sh
57
58 clean:
59 @echo "Cleaning up..."
60 @rm -rf data/fuzzy_train data/bayes_spam data/bayes_ham data/test_corpus
61 @rm -rf data/*.json data/*.log data/*.txt
62 @docker compose down -v
63
64 logs:
65 @docker compose logs -f
66
67 check-asan:
68 @echo "Checking AddressSanitizer logs..."
69 @./scripts/check-asan-logs.sh
70
71 restart: down up
72
73 all: keys build up test check-asan