Skip to content

Commit b32e279

Browse files
committed
get tests working in docker container
1 parent 48c0a2b commit b32e279

5 files changed

Lines changed: 19 additions & 16 deletions

File tree

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ dist: xenial
22
language: python
33
python: 3.7
44

5-
install:
6-
- pip3 install -r requirements.txt
7-
85
script:
96
- make all
107

Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,21 @@ api:
55
docker-compose up -d app
66

77
test:
8-
pytest --tb=short
8+
docker-compose run --rm --entrypoint='pytest /tests' app
9+
10+
unit-tests:
11+
docker-compose run --rm --entrypoint='pytest /tests/unit' app
12+
13+
integration-tests:
14+
docker-compose run --rm --entrypoint='pytest /tests/integration' app
15+
16+
e2e-tests:
17+
docker-compose run --rm --entrypoint='pytest /tests/e2e' app
918

1019
logs:
1120
docker-compose logs app | tail -100
1221

13-
all: build api test
22+
down:
23+
docker-compose down --remove-orphans
24+
25+
all: down build api test

docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ services:
1010
environment:
1111
- DB_HOST=postgres
1212
- DB_PASSWORD=abc123
13+
- API_HOST=app
14+
- PYTHONDONTWRITEBYTECODE=1
1315
volumes:
1416
- ./src:/src
17+
- ./tests:/tests
1518
ports:
1619
- "5005:80"
1720

tests/mypy.ini

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pytest]
2+
addopts = --tb=short

0 commit comments

Comments
 (0)