Skip to content

Commit dd3b74d

Browse files
committed
ler rabbitmq run from controller test makefile
1 parent 25cf0f7 commit dd3b74d

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

Makefile

+15-15
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@ start-rabbitmq-cluster:
2121
cd rabbitmq-cluster && make start
2222
@echo "✅ RabbitMQ cluster started."
2323

24-
start-rabbitmq:
25-
@echo "📡 Starting standalone RabbitMQ container on 'hobbit' network..."
26-
@docker network inspect hobbit >/dev/null || (echo "❌ Network 'hobbit' not found. Run 'make create-networks' first." && exit 1)
27-
@docker rm -f hobbit-rabbitmq >/dev/null 2>&1 || true
28-
@docker run -d \
29-
--name hobbit-rabbitmq \
30-
--network hobbit \
31-
-p 5672:5672 \
32-
-p 15672:15672 \
33-
rabbitmq:3-management
34-
@docker network connect hobbit-core hobbit-rabbitmq
35-
@echo "✅ RabbitMQ is running at:"
36-
@echo " AMQP: amqp://localhost:5672"
37-
@echo " Management: http://localhost:15672 (user: guest, pass: guest)"
24+
# start-rabbitmq:
25+
# @echo "📡 Starting standalone RabbitMQ container on 'hobbit' network..."
26+
# @docker network inspect hobbit >/dev/null || (echo "❌ Network 'hobbit' not found. Run 'make create-networks' first." && exit 1)
27+
# @docker rm -f hobbit-rabbitmq >/dev/null 2>&1 || true
28+
# @docker run -d \
29+
# --name hobbit-rabbitmq \
30+
# --network hobbit \
31+
# -p 5672:5672 \
32+
# -p 15672:15672 \
33+
# rabbitmq:3-management
34+
# @docker network connect hobbit-core hobbit-rabbitmq
35+
# @echo "✅ RabbitMQ is running at:"
36+
# @echo " AMQP: amqp://localhost:5672"
37+
# @echo " Management: http://localhost:15672 (user: guest, pass: guest)"
3838
start-dev-platform:
3939
docker-compose -f docker-compose-dev.yml up -d
4040

@@ -94,7 +94,7 @@ run-platform-elk:
9494
# cd hobbit-gui/gui-client && sh -c 'test "$$TRAVIS" = "true" && npm --quiet ci; true' && sh -c 'test "$$TRAVIS" = "true" || npm --quiet install; true' && npm --quiet run lint && npm --quiet run build-prod
9595
# cd hobbit-gui/gui-serverbackend && mvn --quiet --update-snapshots clean test
9696

97-
test: create-networks install-parent-pom start-rabbitmq
97+
test: create-networks install-parent-pom
9898
@echo "🔧 Running tests in platform-controller..."
9999
make --directory=platform-controller test
100100

platform-controller/Makefile

+9-1
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,22 @@ run:
1616
org.hobbit.controller.PlatformController
1717

1818
test:
19+
@echo "🔧 Starting required services with Docker Compose..."
1920
# Without HOBBIT_RABBIT_EXPERIMENTS_HOST we won't be able to connect to RabbitMQ
20-
docker compose --file=../docker-compose-dev.yml up -d cadvisor node-exporter prometheus redis
21+
docker compose --file=../docker-compose-dev.yml up -d cadvisor node-exporter prometheus redis rabbit
22+
@echo "✅ Services started: cadvisor, node-exporter, prometheus, redis , rabbit."
23+
24+
@echo "🐇 Running RabbitMQ and Redis environment variables setup..."
2125
HOBBIT_RABBIT_IMAGE=rabbitmq:management \
2226
HOBBIT_RABBIT_HOST=localhost \
2327
HOBBIT_RABBIT_EXPERIMENTS_HOST=localhost \
2428
HOBBIT_REDIS_HOST=localhost \
2529
PROMETHEUS_HOST=localhost \
30+
@echo "✅ Environment variables set for RabbitMQ and Redis."
31+
32+
@echo "🧪 Running tests with Maven..."
2633
mvn --quiet --update-snapshots -Dtest=$(test) clean test
34+
@echo "✅ Tests completed successfully."
2735

2836
test-single:
2937
docker rmi busybox

0 commit comments

Comments
 (0)