aboutsummaryrefslogtreecommitdiff
path: root/test/mq/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'test/mq/Makefile')
-rw-r--r--test/mq/Makefile60
1 files changed, 57 insertions, 3 deletions
diff --git a/test/mq/Makefile b/test/mq/Makefile
index 05521a91d..f2c4bbba7 100644
--- a/test/mq/Makefile
+++ b/test/mq/Makefile
@@ -1,22 +1,32 @@
-.PHONY: help test test-basic test-performance test-failover test-agent clean up down logs
+.PHONY: help build test test-basic test-performance test-failover test-agent clean up down logs
# Default target
help:
@echo "SeaweedMQ Integration Test Suite"
@echo ""
@echo "Available targets:"
+ @echo " build - Build SeaweedFS Docker images"
@echo " test - Run all integration tests"
@echo " test-basic - Run basic pub/sub tests"
@echo " test-performance - Run performance tests"
@echo " test-failover - Run failover tests"
@echo " test-agent - Run agent tests"
- @echo " up - Start test environment"
+ @echo " up - Start test environment (local build)"
+ @echo " up-prod - Start test environment (production images)"
+ @echo " up-cluster - Start cluster only (no test runner)"
@echo " down - Stop test environment"
@echo " clean - Clean up test environment and results"
@echo " logs - Show container logs"
+# Build SeaweedFS Docker images
+build:
+ @echo "Building SeaweedFS Docker image..."
+ cd ../.. && docker build -f docker/Dockerfile.go_build -t chrislusf/seaweedfs:local .
+ @echo "Building test runner image..."
+ cd ../.. && docker build -f test/mq/Dockerfile.test -t seaweedfs-test-runner .
+
# Start the test environment
-up:
+up: build
@echo "Starting SeaweedMQ test environment..."
docker-compose -f docker-compose.test.yml up -d master0 master1 master2
@echo "Waiting for masters to be ready..."
@@ -32,10 +42,54 @@ up:
sleep 20
@echo "Test environment is ready!"
+# Start the test environment with production images (no build required)
+up-prod: build-test-runner
+ @echo "Starting SeaweedMQ test environment with production images..."
+ docker-compose -f docker-compose.production.yml up -d master0 master1 master2
+ @echo "Waiting for masters to be ready..."
+ sleep 10
+ docker-compose -f docker-compose.production.yml up -d volume1 volume2 volume3
+ @echo "Waiting for volumes to be ready..."
+ sleep 10
+ docker-compose -f docker-compose.production.yml up -d filer1 filer2
+ @echo "Waiting for filers to be ready..."
+ sleep 15
+ docker-compose -f docker-compose.production.yml up -d broker1 broker2 broker3
+ @echo "Waiting for brokers to be ready..."
+ sleep 20
+ @echo "Test environment is ready!"
+
+# Build only the test runner image (for production setup)
+build-test-runner:
+ @echo "Building test runner image..."
+ cd ../.. && docker build -f test/mq/Dockerfile.test -t seaweedfs-test-runner .
+
+# Start cluster only (no test runner, no build required)
+up-cluster:
+ @echo "Starting SeaweedMQ cluster only..."
+ docker-compose -f docker-compose.cluster.yml up -d master0 master1 master2
+ @echo "Waiting for masters to be ready..."
+ sleep 10
+ docker-compose -f docker-compose.cluster.yml up -d volume1 volume2 volume3
+ @echo "Waiting for volumes to be ready..."
+ sleep 10
+ docker-compose -f docker-compose.cluster.yml up -d filer1 filer2
+ @echo "Waiting for filers to be ready..."
+ sleep 15
+ docker-compose -f docker-compose.cluster.yml up -d broker1 broker2 broker3
+ @echo "Waiting for brokers to be ready..."
+ sleep 20
+ @echo "SeaweedMQ cluster is ready!"
+ @echo "Masters: http://localhost:19333, http://localhost:19334, http://localhost:19335"
+ @echo "Filers: http://localhost:18888, http://localhost:18889"
+ @echo "Brokers: localhost:17777, localhost:17778, localhost:17779"
+
# Stop the test environment
down:
@echo "Stopping SeaweedMQ test environment..."
docker-compose -f docker-compose.test.yml down
+ docker-compose -f docker-compose.production.yml down
+ docker-compose -f docker-compose.cluster.yml down
# Clean up everything
clean: