Add make test command

This commit is contained in:
Vincent 2019-04-17 17:17:27 +02:00
parent 040266a656
commit 43b23c46ed
2 changed files with 25 additions and 0 deletions

View file

@ -10,5 +10,12 @@ stop:
@bash docker/message.sh "stopping MobiliZon"
docker-compose down
@bash docker/message.sh "stopped"
test: stop
@bash docker/message.sh "Building front"
docker-compose -f docker-compose.yml -f docker-compose.test.yml run front yarn run build
@bash docker/message.sh "Front built"
@bash docker/message.sh "Running tests"
docker-compose -f docker-compose.yml -f docker-compose.test.yml run api mix test
@bash docker/message.sh "Tests runned"
target: init

18
docker-compose.test.yml Normal file
View file

@ -0,0 +1,18 @@
version: '3'
services:
postgres:
restart: "no"
environment:
POSTGRES_DB: mobilizon_test
front:
restart: "no"
api:
restart: "no"
environment:
MIX_ENV: "test"
MOBILIZON_DATABASE_DBNAME: mobilizon_test
command: "mix test"
volumes:
pgdata:
.: