Skip to content

Commit 4d6f6d0

Browse files
committed
configure user demo
1 parent e295b5d commit 4d6f6d0

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/test.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
# Use the service name 'rabbitmq' as the host, not localhost
2929
RABBITMQ_URL: "amqp://demo:demo@rabbitmq:5672"
3030
RABBITMQ_HOST: rabbitmq
31+
RABBITMQ_MANAGEMENT_URL: "http://demo:demo@rabbitmq:15672"
3132

3233
services:
3334
rabbitmq:
@@ -83,6 +84,11 @@ jobs:
8384
echo "RabbitMQ failed to start"
8485
exit 1
8586
87+
- name: Configure RabbitMQ Management user "demo"
88+
run: |
89+
docker exec ${{ job.services.rabbitmq.id }} rabbitmqctl set_user_tags "demo" administrator
90+
docker exec ${{ job.services.rabbitmq.id }} rabbitmqctl set_permissions -p / "demo" ".*" ".*" ".*"
91+
8692
- name: Run Tests
8793
run : |
8894
git config --global --add safe.directory /__w/action_subscriber/action_subscriber

spec/integration/automatic_reconnect_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ def spoke
1212
default_routes_for GusSubscriber
1313
end
1414
end
15-
let(:rabbitmq_host) {
16-
ENV["RABBITMQ_HOST"] || "127.0.0.1"
15+
let(:rabbitmq_management_url) {
16+
ENV["RABBITMQ_MANAGEMENT_URL"] || "http://127.0.0.1:15672"
1717
}
18-
let(:http_client) { RabbitMQ::HTTP::Client.new("http://#{rabbitmq_host}:15672") }
18+
let(:http_client) { RabbitMQ::HTTP::Client.new(rabbitmq_management_url) }
1919
let(:subscriber) { GusSubscriber }
2020

2121
it "reconnects when a connection drops" do

spec/integration/consumer_cancellation_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ def created
1414
end
1515
end
1616

17-
let(:rabbitmq_host) {
18-
ENV["RABBITMQ_HOST"] || "127.0.0.1"
17+
let(:rabbitmq_management_url) {
18+
ENV["RABBITMQ_MANAGEMENT_URL"] || "http://127.0.0.1:15672"
1919
}
20-
let(:http_client) { ::RabbitMQ::HTTP::Client.new("http://#{rabbitmq_host}:15672") }
20+
let(:http_client) { RabbitMQ::HTTP::Client.new(rabbitmq_management_url) }
2121
let(:subscriber) { ::YoloSubscriber }
2222

2323
it "resubscribes on cancellation" do

0 commit comments

Comments
 (0)