Skip to content

Commit

Permalink
Add Dockerfile and docker-compose to run tests using Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Hagstedt committed Nov 28, 2018
1 parent 5cb1efa commit 0b5d4fe
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM python:3.5

WORKDIR /usr/src/app

COPY . .

RUN pip install -r requirements_dev.txt
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ Tests require an instance of RabbitMQ. You can start a new instance using docker

Then you can run the tests with ``make test`` (requires ``nose``).

tests using docker-compose
^^^^^^^^^^^^^^^^^^^^^^^^^^
Start RabbitMQ using ``docker-compose up -d rabbitmq``. When RabbitMQ has started, start the tests using ``docker-compose up --build aioamqp-test``




.. _AMQP 0.9.1 protocol: https://www.rabbitmq.com/amqp-0-9-1-quickref.html
.. _PEP 3156: http://www.python.org/dev/peps/pep-3156/
Expand Down
17 changes: 17 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3'
services:
aioamqp-test:
build: .
command: ["make", "test"]
depends_on:
- rabbitmq
environment:
- AMQP_HOST=rabbitmq
rabbitmq:
hostname: rabbitmq
image: rabbitmq:3-management
environment:
- RABBITMQ_NODENAME=my-rabbit
ports:
- 15672
- 5672

0 comments on commit 0b5d4fe

Please sign in to comment.