Skip to content

Commit

Permalink
Merge pull request #20 from real-digital/12-create-base-docker-compose
Browse files Browse the repository at this point in the history
Split test env setup and test running in docker compose files
  • Loading branch information
MrTrustworthy committed Jul 4, 2019
2 parents d39612e + 1b4842f commit 3553e71
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ topics:
```

## Development

To setup your development environment, make sure you have at least Python 3.6 & [Pipenv](https://github.com/pypa/pipenv) installed, then run

```
pipenv install --dev
pipenv shell
Expand All @@ -117,12 +120,16 @@ export PYTHONPATH=$(pwd)

### Run tests

To run all tests, just run
To start up a local test setup (Kafka and Zookeeper), you can run

```
docker-compose up
```
While the `docker-compose` stack is up, you can also run the tests from the CLI via `pytest tests/ --integration --local`
While this `docker-compose` stack is up, you can run the tests from the CLI via `pytest tests/ --integration --local`


Alternatively, you can also run the entire test suite, without needing to setup the development environment, in docker compose via `docker-compose -f docker-compose.yml -f docker-compose.test.yml`


## Alternatives

Expand Down
14 changes: 14 additions & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3'
services:
esque:
build: .
volumes:
- .:/esque
environment:
ESQUE_TEST_ENV: "ci"
depends_on:
- kafka
command: >
-c
"(until (kafkacat -b kafka:9093 -X debug=all -L); do sleep 5s; done) \
&& pytest tests/ --integration"
13 changes: 1 addition & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,5 @@ services:
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0

esque:
build: .
volumes:
- .:/esque
environment:
ESQUE_TEST_ENV: "ci"
depends_on:
- kafka
command: >
-c
"(until (kafkacat -b kafka:9093 -X debug=all -L); do sleep 5s; done) \
&& pytest tests/ --integration"


0 comments on commit 3553e71

Please sign in to comment.