Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

RabbitMQ integration test in Bitbucket Pipelines

Hello,

I have set of integration test which deal with some services like Mongo and RabbitMQ. Test for Mongo integration works fine, but when I added RabbitMQ to services it doesn't work. It's look like inaccessible.

It's my pipelines file:

image: prooph/php:7.2-fpm-xdebug

pipelines:
default:
- step:
name: integration tests
caches:
- composer
script:
- apt-get update && apt-get install -y unzip git
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- composer test:integration
services:
- broker
- readmodel

definitions:
services:
readmodel:
image: mongo:latest
environment:
MONGODB_USER: devread
MONGODB_PASS: devread
MONGODB_DATABASE: ds
MONGO_DATA_DIR: /data/db
command: mongod --smallfiles
broker:
image: rabbitmq:3
environment:
RABBITMQ_DEFAULT_USER: rabbitmq
RABBITMQ_DEFAULT_PASS: rabbitmq
ports:
- 5672:5672

And output from console:

1) Test\Integration\MessageBroker\Consumer\RabbitMQTest::whenMessageIsOnQueueThenConsumerShouldReturnItErrorException: stream_socket_client(): unable to connect to tcp://127.0.0.1:5672 (Connection refused)/opt/atlassian/pipelines/agent/build/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/IO/StreamIO.php:141/opt/atlassian/pipelines/agent/build/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Connection/AbstractConnection.php:205/opt/atlassian/pipelines/agent/build/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Connection/AbstractConnection.php:189/opt/atlassian/pipelines/agent/build/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Connection/AMQPStreamConnection.php:60/opt/atlassian/pipelines/agent/build/test/integration/MessageBroker/RabbitMQTestCase.php:35/opt/atlassian/pipelines/agent/build/test/integration/MessageBroker/RabbitMQTestCase.php:76/opt/atlassian/pipelines/agent/build/test/integration/MessageBroker/RabbitMQTestCase.php:19

1 answer

It's my mistake, I should use localhost address in tests instead 127.0.0.1

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,217 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you