carbon-relay-ng
carbon-relay-ng copied to clipboard
[WIP] bring up docker env in unit test
Current status:
I have a local amqp server running in a docker container, using the public rabbitmq
image. I'm trying to make go test -race github.com/graphite-ng/carbon-relay-ng/input -test.v -run TestAmqpConsumeRabbit
connect to it, but I can't get it to succeed because the topic exchange doesn't exist and I can't find a way to create it with rabbitmqctl
. I think if the unit test would connect to rabbitmq, then it could declare the topic exchange, and then the amqp input should succeed to connect on the next reconnect. So I think the next step should be to make the unit test connect and declare that exchange, and then verify that this way the input can connect successfully.
Side Note:
by default the rabbitmq
image user the user guest
with password guest
for the virtualhost /
. Alternatively users / vhosts can be created with these env vars:
RABBITMQ_DEFAULT_VHOST=vhost
RABBITMQ_DEFAULT_USER=test_user
RABBITMQ_DEFAULT_PASS=test_password