From 43b23c46ed623ea08d5b2138eac507b415ed3e6e Mon Sep 17 00:00:00 2001 From: Vincent Date: Wed, 17 Apr 2019 17:17:27 +0200 Subject: [PATCH] Add make test command --- Makefile | 7 +++++++ docker-compose.test.yml | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 docker-compose.test.yml diff --git a/Makefile b/Makefile index 20eff2aa1..7e329f251 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/docker-compose.test.yml b/docker-compose.test.yml new file mode 100644 index 000000000..89f7a114a --- /dev/null +++ b/docker-compose.test.yml @@ -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: + .: